This document is the day-to-day developer handbook for codex2opencode.
For repository goals and guardrails, see AGENTS.md.
For system design, see ARCHITECTURE.md.
For user-facing install and usage, see README.md.
Editable development environment:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e .Packaging environment:
python3 -m venv .venv-release
. .venv-release/bin/activate
python3 -m pip install build twineRun the full unit test suite:
PYTHONPATH=bridge python3 -m unittest discover -s tests -p 'test_*.py' -vRun the opt-in real Opencode smoke tests:
PYTHONPATH=bridge CODEX2OPENCODE_RUN_REAL=1 python3 -m unittest tests.test_real_opencode_cli -vBridge smoke:
codex2opencode ask --prompt "Reply with ok only" --workspace "$PWD" --new
codex2opencode doctor --workspace "$PWD"Fresh-session skill smoke:
codex exec -C "$PWD" --dangerously-bypass-approvals-and-sandbox "Use the codex-to-opencode skill. Ask Opencode to reply with ok only."Build distributions:
.venv-release/bin/python -m build
.venv-release/bin/python -m twine check dist/*Use this as the minimum verification bar:
- bridge code change: run the full unit test suite
- CLI behavior change:
run unit tests and at least one direct
codex2opencodesmoke command - skill trigger change: run unit tests and one fresh-session natural-language trigger smoke
- packaging or release change:
run unit tests, build distributions, and
twine check - Opencode integration change: run the opt-in real Opencode smoke tests if local auth is available
- Make the change in the smallest coherent slice.
- Update tests in the same change when behavior shifts.
- Update docs in the same change for any user-visible or developer-visible change.
- Verify with the minimum test matrix above.
- Review the diff before commit.
- Confirm the working tree is clean.
- Run the full unit test suite.
- Run a real
codex2opencode asksmoke test. - Run a real fresh-session skill smoke test.
- Build the distributions in
.venv-release. - Run
.venv-release/bin/python -m twine check dist/*. - Tag the release.
- Push the tag.
- Confirm GitHub Actions release workflow succeeds.
- Confirm the version appears on PyPI.
Default state root:
~/.codex/codex2opencode/
Useful locations:
threads/: stored thread state and lock filesruns/: run artifacts per thread keylogs/bridge.log: append-only JSONL bridge events
Useful debugging commands:
codex2opencode status --workspace "$PWD"
codex2opencode doctor --workspace "$PWD"
codex2opencode forget --workspace "$PWD"
codex2opencode gc --max-age-days 7Skill debugging notes:
- there is no dedicated skill-discovery log in this repository
logs/bridge.logis only useful after the skill has successfully invokedcodex2opencode- if direct CLI commands work but a trigger phrase does not, test again in a fresh Codex session
- after changing
skills/codex-to-opencode/SKILL.md, validate with a fresh session rather than an already-open one
bridge/codex2opencode/cli.pybridge/codex2opencode/opencode_cli.pybridge/codex2opencode/event_stream.pybridge/codex2opencode/state.pybridge/codex2opencode/threading.pybridge/codex2opencode/locking.pyskills/codex-to-opencode/SKILL.mdtests/test_admin_commands.pytests/test_ask_flow_mock.pytests/test_real_opencode_cli.py
- one-way Codex-to-Opencode only
- local Opencode CLI only
- POSIX locking only
- no hidden repair logic inside the bridge