Skip to main content
incur

Build CLIs for Agents and Humans

incur is a TypeScript framework for building production-ready CLIs with agent discovery, token-efficient output, and full type safety.

Quick Start

Get up and running with incur in under 5 minutes

Agent Discovery

Built-in Skills and MCP sync for automatic agent integration

TOON Output

Save up to 60% tokens with TOON format vs JSON

Type Safety

Full type inference with zero manual annotations

Why incur?

3× Token Savings

Up to 3× fewer tokens per session vs MCP or skill alternatives

Agent-First Design

Call-to-actions guide agents to next steps automatically

Developer Experience

Light API surface with full TypeScript inference

Well-Formed I/O

Zod schemas for arguments, options, env vars, and output

Middleware

Composable hooks with typed dependency injection

OpenAPI Support

Mount HTTP APIs as CLI commands automatically

Get Started

1

Install incur

Install the framework with your preferred package manager
npm install incur
2

Create your first CLI

Build a simple greeting CLI in minutes
import { Cli, z } from 'incur'

Cli.create('greet', {
  description: 'A greeting CLI',
  args: z.object({
    name: z.string().describe('Name to greet'),
  }),
  run(c) {
    return { message: `hello ${c.args.name}` }
  },
}).serve()
3

Add agent discovery

Make your CLI discoverable by AI agents
your-cli skills add

Key Features

Built-in agent discovery with Skills and MCP. Run cli skills add or cli mcp add to make your CLI instantly available to AI agents with no manual configuration.
Save up to 3× tokens per session compared to MCP or monolithic skill files. incur combines on-demand loading with TOON output for maximum efficiency.
Guide agents with automatic next-step suggestions. Return CTAs from commands to tell agents exactly which operations to chain next.
Zero manual type annotations needed. Schemas flow through generics so callbacks, outputs, and CTAs are all fully type-safe.

Explore the Docs

Core Concepts

Learn the fundamental concepts behind incur

Building CLIs

Build single-command, multi-command, and nested CLIs

Features

Explore middleware, streaming, and advanced features

API Reference

Complete API documentation for all modules

Build docs developers (and LLMs) love