Skip to content

CLI Quick Start

Let’s run your first AI agent with gadgets from the command line.

The simplest way to use llmist is the complete command:

Terminal window
npx @llmist/cli complete "What is the capital of France?"

You’ll get a streaming response:

The capital of France is Paris.

The agent command runs an AI agent that can use tools (gadgets):

Terminal window
npx @llmist/cli agent "What time is it in Tokyo?"

When running in a terminal (both stdin and stdout are TTY), the agent automatically uses TUI mode with an interactive interface featuring expandable blocks, keyboard navigation, and live streaming.

The CLI includes three built-in gadgets for agent-user communication:

GadgetPurpose
AskUserAsk the user a question and wait for their response
TellUserDisplay important messages (info, success, warning, error)
FinishSignal that the agent has completed its task

These are registered automatically. Use --no-builtins to disable them.

Create a custom gadget for your agent:

  1. Create a gadgets directory

    Terminal window
    mkdir gadgets
  2. Create a gadget file

    gadgets/arcade.ts
    import { Gadget, z } from 'llmist';
    export default class ArcadeHighScore extends Gadget({
    description: 'Check or record high scores on the arcade cabinet',
    schema: z.object({
    game: z.enum(['pac-man', 'galaga', 'donkey-kong']),
    action: z.enum(['check', 'record']),
    initials: z.string().length(3).optional(),
    score: z.number().optional(),
    }),
    }) {
    execute(params: this['params']): string {
    if (params.action === 'check') {
    return `High scores for ${params.game}: AAA-999999, BBB-888888, CCC-777777`;
    }
    return `${params.initials} recorded ${params.score} on ${params.game}!`;
    }
    }
  3. Run the agent with your gadget

    Terminal window
    npx @llmist/cli agent --gadgets ./gadgets/arcade.ts \
    "Check the high scores for Pac-Man"

Your directory structure:

  • Directorygadgets/
    • arcade.ts
  • package.json

The CLI integrates with Unix pipelines:

Terminal window
# Summarize a file
cat README.md | npx @llmist/cli complete "Summarize this document"
# Code review
cat src/main.ts | npx @llmist/cli complete "Review this code for bugs"
# Process multiple files
find src -name "*.ts" -exec cat {} \; | \
npx @llmist/cli complete "Find potential security issues"

Specify the model with --model or -m:

Terminal window
# Use Claude Sonnet
npx @llmist/cli complete -m sonnet "Explain quantum computing"
# Use GPT-5
npx @llmist/cli complete -m gpt5 "Write a haiku about coding"
# Use Gemini Flash (fast and cheap)
npx @llmist/cli complete -m flash "What is 2 + 2?"