codexwright
by Jack-mi
README.md
# codexwright
[](https://github.com/Jack-mi/codexwright/actions/workflows/test.yml)
[](https://jack-mi.github.io/codexwright/)
[](LICENSE)

**Design, build, migrate, and evolve runnable agentic workflows on the Codex SDK from the coding agent you already use.**
Turning a goal, existing repository, diagram, failing trace, or legacy agent framework into a reliable workflow usually forces teams to hand-wire orchestration, sandboxes, and eval gates or adopt a separate framework runtime. `codexwright` solves this inside `Codex`, `Claude Code`, `OpenCode`, or any stdio MCP client through lifecycle Agent Skills backed by a local MCP builder service.
`codexwright` follows a **single-Agent-first** architecture policy: it selects the smallest sufficient mix of one Agent, reusable Skills, bounded tools, or ordinary code, adding multi-Agent threads only when justified. `codexwright_invoke` stages and verifies an exact diff proposal without touching your files; `codexwright_apply` writes only after page-by-page human approval via MCP form elicitation or `codexwright review`. The output is a **standalone Codex SDK package** (library, `mas` CLI, and task-level MCP server) with zero runtime dependency on `codexwright`.
`0.5.0` | Codex SDK/runtime `0.167.0` | Python 3.10+ | Apache-2.0
## When To Use codexwright
| Approach | Target runtime | Host workflow | Architecture posture | Write / change gate | Evaluation & ops |
| --- | --- | --- | --- | --- | --- |
| Hand-written Codex SDK | Codex SDK | Any editor or coding agent, manual wiring | Manual per repository | Direct file edits and repo tests | Custom scripts per project |
| LangGraph / CrewAI | Framework graph or crew runtime | Python SDK and framework CLI | Multi-node graphs or multi-role crews by default | Direct code edits | Framework or external SaaS tracing and evals |
| Google agents-cli (ADK) | Google ADK / Vertex AI Agent Engine | Standalone scaffold CLI + Agent Skills | ADK agent templates and Cloud harness | CLI scaffolding and direct edits | ADK eval, OTel, Vertex deploy scaffold |
| codexwright (Codex SDK) | Standalone Codex SDK package (no builder runtime dep) | Inside Codex, Claude Code, OpenCode, or stdio MCP | Single-Agent-first (`ArchitectureSpec`: Agent, Skill, tool, or code) | Staged `invoke` diff + page-by-page human-approved `apply` | Built-in `mas eval`, `compare`, `analyze`, OTLP `trace`, `cost`, Docker + CI |
## Install
From source (no PyPI release yet):
```sh
git clone https://github.com/Jack-mi/codexwright.git codexwright
cd codexwright
python3 scripts/bootstrap.py
codex plugin marketplace add "$PWD"
codex plugin add codexwright@codexwright-local
```
Bootstrap installs a private builder at `~/.local/share/codexwright/venv` (override with `--environment`) without touching your target project. Install the lifecycle Skills (`codexwright` plus `build`, `eval`, `deploy`, and `observe`):
```sh
python3 -m pip install -e .
codexwright setup # detected hosts, user scope (future PyPI: uvx --from codexwright codexwright setup)
codexwright setup --host codex --scope project --project .
codexwright update && codexwright info
```
Point your MCP client at the private interpreter:
```json
{
"mcpServers": {
"codexwright": {
"command": "/absolute/path/from/bootstrap/bin/python",
"args": ["-m", "codexwright.mcp_server"],
"env": {"CODEXWRIGHT_ALLOW_APPLY": "1"}
}
}
}
```
`CODEXWRIGHT_ALLOW_APPLY=1` only exposes apply; approval is always human. `CODEXWRIGHT_HOME` selects state, `CODEXWRIGHT_MODEL` optionally selects the model.
## Use
Ask the Skill to preflight, register a project, and invoke with a goal plus a stable idempotency key (MCP tool calls, not shell commands):
```text
codexwright_preflight({})
codexwright_register({"path": "/absolute/project"})
codexwright_invoke({"envelope": {
"workspace_id": "ws_ID",
"goal": "Build a ticket-triage workflow. Use one Agent if sufficient.",
"operation": "build",
"idempotency_key": "triage-v1"
}})
codexwright_read({"category": "proposals", "reference": "prop_ID"})
codexwright_apply({"request": {"proposal_id": "prop_ID", "idempotency_key": "apply-v1"}})
```
Read every diff page until `next_offset` is null before applying. Apply requires MCP form approval, or `codexwright review` in a local browser when the host lacks form elicitation.
Operations: `analyze`, `review`, `explain`, and `plan` inspect; `build`, `edit`, `migrate`, and `refactor` prepare scoped proposals; `auto` chooses. Follow-ups reuse `session_id` with a new idempotency key. `codexwright_status` inspects a run; `codexwright_recover` reconciles an interrupted run without replaying writes.
Tools: `codexwright_preflight`, `codexwright_register`, `codexwright_import`, `codexwright_login`, `codexwright_invoke`, `codexwright_read`, `codexwright_status`, `codexwright_verify`, `codexwright_recover`, `codexwright_apply` (apply only when exposed).
## Generated workflow
The output is a standalone Codex SDK package with library, `mas` CLI, and task-level MCP entrypoints. It does not import codexwright at runtime.
```sh
python3 -m venv .venv
.venv/bin/python -m pip install .
.venv/bin/mas run --input request.json
.venv/bin/mas status --run-id latest && .venv/bin/mas verify --run-id latest
.venv/bin/mas eval --dataset tests/eval.json --min-pass-rate 1.0
.venv/bin/mas analyze --report artifacts/eval.json
.venv/bin/mas trace --run-id latest --output trace.json && .venv/bin/mas cost --run-id latest
.venv/bin/mas serve
```
The scaffold also emits `Dockerfile`, `healthcheck.py`, and `.github/workflows/ci.yml`. `eval` checks deterministic assertions and can use project-local metrics declared in `workflow.extensions.json`; `trace` and `cost` are evidence, not a bill. See [Evaluation and operations](docs/evaluation-and-operations.md) and [Extensions](docs/extensions.md).
## Hosts
| Host | Integration |
| --- | --- |
| Codex | `adapters/codex` local plugin |
| Claude Code | `adapters/claude-code` session plugin |
| OpenCode V2 | `adapters/opencode` MCP config and instructions |
| Automation | Any stdio MCP client |
Adapters share one builder and do not replace the Codex SDK runtime or weaken approval. Current host commissioning status is in [the acceptance matrix](docs/mcp-0.4-acceptance.md#host-support-matrix).
## Status And Limits
The local macOS suite reports 336 passed, 2 skipped, and six example subtests. GitHub Actions passes the full Ubuntu/macOS matrix, installed-wheel check, and generated Docker build (run `46565474239`). Not yet verified: real human approval/login on every host and the live model edit cases. PyPI and marketplace packages are not published. Telemetry is opt-in and off by default ([Telemetry](docs/telemetry.md)).
Boundary: exact proposal, scope, revision, snapshot, and one-use human approval. Generated SDK state is private; checks and tools are OS-sandboxed; unknown outcomes are reconciled, never replayed. See [Implementation status](docs/implementation-status.md) and [Product positioning](docs/product-positioning.md).
## FAQ
### Is codexwright an agent runtime?
No. `codexwright` is a build-time architecture and construction service (Skills + local stdio MCP). Generated workflows execute directly on the Codex SDK with their own library, `mas` CLI, and task-level MCP server, and never import `codexwright` at runtime.
### How does codexwright compare to Google's `agents-cli`?
Google's `agents-cli` scaffolds and operates agents targeting Google ADK and Vertex AI. `codexwright` targets the Codex SDK, runs inside your existing coding agent over stdio MCP, enforces a single-Agent-first `ArchitectureSpec`, and gates every target write behind page-by-page human diff approval.
### Does using Claude Code or OpenCode replace the Codex SDK runtime?
No. Host adapters in Codex, Claude Code, OpenCode, or any stdio MCP client only load the Skills and invoke the `codexwright_*` MCP tools. Both the shared builder service and the generated workflow run on the Codex SDK.
### When should I migrate from CrewAI or LangGraph?
Migrate when your workflow's value is captured by an observable input/output contract and you want Codex SDK execution, OS-sandboxed tools, and deterministic verification without maintaining a separate crew or graph runtime. See the [CrewAI](docs/migrations/crewai.md), [LangGraph](docs/migrations/langgraph.md), and [Claude Agent SDK](docs/migrations/claude-agent-sdk.md) guides.
## Documentation
| Guide | Contents |
| --- | --- |
| [Product positioning](docs/product-positioning.md) | Value, lifecycle, host integration, target output, scope |
| [Architecture blueprint](docs/codexwright-blueprint.md) | Boundaries, SDK mapping, contracts, lifecycle |
| [Docs index](docs/index.md) | Published guides, comparison matrix, and migration material |
| [Migration](docs/codexwright-migration.md) | 0.5.0 identifiers, installation, state compatibility |
| [Evaluation and operations](docs/evaluation-and-operations.md) | Eval datasets, compare, analyze, trace, cost |
| [Extensions](docs/extensions.md) | Bounded metrics, deploy declarations, version negotiation |
| [Commissioning](docs/commissioning.md) | Manual host approval/login matrix |
| [Release](docs/release.md) | PyPI trusted-publishing checklist |
| [CHANGELOG](CHANGELOG.md) | Release notes for 0.5.0 and 0.2.0-0.4.1 history |
## Development
```sh
python3 -m venv .venv
.venv/bin/python -m pip install -e . pytest build
.venv/bin/pytest -q tests examples
.venv/bin/python scripts/export_schemas.py
.venv/bin/python -m build --wheel
```
Apache-2.0. See [LICENSE](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues