mirror of
https://github.com/openai/codex.git
synced 2026-02-01 22:47:52 +00:00
This is less straightforward than I realized, so created an entry for this in our `justfile`. Verified that running `just bazel-codex` from anywhere in the repo uses the user's `$PWD` as the one to run Codex. While here, updated the `MODULE.bazel.lock`, though it looks like I need to add a CI job that runs `bazel mod deps --lockfile_mode=error` or something.
70 lines
1.8 KiB
Makefile
70 lines
1.8 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
|