Quick Start
Create your first Crust CLI in under 2 minutes.
Scaffold a New Project
The fastest way to start is with create-crust:
bun create crust my-cliThis runs an interactive setup that prompts for your project directory, template style, and distribution mode, then scaffolds a ready-to-run project.
Create the project
bun create crust my-cliAnswer the prompts (or press Enter to accept defaults) for template style and distribution mode.
Try it out
# Pass an argument
bun run src/cli.ts Alice
# Use a flag
bun run src/cli.ts Alice --greet Hey
# View the help
bun run src/cli.ts --helpDistribution
How you ship depends on the distribution mode you selected during scaffolding:
Recommended for most CLIs: distribute your tool as prebuilt binaries.
Raw binaries (default):
bun run buildThis runs crust build, which compiles your CLI to standalone executables for all platforms using bun build --compile.
If you need public build-time constants, crust build can use Bun's cwd env by default or take explicit --env-file inputs. See Environment Variables for the full env model.
Per-OS npm packages (optional):
To publish via npm with automatic platform detection:
# Stage npm packages (creates dist/npm/ with per-platform packages)
bun run package
# Publish all packages in manifest order
bun run publishThis creates a root package with optional dependencies on platform-specific packages. Users install normally with bun add -g my-cli and npm automatically installs only the binary for their platform.
See Per-OS Distribution for details.
If you selected Bun runtime package mode, build and run the JS distribution entry:
bun run build
bun run dist/cli.js --helpIn this mode, @crustjs/core and @crustjs/plugins stay in dependencies and your published entrypoint is dist/cli.js.
See Building & Distribution and Installation for full packaging details.
Next Steps
- Installation — manual setup and composable modules
- Commands — learn how the
Crustbuilder works - Arguments — positional arguments in depth
- Flags — named flags and options
- Plugins — add help, version, and more