Bao is a very opinionated tool to generate CLI applications in multiple programming languages from a single configuration file.
Note
Crates are published as baobao* on crates.io instead of bao* to avoid confusion with an already existing and unrelated bao crate.
| Crate | Description |
|---|---|
| baobao | CLI tool for generating CLI applications from TOML |
| baobao-core | Core utilities for Bao CLI generator |
| baobao-manifest | TOML manifest parsing and validation |
| baobao-codegen | Shared code generation utilities |
| baobao-ir | Intermediate representation types |
| baobao-codegen-rust | Rust code generator |
| baobao-codegen-typescript | TypeScript code generator |
cargo install baobaoInitialize a new project:
bao init myapp
# Select language interactively, or use: bao init myapp --language rustThis creates a complete project with a bao.toml manifest:
[cli]
name = "myapp"
version = "0.1.0"
[commands.hello]
description = "Say hello"
args = ["name"]
flags = ["uppercase"]Edit bao.toml to add commands, then regenerate:
bao bake| Command | Description |
|---|---|
bao init [name] |
Initialize a new CLI project |
bao bake |
Generate code from bao.toml |
bao add command <name> |
Add a new command |
bao remove command <name> |
Remove a command |
bao list |
List commands and context |
bao check |
Validate bao.toml |
bao clean |
Remove orphaned generated files |
bao run |
Run the CLI (shortcut for cargo run --) |
- Type-safe argument parsing (clap for Rust, boune for TypeScript)
- Handler stubs generated for each command
- Context for shared state (database pools, HTTP clients, etc.)
- Multiple language targets from a single manifest
This project is licensed under the MIT LICENSE