Move config schema helper out of codex-core package

Keep package-level codex-core checks focused on the library by moving the schema writer binary into its own workspace package and updating the just recipe to call that package directly.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-03-19 20:13:35 -07:00
parent c91e0b1ac8
commit 14f7bc3f3b
6 changed files with 31 additions and 11 deletions

View File

@@ -0,0 +1,13 @@
[package]
edition.workspace = true
license.workspace = true
name = "codex-write-config-schema"
version.workspace = true
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
codex-core = { workspace = true }

View File

@@ -0,0 +1,23 @@
use std::path::PathBuf;
use anyhow::Result;
use clap::Parser;
/// 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")
.join("config.schema.json")
});
codex_core::config::schema::write_config_schema(&out_path)?;
Ok(())
}