Overview
What Crust is, why it exists, and where to start.
What is Crust?
Crust is a TypeScript CLI framework with composable modules for humans and agents. It runs on Bun, Node.js, and Deno, with native Bun integrations.
Why Crust?
A minimal argument parser gives you flexibility, but leaves you to assemble the rest of your CLI. A batteries-included framework provides more structure, but can bring conventions and features you don't need. Crust aims for the sweet spot: a typed command model with parsing and routing built in, plus optional modules you add as your CLI grows.
Define a command once: its arguments and flags drive parsing and type inference, while modules generate help, shell completion, manual pages, and agent skills from the same definitions. You don't maintain a separate description of your CLI for each audience.
The core has no third-party runtime dependencies. Standalone libraries such as styling and prompts also work without the framework.
Quick example
Save this greet command as src/cli.ts. It has a defaulted positional, a --shout/-s boolean flag, a wave subcommand, and --help wired by the help Extension. For installation and project setup, start with Quick Start.
import { Crust } from "@crustjs/core";
import { help } from "@crustjs/extensions";
const app = new Crust("greet")
.extend(help())
.args({ name: "name", type: "string", default: "world" })
.flags({ name: "shout", type: "boolean", short: "s" })
.action(({ , , stdout }) => {
const line = `Hello, ${args.name}!`;
stdout(flags.shout ? line.toUpperCase() : line);
})
.command("wave", (command) =>
command.action(({ stdout }) => stdout("👋")),
);
await app.execute();
$ bun run src/cli.ts Ada --shout
HELLO, ADA!
$ bun run src/cli.ts wave
👋Capabilities
- Typed commands. Define nested commands, arguments and flags with inferred types and schema validation.
- Extensions. Add help, version information, completion, and shared behavior.
- Shared resources. Provide typed dependencies with lazy initialization and automatic cleanup.
- Generated documentation. Turn command definitions into manual pages and agent skills.
- Terminal UI. Add styling, prompts, progress indicators, and full-screen apps (Bun only).
- Testing. Capture output and exit codes, or simulate interactive input.
- Distribution. Build runtime packages or standalone binaries for Bun, Node.js, or Deno (Deno runtime packages are experimental). Ship binaries through npm, direct downloads, or your own installer; running them directly needs no installed JavaScript runtime.
Next steps
Quick Start
Scaffold and run your first CLI
Guide
Learn how to define commands, arguments, flags, and more
Modules
Explore the composable module ecosystem
API Reference
Full API signatures and types
See what's planned on the Roadmap, or ask questions on Discord.