# Crust Crust is a [[TypeScript]]-first, [[Bun]]-native CLI framework with zero runtime dependencies. It sits between minimal argument parsers (like yargs or commander) and heavyweight frameworks (like oclif), offering a composable, modular architecture with strong type inference. Created by Chenxin Yan. Open-sourced in March 2026 after being used internally at Nozomio Labs. ## Key characteristics - **Full type inference**: args and flags are inferred from definitions automatically. No manual type annotations or generics needed. - **Compile-time validation**: catches flag alias collisions and variadic arg mistakes before runtime. - **Zero runtime dependencies**: `@crustjs/core` is ~3.6 kB gzipped (21 kB install). For comparison: yargs is 509 kB, oclif is 411 kB. - **Composable modules**: core, plugins, prompts, styling, validation, store, build tooling, and skills are all separate packages. Install only what you need. - **Plugin system**: middleware-based with lifecycle hooks (preRun/postRun). Official plugins for help, version, and shell autocompletion. - **Bun-native**: no Node.js compatibility layers. Leverages Bun's ability to compile CLIs into standalone binaries for distribution. ## Module ecosystem | Package | Purpose | |---|---| | `@crustjs/core` | Command definition, arg parsing, routing, plugin system | | `@crustjs/plugins` | Official plugins (help, version, autocomplete) | | `@crustjs/crust` | CLI build tooling; compile to standalone executables | | `@crustjs/create` | Headless scaffolding engine for `create-xxx` tools | | `@crustjs/validate` | Schema-first validation adapters | | `@crustjs/prompts` | Interactive terminal prompts | | `@crustjs/style` | Terminal styling | | `@crustjs/store` | Type-safe config persistence (config/data/state/cache) | | `@crustjs/skills` | [[AI Agent Skills]] generation from command definitions | Upcoming: `@crustjs/test` (CLI testing helpers), `@crustjs/render` (terminal content rendering), `@crustjs/log` (structured logging). ## Agent skills generation The `@crustjs/skills` module auto-generates `SKILL.md` files from Crust command definitions, making CLIs discoverable by AI coding assistants like [[Claude Code]], Cursor, Windsurf, Codex, Gemini CLI, and many others. It follows the Agent Skills spec (agentskills.io) and supports: - **Auto-detection**: probes installed agents by checking CLI binaries (`claude --version`, `windsurf --version`, etc.). - **Auto-update**: silently updates installed skills when the CLI version changes. - **Interactive management**: `my-cli skill` presents a multiselect prompt for toggling agent installations. - **Conflict detection**: uses a `crust.json` ownership marker to prevent overwriting skills created by other tools. - **Command-level prompt guidance**: `annotate()` attaches agent-facing instructions to specific commands (e.g., "ask for confirmation before production changes"). Universal agents (shared path): amp, cline, codex, cursor, gemini-cli, github-copilot, kimi-cli, opencode, replit. Additional agents (per-agent path): claude-code, windsurf, goose, roo, junie, augment, and 20+ others. ## Binary size caveat Standalone binaries are 58-109 MB depending on platform because they bundle the Bun runtime. This is significantly larger than typical Go CLIs (10-20 MB). Not an issue for developer tools, but worth noting for distribution-sensitive contexts. ## Quick start ```bash bun create crust my-cli cd my-cli bun run dev ``` ## Status Alpha/beta quality as of March 2026 (pre-1.0). Core API relatively stable after 0.1, but breaking changes expected between minor releases. Per [[Semantic Versioning]], 0.x versions allow arbitrary changes. ## References - https://crustjs.com - https://github.com/chenxin-yan/crust - https://news.ycombinator.com/item?id=47408727 ## Related - [[TypeScript]] - [[Bun]] - [[AI Agent Skills]] - [[Claude Code]] - [[Semantic Versioning]]