OPEN SOURCE CLI GENERATOR
BUILD CLIs AT
WARP SPEED
Define your CLI in one bao.toml file.
Generate Rust and TypeScript CLIs.
Simple, instant and zero boilerplate.
bao.toml
> bao bake --language rust
Define your CLI in one bao.toml file.
Generate Rust and TypeScript CLIs.
Simple, instant and zero boilerplate.
CLI development made easy
bao.toml bao bake anytime — your code is preserved Three simple steps
bao init myapp --language rust Creates project structure with bao.toml manifest
bao add command deploy Interactively add commands, args, and flags to your manifest
bao bake Generate type-safe code with handler stubs. Run again anytime — your code is preserved!
One config, multiple outputs
[cli]
name = "deploy-cli"
version = "1.0.0"
[commands.deploy]
description = "Deploy to environment"
args = ["environment"]
flags = ["force", "dry-run"]
[commands.status]
description = "Check deployment status"
[context]
fields = ["config", "client"] #[derive(Parser)]
#[command(name = "deploy-cli")]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Deploy to environment
Deploy {
environment: String,
#[arg(long)]
force: bool,
#[arg(long)]
dry_run: bool,
},
/// Check deployment status
Status,
} Choose your target language
+ CLAP
+ BOUNE
Zero to CLI in 60 seconds
STEP 01: INSTALL
cargo install baobao STEP 02: INIT
bao init mycli --language rust STEP 03: ADD COMMAND
bao add command greet STEP 04: BAKE
bao bake STEP 05: RUN
bao run -- greet --help OUTPUT
mycli greet
Description of the greet command
Usage: mycli greet [OPTIONS]
Options:
-h, --help Print help
Recent releases and improvements
(codegen) Add choices/enum support for args and flags (codegen) Consolidate command tree printing into declarative display (manifest) Extract TOML section manipulation into module (codegen-typescript) Use `JsObject` AST for CLI schema generation (codegen) Consolidate stub marker constants (codegen-typescript) Place `Shebang` at the top of the file (codegen-typescript) Don't overwrite manifest on bake (codegen) Add `Renderable` trait and `CodeFile` abstraction for decoupled code generation (codegen) Add adapter traits and implementations for decoupled code generation (bao) Add interactive prompt to `bao init` to select language (codegen) Add FileRegistry for declarative file generation (codegen) Reorganize `codegen` crate into a domain-based structure (codegen) Replace recursive handler generation with CommandTree iteration cargo install baobao