cli-creation
Original:🇺🇸 English
Translated
3 scriptsChecked / no sensitive code detected
Build consumer-facing DreamCLI CLIs from scratch with Bun-first workflows and typed patterns. Use when asked to scaffold or implement a new @kjanat/dreamcli command-line app, add commands/flags/args/prompts/output/testing, or create starter files/tests for DreamCLI users.
17installs
Sourcekjanat/dreamcli
Added on
NPX Install
npx skill4agent add kjanat/dreamcli cli-creationTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →CLI Creation
Overview
Create runnable DreamCLI starter CLIs and extend them with typed command patterns.
Use this skill for user-facing app code, not DreamCLI framework internals.
Quick Start
- Choose a starter mode:
- : one root command (
single).cli(name).default(command) - : grouped command surface (
multi).group('...').command(...)
- Generate starter files:
python scripts/scaffold_cli.py --name mycli --mode single --out .- Tests are generated by default; add only when explicitly requested.
--no-test - Test template is auto-detected: Bun without Vitest uses ; otherwise a Vitest template is generated.
bun:test
- Run and validate generated files:
- Use the printed path from the scaffolder output, for example .
bun ./mycli.ts --help - Run the generated test unless was used.
--no-test
- Use the printed path from the scaffolder output, for example
- Extend behavior with references:
references/consumer-workflow.mdreferences/pattern-cookbook.mdreferences/runtime-notes.md
Grounding Sources
- Use for single-command defaults.
examples/standalone/basic.ts - Use for grouped-command defaults.
examples/standalone/multi-command.ts - Use for
examples/standalone/testing.tspatterns.runCommand() - Use for baseline consumer narrative.
apps/docs/guide/getting-started.md - Use for richer end-to-end CLI composition.
apps/docs/guide/walkthrough.md
Workflow Decision Tree
- User asks for a simple one-command utility:
- Use .
--mode single
- Use
- User asks for nested command groups (git/gh style):
- Use .
--mode multi
- Use
- User asks for tests from the start:
- Do nothing; tests are scaffolded by default.
- User explicitly asks for no tests:
- Add .
--no-test
- Add
- User asks for npm/tsx or Deno instructions:
- Keep generated code unchanged and provide runtime command alternatives from .
references/runtime-notes.md
- Keep generated code unchanged and provide runtime command alternatives from
Extend the Starter
- Add typed args with ,
arg.string(),arg.number(), andarg.enum(...).arg.custom(...) - For repeated positionals, use on an arg definition.
.variadic() - Add typed flags with defaults and aliases via .
flag.*() - Add env/config/prompt sources on each flag before action logic.
- Branch on for machine-readable responses.
out.jsonMode - Use from
runCommand()for in-process tests.@kjanat/dreamcli/testkit - Keep output assertions explicit, including trailing newlines.
Resource Map
scripts/scaffold_cli.py- Generate Bun-first starter files and optional tests.
assets/templates/*.tpl- Source templates used by the scaffold script.
references/consumer-workflow.md- End-to-end flow from request to validated CLI.
references/pattern-cookbook.md- Copy-ready snippets for common DreamCLI features.
references/runtime-notes.md- Runtime and package-manager execution guidance.
Guardrails
- Do not modify DreamCLI core internals for consumer-app requests.
- Keep generated imports on and
@kjanat/dreamcli.@kjanat/dreamcli/testkit - Preserve typed resolution flow: argv -> env -> config -> prompt -> default.
- Prefer Bun commands first; include npm/tsx and Deno alternatives when requested.