This article was originally published on on April 8, 2026, and it's built specifically for developers who want to create, configure, and run cloud-hosted agents without writing wrapper code. The . I keep mine in a
.envfile that my shell sources on startup, but any secret management approach works.
Shell Completions
The ant CLI supports completions for bash, zsh, fish, and PowerShell. For zsh (the default macOS shell):
CODE# Generate zsh completions
ant completion zsh > ~/.zfunc/_ant
# Add to your .zshrc if not already there
echo 'fpath=(~/.zfunc $fpath)' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
Tab completion saves a lot of time when working with the
beta:namespaced commands, which can get long.
Core Concepts - Agents, Environments, and Sessions
Before you create anything, it helps to understand how the four core pieces fit together.
Agent - A versioned configuration defining the model, system prompt, tools, and MCP server connections. Think of it as a blueprint. Each update creates a new version, so you can roll back if needed.
Environment - A container template specifying pre-installed packages (pip, npm) and networking rules. Create it once, reference it by ID. Multiple sessions can share one environment config, but each gets its own isolated container.
Session - A running instance that pairs an agent with an environment. It has its own container, filesystem, and conversation history. Sessions are where the actual work happens.
Events - The communication protocol. You send user events (messages, interrupts, tool confirmations) and receive agent events (messages, tool calls, thinking). Everything is event-based and streamable.
The flow works like this: you create an agent (the what), create an environment (the where), start a session linking them together, and then communicate through events. Anthropic handles the container orchestration, tool execution, and conversation state. According to the , but the YAML workflow is what makes the CLI my preferred interface.
According to the .
↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
Getting Started with the ant CLI: Deploy Claude Agents
- ▸ TL;DR
- ▸ What Is the ant CLI?
- ▸ How to Install the ant CLI
- ↳ macOS (Homebrew)
- ↳ Linux / WSL (curl)
- ↳ From Source (Go 1.22+)
- ↳ Set Your API Key
- ↳ Shell Completions
- ▸ Core Concepts - Agents, Environments, and Sessions
- ▸ Creating Your First Agent with the ant CLI
- ↳ Step 1: Create the Agent
- ↳ Step 2: Create an Environment
- ↳ Step 3: Start a Session
- ↳ Step 4: Send a Message and Stream the Response
- ▸ YAML Version Control for Agents
- ▸ ant CLI vs curl vs SDK - Why Use the CLI?
- ▸ Scripting and Automation Patterns
- ↳ Extract IDs from Create Commands
- ↳ GitHub Actions Deployment
- ↳ List All Agents and Environments
- ▸ What Tools Can Managed Agents Use?
- ▸ Frequently Asked Questions
- ↳ What is the ant CLI from Anthropic?
- ↳ How do I install the ant CLI on macOS?
- ↳ What is the difference between the ant CLI and Claude Code?
- ↳ How much does it cost to run a managed agent session?
- ↳ Can I version control agents with the ant CLI?
- ↳ Can managed agents connect to MCP servers?
- ↳ How do I use the ant CLI in CI/CD pipelines?
- ↳ What tools are available to managed agents?
SOCIAL SHARE CARD GENERATOR