Manage project-local Codex configuration from reusable templates
Project description
codexmgr
codexmgr manages project-local Codex configuration from reusable templates.
It keeps hand-written project instructions in AGENTS.md and generated Codex
configuration in .codex/ synchronized from a small declarative
.codex/codexmgr.toml file.
The tool is intentionally narrow:
- compose reusable AGENTS.md instruction fragments
- enable or disable Codex skills per project
- write reproducible lock data for the resolved project configuration
- run
codexwith project.codex/config.tomlvalues translated into-coverrides
Requirements
- Python 3.11 or newer
uvfor local developmentcodexonPATHonly when usingcodexmgr codex ...
Installation
From a checkout:
uv sync --group dev
uv run codexmgr --help
For local command-line use from this repository:
uv tool install .
Quick Start
Create the project .codex/ directory:
codexmgr setup
Create or install a named AGENTS.md template under
$CODEXMGR_HOME/agentsmd/<name>.toml. If CODEXMGR_HOME is unset,
~/.codexmgr is used.
[coding]
text = """
- Keep source files focused and small.
- Add tests for behavior changes before implementation.
"""
[coding.debugging]
text = "Prefer lasting regression tests over temporary scripts."
Add the template to the current project:
codexmgr agentsmd add coding
This updates .codex/codexmgr.toml, runs apply, writes
.codex/codexmgr.lock, and refreshes the managed block in AGENTS.md.
Managed Files
codexmgr reads and writes these project files:
.codex/codexmgr.toml: source configuration edited by CLI commands or by hand.codex/codexmgr.lock: resolved template and skill state written byapply.codex/config.toml: Codex config updated with[[skills.config]]entriesAGENTS.md: project instructions, with only the managed block replaced
The managed AGENTS.md block is:
<!-- BEGIN CODEXMGR GENERATED -->
<!-- END CODEXMGR GENERATED -->
Manual content outside this block is preserved. If the block is missing,
codexmgr appends it. If AGENTS.md is missing, codexmgr creates it.
Project Configuration
.codex/codexmgr.toml supports AGENTS.md templates and skill state:
[agents_md]
src = ["coding", "/absolute/or/project-relative/template.toml"]
[skills]
enabled = ["review-helper"]
disabled = ["experimental-skill", "skills/local-disabled"]
Named AGENTS.md templates resolve from $CODEXMGR_HOME/agentsmd/<name>.toml.
Path-like template values resolve relative to the project unless they are
absolute paths.
Named skills resolve from $CODEX_HOME/skills/<name>/SKILL.md. If CODEX_HOME
is unset, ~/.codex is used. Path-like skill values resolve to either a
SKILL.md file or a directory containing SKILL.md. Missing skills are written
as name-based entries so Codex can resolve them later.
Mutating commands run apply automatically unless --no-sync is passed.
Project guidelines require apply whenever .codex/codexmgr.toml changes,
unless --no-sync was explicitly requested.
Template Format
Template files are TOML documents. Each top-level key must be a table and
becomes an AGENTS.md heading. A text value inside a table becomes the body
under that heading. Nested tables become nested headings.
[coding]
text = "Top-level guidance."
[coding.tests]
text = "Test behavior, not implementation details."
renders as:
# coding
Top-level guidance.
## tests
Test behavior, not implementation details.
Unsupported scalar entries fail loudly instead of being silently ignored. This
keeps template mistakes visible during apply.
Commands
codexmgr setup
codexmgr apply
codexmgr agentsmd add [--no-sync] <name-or-template-path>
codexmgr agentsmd remove [--no-sync] <name-or-template-path>
codexmgr skill enable [--no-sync] <name-or-skill-path>
codexmgr skill disable [--no-sync] <name-or-skill-path>
codexmgr codex <args...>
setup creates .codex/ in the current project.
apply reads .codex/codexmgr.toml, resolves configured sources, writes
.codex/codexmgr.lock, updates .codex/config.toml skill entries when a
[skills] table is configured, and refreshes the generated AGENTS.md block
when [agents_md] is configured.
agentsmd add validates that the template exists before writing config.
Repeated adds keep one source entry.
agentsmd remove removes a configured template source and fails if the source
is not present.
skill enable and skill disable keep enabled and disabled lists mutually
exclusive. Repeated commands keep one entry.
codex forwards arguments to the real codex command. Values from
.codex/config.toml are flattened into -c key=value overrides. User-provided
-c or --config overrides are merged after project config: scalar values
replace earlier values, while list values append.
Development
Install dependencies:
uv sync --group dev
Run tests:
uv run pytest
Build distributions:
uv build
The package is typed (py.typed) and the test suite covers CLI behavior,
template rendering, TOML writing, skill resolution, Codex command generation,
home-directory resolution, and package metadata.
Release Notes
The GitHub workflow runs the test matrix on Python 3.11, 3.12, and 3.13 across
Linux, Windows, and macOS. The publish workflow builds and publishes to PyPI
when the version in pyproject.toml differs from the latest published version.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codexmgr-0.1.0.tar.gz.
File metadata
- Download URL: codexmgr-0.1.0.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51c6f21045a68b321d934702463791d6f7a532b5595e290b1d73a55b3366df50
|
|
| MD5 |
0057f732a83a361364850fb5f79a4bfa
|
|
| BLAKE2b-256 |
a9aaf2cb19630aa214e3a440a42a52b5e7bb79b18c4bf2c70c7ab4f1f5e4ede4
|
Provenance
The following attestation bundles were made for codexmgr-0.1.0.tar.gz:
Publisher:
version_publish_main.yml on JulianKimmig/codexmgr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codexmgr-0.1.0.tar.gz -
Subject digest:
51c6f21045a68b321d934702463791d6f7a532b5595e290b1d73a55b3366df50 - Sigstore transparency entry: 1733276728
- Sigstore integration time:
-
Permalink:
JulianKimmig/codexmgr@387383fe419a016b1dca7ca67ca055d59779ca76 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/JulianKimmig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
version_publish_main.yml@387383fe419a016b1dca7ca67ca055d59779ca76 -
Trigger Event:
push
-
Statement type:
File details
Details for the file codexmgr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codexmgr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba1fe29ef9815e8d448f670a8a62e385d356227beba72b7e9dab228958404630
|
|
| MD5 |
12cdd8de5205f6eb4219d308229169e2
|
|
| BLAKE2b-256 |
29491a7bef779d57956be9fe05e6448167838de7282b6cff7ddbf328660bb90a
|
Provenance
The following attestation bundles were made for codexmgr-0.1.0-py3-none-any.whl:
Publisher:
version_publish_main.yml on JulianKimmig/codexmgr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codexmgr-0.1.0-py3-none-any.whl -
Subject digest:
ba1fe29ef9815e8d448f670a8a62e385d356227beba72b7e9dab228958404630 - Sigstore transparency entry: 1733276878
- Sigstore integration time:
-
Permalink:
JulianKimmig/codexmgr@387383fe419a016b1dca7ca67ca055d59779ca76 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/JulianKimmig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
version_publish_main.yml@387383fe419a016b1dca7ca67ca055d59779ca76 -
Trigger Event:
push
-
Statement type: