Skip to content

Scaffold Agents (TypeScript)

🐍 Looking for Python? See Python Scaffold | ☕ Looking for Java? See Java Scaffold

Generate agents with meshctl scaffold

The easiest way to create an agent:

meshctl scaffold

This launches an interactive wizard that guides you through:

  • Agent name and type
  • Language (choose TypeScript)
  • Capabilities and tools
  • Output directory

The generated code includes placeholder tools—you'll need to edit src/index.ts to implement your logic.

CLI Mode

For scripting or when you know what you want:

# Basic tool agent
meshctl scaffold basic --name my-agent --lang typescript

# LLM-powered agent
meshctl scaffold llm --name emotion-analyzer \
  --vendor openai --lang typescript

# LLM provider (zero-code)
meshctl scaffold llm-provider --name claude-provider \
  --vendor claude --model anthropic/claude-sonnet-4-5 --lang typescript

Agent Types

Subcommand Description Use Case
basic Basic agent with addTool() Services, utilities, data processing
llm LLM-powered agent AI assistants, text analysis
llm-provider Zero-code LLM wrapper Expose LLM as mesh capability
api Express gateway (mesh.route()) HTTP APIs that call mesh tools

Generated Files

my-agent/
├── src/
│   └── index.ts      # Agent code - edit this to add your logic
├── package.json      # Add your dependencies here
├── tsconfig.json     # TypeScript config (ready to use)
├── Dockerfile        # Container build (ready to use)
├── helm-values.yaml  # Kubernetes config
└── README.md

After scaffolding:

  1. cd my-agent && npm install
  2. Edit src/index.ts to implement your tool logic (placeholder returns "Not implemented")

Generate Docker Compose

# Generate docker-compose.yml for all agents in directory
meshctl scaffold --compose

# With observability stack (registry + Redis + Tempo + Grafana)
meshctl scaffold --compose --observability

Local Tracing Setup

Use --compose --observability even if you run agents locally. Start the infrastructure with docker compose up -d, then run agents with meshctl start—they auto-connect to the Docker registry. This enables meshctl call --trace and meshctl trace.

Preview Before Creating

# Dry run - see what would be generated
meshctl scaffold basic --name my-agent --lang typescript --dry-run

More Options

# See all scaffold options
meshctl scaffold --help

Next Steps

Continue to Run Agents →