Crust logoCrust

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.

src/cli.ts
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

Next steps

See what's planned on the Roadmap, or ask questions on Discord.

On this page