A source-faithful V port of the Rust codex-rs workspace from
openai/codex.
From the repository root, with V installed:
v .
./codex.v --help
./codex.v --versionValidated on Linux with V 0.5.2 at
da44f8514f2b787d88c9b6b569e21eae933c3b24.
V names the executable after the checkout directory; the commands above assume
the default codex.v directory name. To choose a different executable name, use
v -o codex ..
The entry point lives in cmd/codex, selected by base_url in v.mod. Its
modules.v imports every translated module so the root build checks their V
declarations and active function bodies. Generic bodies are checked through their
instantiated calls, including those exercised by tests. Keeping the entry sources
in this directory also prevents the generated codex.v executable from being read as source on a
second v . invocation. The CLI tests check that the import list stays complete.
This is still a partial port. The executable supports help and the V port's
version; starting an interactive session or passing a prompt exits with an
explicit error because the interactive runtime has not been translated yet.
Compilation does not implement the dependency boundaries marked // STUB:.
Run formatting before producing the default executable: the formatter recursively
reads .v files and would otherwise try to format the root codex.v binary.
Remove that generated executable before formatting again, or build with
v -o codex . instead.
v fmt -verify .
v .
v . # Also verify rebuilding in the same checkout.
v test .
v -ownership -o /tmp/codex-ownership .
v -ownership -d ownership -skip-running -o /tmp/codex-cli-tests cmd/codex/main_test.v
/tmp/codex-cli-tests
v -ownership -d ownership -skip-running -o /tmp/codex-status-tests codex_tui/status/thread_usage_test.v
/tmp/codex-status-testsThe root build workflow runs the full translated test suite, the root ownership
build, and direct ownership tests for the CLI, terminal input, and the newly
translated runtime foundations. Foundation tests also run with GC disabled so
ownership errors cannot be hidden by the collector. v -ownership test is not
supported; compile test entries directly as shown above.
See PORTING_STATUS.md for the current source coverage, validation, language adaptations, and remaining runtime work. TRANSLATION_VALIDATION.md records an earlier TUI translation batch and its historical compiler setup.
Translation source snapshot, recorded on 2026-11-08:
- Commit:
8e694e955ae02ca737230a5468c55d5847074072 - Commit date: 2026-09-07 22:11:52 UTC
- Commit subject: Exclude base instructions from the bundled model catalog (#43604)
- Workspace:
codex-rs/