> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/wevm/incur/llms.txt
> Use this file to discover all available pages before exploring further.

# Welcome to incur

> TypeScript CLI framework for building CLIs that work for both AI agents and humans

<img className="block" src="https://media.brand.dev/7316e6d5-0198-4785-94cd-cb9b972e0c98.png" alt="incur" width="200" />

# 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.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Get up and running with incur in under 5 minutes
  </Card>

  <Card title="Agent Discovery" icon="robot" href="/features/agent-discovery">
    Built-in Skills and MCP sync for automatic agent integration
  </Card>

  <Card title="TOON Output" icon="file-code" href="/features/toon-output">
    Save up to 60% tokens with TOON format vs JSON
  </Card>

  <Card title="Type Safety" icon="shield-check" href="/features/type-inference">
    Full type inference with zero manual annotations
  </Card>
</CardGroup>

## Why incur?

<CardGroup cols={3}>
  <Card title="3× Token Savings" icon="coins">
    Up to 3× fewer tokens per session vs MCP or skill alternatives
  </Card>

  <Card title="Agent-First Design" icon="brain-circuit">
    Call-to-actions guide agents to next steps automatically
  </Card>

  <Card title="Developer Experience" icon="code">
    Light API surface with full TypeScript inference
  </Card>

  <Card title="Well-Formed I/O" icon="input-text">
    Zod schemas for arguments, options, env vars, and output
  </Card>

  <Card title="Middleware" icon="layer-group">
    Composable hooks with typed dependency injection
  </Card>

  <Card title="OpenAPI Support" icon="link">
    Mount HTTP APIs as CLI commands automatically
  </Card>
</CardGroup>

## Get Started

<Steps>
  <Step title="Install incur">
    Install the framework with your preferred package manager

    ```bash theme={null}
    npm install incur
    ```
  </Step>

  <Step title="Create your first CLI">
    Build a simple greeting CLI in minutes

    ```typescript theme={null}
    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()
    ```
  </Step>

  <Step title="Add agent discovery">
    Make your CLI discoverable by AI agents

    ```bash theme={null}
    your-cli skills add
    ```
  </Step>
</Steps>

## Key Features

<AccordionGroup>
  <Accordion title="Agent Discovery">
    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.
  </Accordion>

  <Accordion title="Session Savings">
    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.
  </Accordion>

  <Accordion title="Call-to-Actions">
    Guide agents with automatic next-step suggestions. Return CTAs from commands to tell agents exactly which operations to chain next.
  </Accordion>

  <Accordion title="Type Inference">
    Zero manual type annotations needed. Schemas flow through generics so callbacks, outputs, and CTAs are all fully type-safe.
  </Accordion>
</AccordionGroup>

## Explore the Docs

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="book" href="/core-concepts/cli-creation">
    Learn the fundamental concepts behind incur
  </Card>

  <Card title="Building CLIs" icon="hammer" href="/building/single-command">
    Build single-command, multi-command, and nested CLIs
  </Card>

  <Card title="Features" icon="star" href="/features/agent-discovery">
    Explore middleware, streaming, and advanced features
  </Card>

  <Card title="API Reference" icon="code" href="/api/cli">
    Complete API documentation for all modules
  </Card>
</CardGroup>
