Skip to content

Padrone

Build powerful CLI applications with full TypeScript support, Zod validation, and AI integration

Type-Safe

Full TypeScript support with Zod schema validation. Your CLI options are fully typed from definition to execution.

Fluent API

Chain commands, arguments, and options with a clean builder pattern. Easy to read and maintain.

AI-Ready

First-class support for Vercel AI SDK. Expose your CLI as an AI tool with a single method call.

Auto Help

Automatic help generation from your schema definitions in multiple formats: text, ANSI, markdown, HTML, JSON.

Nested Commands

Support for deeply nested subcommands with full type inference throughout.

Standard Schema

Built on Standard Schema for maximum compatibility. Works with Zod 3.25+ or 4.x.

import { createPadrone } from 'padrone';
import * as z from 'zod/v4';
const program = createPadrone('myapp')
.command('greet', (c) =>
c
.options(
z.object({
names: z.array(z.string()).describe('Names to greet'),
prefix: z.string().optional().describe('Prefix').meta({ alias: 'p' }),
}),
{ positional: ['...names'] },
)
.action((options) => {
options.names.forEach((name) => {
console.log(`Hello, ${options.prefix ?? ''} ${name}!`);
});
}),
);
program.cli();
Terminal window
myapp greet John Jane -p Mr.
# Output:
# Hello, Mr. John!
# Hello, Mr. Jane!
Terminal window
npm install padrone zod
# or
bun add padrone zod