Similar to what @sayan-oai did in openai/codex#8956 for `config.schema.json`, this PR updates the repo so that it includes the output of `codex app-server generate-json-schema` and `codex app-server generate-ts` and adds a test to verify it is in sync with the current code. Motivation: - This makes any schema changes introduced by a PR transparent during code review. - In particular, this should help us catch PRs that would introduce a non-backwards-compatible change to the app schema (eventually, this should also be enforced by tooling). - Once https://github.com/openai/codex/pull/10231 is in to formalize the notion of "experimental" fields, we can work on ensuring the non-experimental bits are backwards-compatible. `codex-rs/app-server-protocol/tests/schema_fixtures.rs` was added as the test and `just write-app-server-schema` can be use to generate the vendored schema files. Incidentally, when I run: ``` rg _ codex-rs/app-server-protocol/schema/typescript/v2 ``` I see a number of `snake_case` names that should be `camelCase`.
77 lines
2.1 KiB
Makefile
77 lines
2.1 KiB
Makefile
set working-directory := "codex-rs"
|
|
set positional-arguments
|
|
|
|
# Display help
|
|
help:
|
|
just -l
|
|
|
|
# `codex`
|
|
alias c := codex
|
|
codex *args:
|
|
cargo run --bin codex -- "$@"
|
|
|
|
# `codex exec`
|
|
exec *args:
|
|
cargo run --bin codex -- exec "$@"
|
|
|
|
# Run the CLI version of the file-search crate.
|
|
file-search *args:
|
|
cargo run --bin codex-file-search -- "$@"
|
|
|
|
# Build the CLI and run the app-server test client
|
|
app-server-test-client *args:
|
|
cargo build -p codex-cli
|
|
cargo run -p codex-app-server-test-client -- --codex-bin ./target/debug/codex "$@"
|
|
|
|
# format code
|
|
fmt:
|
|
cargo fmt -- --config imports_granularity=Item 2>/dev/null
|
|
|
|
fix *args:
|
|
cargo clippy --fix --all-features --tests --allow-dirty "$@"
|
|
|
|
clippy:
|
|
cargo clippy --all-features --tests "$@"
|
|
|
|
install:
|
|
rustup show active-toolchain
|
|
cargo fetch
|
|
|
|
# Run `cargo nextest` since it's faster than `cargo test`, though including
|
|
# --no-fail-fast is important to ensure all tests are run.
|
|
#
|
|
# Run `cargo install cargo-nextest` if you don't have it installed.
|
|
test:
|
|
cargo nextest run --no-fail-fast
|
|
|
|
# Build and run Codex from source using Bazel.
|
|
# Note we have to use the combination of `[no-cd]` and `--run_under="cd $PWD &&"`
|
|
# to ensure that Bazel runs the command in the current working directory.
|
|
[no-cd]
|
|
bazel-codex *args:
|
|
bazel run //codex-rs/cli:codex --run_under="cd $PWD &&" -- "$@"
|
|
|
|
bazel-test:
|
|
bazel test //... --keep_going
|
|
|
|
bazel-remote-test:
|
|
bazel test //... --config=remote --platforms=//:rbe --keep_going
|
|
|
|
build-for-release:
|
|
bazel build //codex-rs/cli:release_binaries --config=remote
|
|
|
|
# Run the MCP server
|
|
mcp-server-run *args:
|
|
cargo run -p codex-mcp-server -- "$@"
|
|
|
|
# Regenerate the json schema for config.toml from the current config types.
|
|
write-config-schema:
|
|
cargo run -p codex-core --bin codex-write-config-schema
|
|
|
|
# Regenerate vendored app-server protocol schema artifacts.
|
|
write-app-server-schema:
|
|
cargo run -p codex-app-server-protocol --bin write_schema_fixtures
|
|
|
|
# Tail logs from the state SQLite database
|
|
log *args:
|
|
if [ "${1:-}" = "--" ]; then shift; fi; cargo run -p codex-state --bin logs_client -- "$@"
|