“Gunshi (܉ࢣ)” = Japan military strategist in Samurai battles • Name Inspired from “Commander” CLI library • Designed to simplfy CLI development • Built-in auto command usage generation • Current Version: v0.27
worker for ollama in cursor • SiteMCP: Fetch entire site as MCP Server • ccusage: Claude Code usage analyzer • varlock: Enhanced .env fi le loader • sourcemap-publisher: Publish sourcemaps externally
job project and Rolldown CLI (NOTE: Rolldown CLI does not use cli library) • Good point: Declarative style good ☺ • Close point: Cannot custom usage rendering … 😌
support • Flexible • Compose commands and customize behavior as needed • Maintainable • Declarative con fi guration makes code easier to understand and maintain • Performant • Lazy loading ensures resources are only loaded when needed
properties • `type`: 'string', 'number', 'boolean', ‘positional', ‘enum’, 'custom' • `description`: A description of what the option does • `short`: A single-character alias (e.g. -n for —name) • `default`: Default value if the option is not provided • `required`: Set to `true` if the option is required • `multiple`: Set to `true` if multiple option values are allowed
functionality to your CLI application without modifying its core code • Gunshi plugins solve common CLI development challenges: • Separation of Concerns: Clean command logic • Reusability: Write functionality once, use it everywhere • Composability: Combine multiple plugins seamlessly
CLI starts, plugins are registered and their dependencies are resolved 2. Setup Plugins initialize and con fi gure themselves, adding any global options (like —debug) 3. Extension Plugins extend your command context with new functionality (like translation methods or API clients) 4. Decoration Plugins can modify how commands execute or how help text is displayed 5. Execution Your commands run with all plugin enhancements seamlessly integrated
nition command distrubtion as reusabable command • @gunshi/plugin for plugin developer, and optimize plugin distribution • @gunshi/bone no built-in plugins, buildable CLI from full-scratch • These packages is tree-shakable and npm distribution friendly
(Commander) Yargs TypeScript First Yes Yes Yes Partial Partial Declaretive Style Yes No Yes No No Function Style No Yes No No No Parser Combinator No Yes No No No Plugin System Yes No No No No I18n Yes No No No No Multi Runtime Yes Yes Yes Node only Node only Lazy Loading Yes No No No No