Introduction
maltty is an opinionated CLI framework for Node.js. It gives you typed commands, middleware pipelines, configuration loading, authentication, and terminal UI out of the box -- so you can focus on what your CLI does, not how it's wired together.
Prerequisites
- Node.js 24+ -- maltty targets the current LTS release
- pnpm (recommended) -- any package manager works, but maltty tooling assumes pnpm
- TypeScript -- maltty relies on Zod inference and module augmentation, so TypeScript is required
Why maltty?
- Convention over configuration -- sensible defaults for commands, config discovery, and project layout
- End-to-end type safety -- Zod schemas for args and config, module augmentation for global types, typed context in every handler
- Middleware pipelines -- composable onion model for auth, logging, timing, and any cross-cutting concern
- Built-in auth -- OAuth PKCE, device code, env vars, file tokens, and interactive login with zero boilerplate
- Terminal UI -- logger, spinner, prompts, colors, and formatters all on
ctx
Project structure
A typical maltty project looks like this:
Commands live in src/commands/, middleware in src/middleware/, and the entrypoint ties them together with a single cli() call. The build configuration in maltty.config.ts controls how @maltty/cli bundles your project for distribution.
Feature matrix
Sub-exports
The maltty package exposes focused sub-exports so you only import what you need:
Packages
Next steps
- Quick Start -- build and run a CLI in 5 minutes
- Build a CLI -- the full guide to commands, middleware, config, and sub-exports
- Lifecycle -- how a CLI invocation flows from argv to exit