CLI
Developer CLI for maltty projects. Scaffolding, building, diagnostics, and code generation.
Installation
Commands
maltty init
Scaffold a new maltty CLI project. Prompts for project details interactively or accepts them as flags.
maltty build
Bundle a maltty CLI project for production using tsdown. Optionally compile to standalone binaries via Bun.
Supported compile targets: darwin-arm64, darwin-x64, linux-x64, linux-arm64, linux-x64-musl, windows-x64, windows-arm64.
Build options can also be configured in maltty.config.ts:
maltty dev
Start a maltty CLI project in development mode. Loads the project's maltty.config.ts, starts tsdown in watch mode, and logs rebuild status on each file change.
On the first successful build the spinner stops and a "watching" message is logged. Subsequent rebuilds log a success message. Build options are read from maltty.config.ts (all fields are optional — defaults apply when no config file is found).
maltty doctor
Diagnose common project issues. Validates config, checks package.json setup, verifies entry points, and catches anything that could cause build or runtime failures.
maltty add command
Add a new command to an existing maltty project. Detects the project root and generates a command file in the configured commands directory.
maltty add middleware
Add a new middleware to an existing maltty project. Generates a middleware file in src/middleware/.
maltty add config
Scaffold a config schema with Zod validation and ConfigType module augmentation in an existing maltty project. Creates src/config.ts with a starter schema and wires up the declare module augmentation.
This generates:
maltty commands
Display the command tree for a maltty CLI project. Scans the configured commands directory and prints an ASCII tree of all discovered commands and subcommands.
maltty stories
Launch the stories viewer TUI. Discovers .stories.tsx / .stories.ts files in the project and renders a browsable tree with live preview and an interactive props editor.
The viewer watches for file changes and hot-reloads stories automatically. Press ? inside the viewer to see keyboard shortcuts.