ProjectWorking examples
Working examples
The demo app in the repository, kept honest by the build and the tests.
demo/app/ is
the example, and the build and the tests keep it honest. Every code block on
this site that starts with // app/... is a real file there, and the shell
output shown is what the demo prints.
| Command | What it shows |
|---|---|
hello | positional args, options, enums |
count | stdin.tsx (lines), a help.tsx override, bundled boolean aliases |
upper | optional stdin (undefined in a terminal) |
config | reading validated env.tsx values |
user | subcommands, layout.tsx, middleware.tsx, an inherited error.tsx |
user import | mode="json" with Type.Object |
user show | notFound() with an automatic suggestion, complete.tsx |
deploy | help() when the input cannot be acted on |
publish | authRequired() / missingTool() with fix hints |
stats | data.tsx split from the view, output.tsx, and --json |
crash | error.tsx and <Exit> |
go | shell.tsx: cd and export in the parent shell |
git clone https://github.com/yuyakinjo/decopin-cli
cd decopin-cli
bun install
bun run build # builds demo/app into dist/index.js
./dist/index.js hello world