Scaffold Agents (TypeScript)¶
Generate agents with
meshctl scaffold
Interactive Mode (Recommended)¶
The easiest way to create an agent:
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:
cd my-agent && npm install- Edit
src/index.tsto 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¶
Next Steps¶
Continue to Run Agents →