Install codex config

From trailofbits/codex-config · View interactive version

Install codex config is an AI agent skill from the GitHub repository trailofbits/codex-config. Install or update this organization's Codex configuration from repo-local files into the user's Codex home. Use when asked to set up, install, update, bootstrap, or sync this Codex configuration, including the global AGENTS template, config.toml, hooks, rules, MCP servers, profile templates, and bun

How to use this skill

Skill file

Install Codex Config

Contents

Use this skill to install or update the checked-in Codex configuration on the

current machine. Use only files from the local repository. Do not fetch configuration from GitHub

or any other network source.

Source discovery

  1. Determine the git root with git rev-parse --show-toplevel when available.
  2. Choose the source root:

global-agents.md.

global-agents.md. This is the expected layout after extracting codex-config/ into its own

repository.

two-file marker.

  1. Confirm source files exist before offering them as installable components.

Components

Offer these components to the user. Mark missing target components as recommended, but still let

the user choose.

feature flags.

default; offer it only if the user wants a second identity, such as an API-key login alongside a

ChatGPT-plan login.

complete skill directory.

Inventory

Read or check these fixed target paths:

Run the skill discovery script and check the corresponding ~/.agents/skills/<name>/SKILL.md

target for every result. Do not maintain a hard-coded skill inventory in this workflow.

Also inspect ~/.codex/config.toml for existing [mcp_servers.context7] and

[mcp_servers.exa] tables. If the user asks about the optional profile template, check for existing

~/.codex/*.config.toml profile files before writing one.

User confirmation

Before writing outside the repository, present a concise install plan:

Ask for confirmation. If the environment supports a structured selection UI, use it. Otherwise ask

a single concise question and accept a comma-separated list such as

agents, config, mcp, hooks, rules, skills, all.

Install rules

AGENTS.md

If ~/.codex/AGENTS.md is missing, install global-agents.md from the source root. If it exists,

show the user a diff or concise summary and ask whether to overwrite, skip, or merge manually. Do

not silently overwrite it.

config.toml

If ~/.codex/config.toml is missing, install the source file. If it exists, merge conservatively:

asks to replace them.

After writing, validate TOML syntax.

MCP servers

Merge only missing [mcp_servers.context7] and [mcp_servers.exa] tables from

mcp-template.toml into ~/.codex/config.toml. Do not duplicate existing MCP server entries.

Remind the user that Exa needs EXA_API_KEY available in the environment or credential management

layer.

Profile template

Only install this component when the user opts in. Ask for a profile name, defaulting to api, and

copy profile-template.toml to ~/.codex/<name>.config.toml. Do not overwrite an existing profile

of that name without confirmation. Remind the user to create the key file the profile reads; the

template uses ~/.codex/api-key.txt. Never commit API keys. If the user chose a non-default name,

update the api-key.txt path in the copied profile's auth.command to match. Select the profile at

runtime with codex --profile <name>; do not merge it into config.toml.

Hooks

Create ~/.codex/hooks/ if needed. Copy selected hook scripts from the source root and set

executable bits. Existing hook files may be overwritten after the user confirms the hooks

component.

Rules

Create ~/.codex/rules/ if needed. Copy default.rules. If the target exists, ask whether to

overwrite or skip unless the user selected a full refresh.

Skills

Run the discovery script immediately before preview and again immediately before installation.

Create ~/.agents/skills/ if needed. For every reported entrypoint, copy its complete parent skill

directory to the same directory name under the target. Existing discovered skill directories may

be overwritten after the user confirms the skills component. Do not delete or change target skill

directories that are absent from the source repository.

When installing skills globally, install every discovered skill, including this one. Preserve

unrelated user-local skill directories.

Post-install

Summarize:

If config.toml changed, suggest starting a fresh Codex session so the new defaults, hooks, skills,

and MCP entries are loaded.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.