Render local Codex and OpenCode repo config from .ai-codex.json
Project description
augint-opencodex
augint-opencodex is a Python tool that renders local Codex and OpenCode project
configuration from a single tracked manifest, .ai-codex.json.
The first working slice is implemented here. It ships a real ai-codex CLI with:
ai-codex syncto read.ai-codex.jsonand render.ai-opencodex.md,.codex/config.toml,opencode.json, and shared skillsai-codex doctorto inspect manifest resolution, generated files, local ignore setup, and staged generated artifacts- a first-pass profile model with
augintandgov - local-only ignore handling through
.git/info/exclude
Installation
For local dev:
uv sync --group dev
Once the package is published, the intended install flows are:
uvx --from augint-opencodex ai-codex sync
uv tool install augint-opencodex
ai-codex sync
Manifest
This tool expects a tracked .ai-codex.json file in the target repository.
If it is missing when you run ai-codex sync, the command will prompt for a
profile and create a minimal manifest before rendering. Pass --profile augint
or --profile gov to skip the prompt (useful for scripts). --check still
fails when the manifest is missing so CI does not silently initialize repos.
{
"version": 1,
"profile": "augint",
"references": ["./ai-lls-lib"],
"blocked_paths": [
"**/secrets/**",
"**/*.pem",
"**/terraform.tfstate*"
],
"content_policy": {
"no_emojis": true,
"no_ai_mentions": true
},
"shell_guardrails": {
"ask": ["aws *", "terraform *", "kubectl *", "git push *"],
"deny": ["aws iam create*", "aws iam put*"]
},
"patterns": {
"org_python_library": true
},
"opencode": {
"enabled": true,
"default_model": "qwen3-coder",
"local_provider": {
"kind": "openai-compatible",
"name": "ollama",
"base_url": "http://host.docker.internal:11434/v1"
},
"models": [
{ "id": "qwen3-coder", "name": "Qwen3 Coder (local)" }
],
"bedrock": {
"enabled": false,
"models": []
}
},
"codex": {
"provider": "openai",
"model": null,
"approval_policy": null,
"sandbox_mode": null,
"web_search": null
}
}
The current schema lives in schemas/ai-codex.schema.json.
OpenCode and Codex manifest fields
The opencode and codex sections let the manifest fully express non-secret
tool configuration instead of deferring those details to a separate launcher:
opencode.local_provider— OpenAI-compatible local endpoint (e.g. Ollama) rendered asprovider.<name>.options.baseURLinopencode.json.opencode.default_model— top-levelmodelinopencode.json.opencode.models— curated catalog attached to the local provider.opencode.bedrock.enabled/opencode.bedrock.models— toggles theamazon-bedrockprovider entry with the listed model IDs.codex.provider—openaioraws. Emitted as a comment in.codex/config.tomlso the runtime launcher knows which auth path to select. Raw secrets are never written to generated files.codex.model,codex.approval_policy,codex.sandbox_mode,codex.web_search— override the defaults carried by the active profile.
Commands
Render files into the current repository:
uv run ai-codex sync
Preview pending changes without writing:
uv run ai-codex sync --dry-run
Fail if the repo is out of sync:
uv run ai-codex sync --check
Inspect the current repo state:
uv run ai-codex doctor
Generated Files
The first slice writes:
.ai-opencodex.md.codex/config.tomlopencode.json.agents/skills/README.md.agents/skills/org-python-tooling/SKILL.mdwhenpatterns.org_python_libraryis enabled
Generated outputs are added to .git/info/exclude by default so target repositories do not need
to commit them.
Canonical Ownership
There is one source of truth for each generated file, and one tool responsible
for each runtime concern. This split keeps .ai-shell.yaml from drifting out
of sync with generated config.
File ownership
| File | Owner | Notes |
|---|---|---|
.ai-codex.json |
user (tracked) | Source of truth for all generated files |
opencode.json |
augint-opencodex |
Repo root; generated |
.codex/config.toml |
augint-opencodex |
Repo root; generated |
.ai-opencodex.md |
augint-opencodex |
Repo root; generated |
.agents/skills/** |
augint-opencodex |
Generated |
Generated files MUST NOT be hand-edited. Re-run ai-codex sync after manifest
changes.
Runtime ownership (augint-shell)
augint-shell is responsible only for runtime and container behavior:
- bind-mounting
.codex/andopencode.jsoninto the container - injecting secrets (
OPENAI_API_KEY, AWS credentials) at launch time - selecting Bedrock vs OpenAI auth paths based on the manifest's
codex.provider/opencode.bedrock.enabledsignals - CLI launch flags (
ai-shell opencode,ai-shell codex)
augint-shell should not ship template copies of opencode.json or
.codex/config.toml, and .ai-shell.yaml should stop documenting
[opencode] / [codex] config shape that duplicates .ai-codex.json.
Consumption inside ai-shell containers
The generated files live at repo root in the host working directory. Inside an
ai-shell container, they are consumed as follows:
opencode.json— theai-shell opencodecommand launches OpenCode with the repo's working directory as CWD, so OpenCode discoversopencode.jsondirectly.ai-shell opencode --provider local|awsselects which provider block from the generatedopencode.jsonis active at launch and injects the matching credentials or endpoint env vars. It does not rewrite the file..codex/config.toml—ai-shellbind-mounts the host.codex/directory into the container. Codex is launched withCODEX_HOME=$(pwd)/.codexso the generated file serves as the Codex home config.ai-shell codex --provider openai|awsmirrorscodex.providerfrom the manifest and sets the corresponding auth env vars (OPENAI_API_KEY, AWS credential chain). Secrets are never written into.codex/config.tomloropencode.json..ai-opencodex.md— Codex discovers it through theproject_doc_fallback_filenamesentry in the generated.codex/config.toml; OpenCode reads it through theinstructionsblock inopencode.json.
If a repo uses augint-opencodex but is launched outside ai-shell, the same
files are still consumed by running codex / opencode directly from the
repo root with CODEX_HOME=$(pwd)/.codex.
augint-shell migration
Once a repo adopts augint-opencodex, the following can be removed from
augint-shell:
src/ai_shell/templates/opencode/opencode.jsonsrc/ai_shell/templates/codex/config.toml[opencode]and[codex]config blocks in the scaffolded.ai-shell.yamltemplate (beyond runtime toggles likeprovider)codex_openai_api_keyhandling inconfig.pymoves to pure runtime env injection
Runtime-only fields that remain in .ai-shell.yaml:
opencode.provider(local|aws) — chooses which provider block fromopencode.jsonthe launcher should activate- Secret material passed via environment variables
Dogfooding This Repo
This repository is set up to dogfood the generated instructions flow without a root AGENTS.md.
- Keep
.ai-codex.jsontracked in the repo root. - Run
uv run ai-codex syncto generate.ai-opencodex.md,.codex/config.toml, and the other local-only artifacts. - Start Codex with
CODEX_HOME=$(pwd)/.codex codexso Codex uses the generated.codex/config.tomlas its home config and discovers.ai-opencodex.mdviaproject_doc_fallback_filenames.
Avoid creating a root AGENTS.md here. Codex checks AGENTS.md before fallback filenames in the
same directory, so a root AGENTS.md would shadow .ai-opencodex.md and split Codex from the
generated OpenCode instructions.
Organizational Python Standard
This project uses ai-lls-lib/ in the planning repo as the concrete reference for the
organization-wide Python package and tooling standard:
uv-first packaging and development workflowsrc/layout and console scripts from[project.scripts]ruff,mypy,pytest, andpre-commit- security and compliance checks in CI
- Conventional Commit and semantic-release-compatible versioning
- a stable Makefile task surface
Development
make install
make test
make format
make typecheck
make build
Project details
Release history Release notifications | RSS feed
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 augint_opencodex-0.4.0.tar.gz.
File metadata
- Download URL: augint_opencodex-0.4.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1edcdaf04a92c9fdf3d4be981bbfd47c78b5d87abf3bcf775e8a829f629cc713
|
|
| MD5 |
287741368c790777de1a25167bf6c356
|
|
| BLAKE2b-256 |
d3884af9b35de29ddd53690f24c7f8dd260142ea76fff13f60b4fb63be92506a
|
Provenance
The following attestation bundles were made for augint_opencodex-0.4.0.tar.gz:
Publisher:
pipeline.yaml on svange/augint-opencodex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
augint_opencodex-0.4.0.tar.gz -
Subject digest:
1edcdaf04a92c9fdf3d4be981bbfd47c78b5d87abf3bcf775e8a829f629cc713 - Sigstore transparency entry: 1314019126
- Sigstore integration time:
-
Permalink:
svange/augint-opencodex@58c15c349f88442606f8b5f9ef52c13f47c5359d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/svange
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yaml@58c15c349f88442606f8b5f9ef52c13f47c5359d -
Trigger Event:
push
-
Statement type:
File details
Details for the file augint_opencodex-0.4.0-py3-none-any.whl.
File metadata
- Download URL: augint_opencodex-0.4.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54bc2e9182dd7d3394959cd6621c551b31f3cc3ad9a4a2277218e59919e513fa
|
|
| MD5 |
c03ba52bdacdd204c04157c941041b0b
|
|
| BLAKE2b-256 |
405fb0110dc11283958ce505a5ea84c28d7a369c136a25042844c8baf660e6c1
|
Provenance
The following attestation bundles were made for augint_opencodex-0.4.0-py3-none-any.whl:
Publisher:
pipeline.yaml on svange/augint-opencodex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
augint_opencodex-0.4.0-py3-none-any.whl -
Subject digest:
54bc2e9182dd7d3394959cd6621c551b31f3cc3ad9a4a2277218e59919e513fa - Sigstore transparency entry: 1314019477
- Sigstore integration time:
-
Permalink:
svange/augint-opencodex@58c15c349f88442606f8b5f9ef52c13f47c5359d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/svange
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yaml@58c15c349f88442606f8b5f9ef52c13f47c5359d -
Trigger Event:
push
-
Statement type: