Thanks to visit codestin.com
Credit goes to baobao.sh

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.

DOCS
bao.toml
> bao bake --language rust

WHY BAO?

CLI development made easy

WITHOUT BAO
PAINFUL
  • Write argument parsing boilerplate for every command
  • Manually sync CLI structure across Rust and TypeScript
  • Rewrite handler scaffolding every time you add a command
  • Pass shared state manually through every function
  • Hope your args and flags stay consistent across refactors
WITH BAO
SIMPLE
  • Define your CLI once in bao.toml
  • Generate idiomatic Rust (clap) or TypeScript (boune) code
  • Handler stubs auto-generated — just fill in your logic
  • Typed context object for database pools, HTTP clients, etc.
  • Re-run bao bake anytime — your code is preserved
1
CONFIG FILE
2
LANGUAGES
0
BOILERPLATE

HOW IT WORKS

Three simple steps

READY
01
INITIALIZE REQUIRED
bao init myapp --language rust

Creates project structure with bao.toml manifest

02
ADD COMMANDS OPTIONAL
bao add command deploy

Interactively add commands, args, and flags to your manifest

03
GENERATE FINAL
bao bake

Generate type-safe code with handler stubs. Run again anytime — your code is preserved!

CODE GENERATION

One config, multiple outputs

INPUT
bao.toml
[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"]
OUTPUT
#[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,
}

SUPPORTED LANGUAGES

Choose your target language

RUST
READY
Rs

RUST

+ CLAP

TYPE SAFETY ████████████ MAX
PERFORMANCE ████████████ MAX
BINARY SIZE ██████████░░ LOW
  • Derive macros for zero boilerplate
  • Shell completions via clap_complete
  • Async handlers with tokio support
  • Compile to single static binary
TYPESCRIPT
READY
TS

TYPESCRIPT

+ BOUNE

TYPE SAFETY ████████████ MAX
DX SPEED ████████████ MAX
ECOSYSTEM ███████████░ HUGE
  • Full type inference
  • Interactive prompts and spinners
  • Compile to binary with Bun
  • Cross-platform compatibility

QUICK START

Zero to CLI in 60 seconds

quick-start

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

CLI GENERATED SUCCESSFULLY

LATEST UPDATES

Recent releases and improvements

CHANGELOG
VIEW ALL →
v0.4.3
Dec 19, 2025
  • + (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
v0.4.2
Dec 17, 2025
  • + Setup changelog and display on the documentation website
  • ! (codegen-typescript) Place `Shebang` at the top of the file
  • ! (codegen-typescript) Don't overwrite manifest on bake
  • ~ Update docs landing page
v0.4.1
Dec 17, 2025
  • + (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
  • ~ Decouple language-specific code and reduce duplication
  • ~ (codegen) Replace recursive handler generation with CommandTree iteration
  • ~ Update `bao` README files
+ Added ~ Changed ! Fixed
BAO CLI /// GENERATE CLIs /// RUST /// TYPESCRIPT /// TYPE SAFE /// HANDLER STUBS /// OPEN SOURCE /// BAO CLI /// GENERATE CLIs /// RUST /// TYPESCRIPT /// TYPE SAFE /// HANDLER STUBS /// OPEN SOURCE ///

GET STARTED

terminal://install
cargo install baobao