protocol-ts (#2425)
This commit is contained in:
20
codex-rs/protocol-ts/src/main.rs
Normal file
20
codex-rs/protocol-ts/src/main.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(about = "Generate TypeScript bindings for the Codex protocol")]
|
||||
struct Args {
|
||||
/// Output directory where .ts files will be written
|
||||
#[arg(short = 'o', long = "out", value_name = "DIR")]
|
||||
out_dir: PathBuf,
|
||||
|
||||
/// Optional path to the Prettier executable to format generated files
|
||||
#[arg(short = 'p', long = "prettier", value_name = "PRETTIER_BIN")]
|
||||
prettier: Option<PathBuf>,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = Args::parse();
|
||||
codex_protocol_ts::generate_ts(&args.out_dir, args.prettier.as_deref())
|
||||
}
|
||||
Reference in New Issue
Block a user