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
- 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 --name my-agent --agent-type tool --lang typescript
# LLM-powered agent
meshctl scaffold --name emotion-analyzer --agent-type llm-agent \
--llm-selector openai --lang typescript
# LLM provider (zero-code)
meshctl scaffold --name claude-provider --agent-type llm-provider \
--model anthropic/claude-sonnet-4-5 --lang typescript
Agent Types¶
| Type | Description | Use Case |
|---|---|---|
tool | Basic agent with addTool() | Services, utilities, data processing |
llm-agent | LLM-powered agent | AI assistants, text analysis |
llm-provider | Zero-code LLM wrapper | Expose LLM as mesh capability |
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 --name my-agent --agent-type tool --lang typescript --dry-run
More Options¶
# See all scaffold options
meshctl scaffold --help
# See available agent templates
meshctl scaffold --list-modes
Next Steps¶
Continue to Run Agents β