# Anthropic CLI (ant) `ant` is [[Anthropic]]'s general-purpose CLI for the [[Claude]] API, shipped alongside [[Claude Managed Agents]] in April 2026. It is **not** a coding agent like [[Claude Code]] — it is a thin, scriptable wrapper over the API endpoints (agents, environments, sessions, events, memory stores, files, vaults, skills). ## Install Homebrew (macOS): ```bash brew install anthropics/tap/ant xattr -d com.apple.quarantine "$(brew --prefix)/bin/ant" # unquarantine ``` Linux/WSL: ```bash VERSION=1.0.0 OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') curl -fsSL "https://github.com/anthropics/anthropic-cli/releases/download/v${VERSION}/ant_${VERSION}_${OS}_${ARCH}.tar.gz" \ | sudo tar -xz -C /usr/local/bin ant ``` From source (Go 1.22+): ```bash go install github.com/anthropics/anthropic-cli/cmd/ant@latest ``` Check: `ant --version`. Auth via `ANTHROPIC_API_KEY`. ## Command shape `ant <resource>:<subresource> <verb> [flags]`. YAML-style inline object flags for nested config. ```bash ant beta:agents create \ --name "Coding Assistant" \ --model '{id: claude-sonnet-4-6}' \ --system "You are a helpful coding assistant." \ --tool '{type: agent_toolset_20260401}' ant beta:environments create \ --name "dev" \ --config '{type: cloud, networking: {type: unrestricted}}' ant beta:sessions create --agent "$AGENT_ID" --environment "$ENV_ID" ant beta:sessions:events send --session-id "$SID" <<YAML events: - type: user.message content: - type: text text: List the files in the working directory. YAML ant beta:sessions:threads list --session-id "$SID" ant beta:memory-stores:memories write --memory-store-id "$STORE" --path /notes.md --content "..." ``` ## Useful flags - `--transform <field>` — extract a single field from the response (e.g., `--transform id --format yaml` to capture the new ID into a shell var) - `--format yaml|json` — output shape - Reads YAML from stdin when the payload is complex ## Why it exists Managed Agents beta is HTTP-heavy: multiple nested resources, YAML-like configs, SSE streams. `ant` makes shell scripting and glue code readable without having to reach for `curl + jq` every line. It's also convenient in CI and for hand-debugging production sessions. The official SDKs (Python, TypeScript, Go, Java, C#, Ruby, PHP) remain the better choice for real applications. ## References - GitHub releases: https://github.com/anthropics/anthropic-cli/releases - Quickstart: https://platform.claude.com/docs/en/managed-agents/quickstart ## Related - [[Claude Managed Agents]] - [[Claude Code]] - [[Anthropic]]