mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
## What changed - Add the `codex-config-schema` workspace and Bazel crate for the `codex-write-config-schema` binary. - Preserve `codex-rs/core/config.schema.json` as the default output location. - Update `just write-config-schema` to run the new crate and remove the schema generator's `clap` dependency and binary target from `codex-core`. GitOrigin-RevId: 7447f97d6e44d1077b16d2d850f8a8add9117ea6
23 lines
651 B
Rust
23 lines
651 B
Rust
//! Generates the canonical config schema fixture for development and releases.
|
|
|
|
use anyhow::Result;
|
|
use clap::Parser;
|
|
use std::path::PathBuf;
|
|
|
|
/// Generate the JSON Schema for `config.toml` and write it to `config.schema.json`.
|
|
#[derive(Parser)]
|
|
#[command(name = "codex-write-config-schema")]
|
|
struct Args {
|
|
#[arg(short, long, value_name = "PATH")]
|
|
out: Option<PathBuf>,
|
|
}
|
|
|
|
fn main() -> Result<()> {
|
|
let args = Args::parse();
|
|
let out_path = args.out.unwrap_or_else(|| {
|
|
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../core/config.schema.json")
|
|
});
|
|
codex_config::schema::write_config_schema(&out_path)?;
|
|
Ok(())
|
|
}
|