# Install from Anthropic's tap
-weight: 500;">brew -weight: 500;">install anthropics/tap/ant # Clear the macOS quarantine flag (required)
xattr -d com.apple.quarantine "$(-weight: 500;">brew --prefix)/bin/ant" # Verify
ant --version
# Install from Anthropic's tap
-weight: 500;">brew -weight: 500;">install anthropics/tap/ant # Clear the macOS quarantine flag (required)
xattr -d com.apple.quarantine "$(-weight: 500;">brew --prefix)/bin/ant" # Verify
ant --version
# Install from Anthropic's tap
-weight: 500;">brew -weight: 500;">install anthropics/tap/ant # Clear the macOS quarantine flag (required)
xattr -d com.apple.quarantine "$(-weight: 500;">brew --prefix)/bin/ant" # Verify
ant --version
VERSION=1.2.1
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') -weight: 500;">curl -fsSL \ "https://github.com/anthropics/anthropic-cli/releases/download/v${VERSION}/ant_${VERSION}_${OS}_${ARCH}.tar.gz" \ | -weight: 600;">sudo tar -xz -C /usr/local/bin ant
VERSION=1.2.1
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') -weight: 500;">curl -fsSL \ "https://github.com/anthropics/anthropic-cli/releases/download/v${VERSION}/ant_${VERSION}_${OS}_${ARCH}.tar.gz" \ | -weight: 600;">sudo tar -xz -C /usr/local/bin ant
VERSION=1.2.1
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') -weight: 500;">curl -fsSL \ "https://github.com/anthropics/anthropic-cli/releases/download/v${VERSION}/ant_${VERSION}_${OS}_${ARCH}.tar.gz" \ | -weight: 600;">sudo tar -xz -C /usr/local/bin ant
go -weight: 500;">install github.com/anthropics/anthropic-cli/cmd/ant@latest
export PATH="$PATH:$(go env GOPATH)/bin"
go -weight: 500;">install github.com/anthropics/anthropic-cli/cmd/ant@latest
export PATH="$PATH:$(go env GOPATH)/bin"
go -weight: 500;">install github.com/anthropics/anthropic-cli/cmd/ant@latest
export PATH="$PATH:$(go env GOPATH)/bin"
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
# 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
# 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
# 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
ant beta:agents create \ --name "Code Reviewer" \ --model claude-sonnet-4-6 \ --system "You are a senior code reviewer. Read the code carefully, check for bugs, security issues, and style problems. Be specific about line numbers and provide fix suggestions." \ --tool '{"type": "agent_toolset_20260401"}'
ant beta:agents create \ --name "Code Reviewer" \ --model claude-sonnet-4-6 \ --system "You are a senior code reviewer. Read the code carefully, check for bugs, security issues, and style problems. Be specific about line numbers and provide fix suggestions." \ --tool '{"type": "agent_toolset_20260401"}'
ant beta:agents create \ --name "Code Reviewer" \ --model claude-sonnet-4-6 \ --system "You are a senior code reviewer. Read the code carefully, check for bugs, security issues, and style problems. Be specific about line numbers and provide fix suggestions." \ --tool '{"type": "agent_toolset_20260401"}'
# Extract the agent ID
AGENT_ID=$(ant beta:agents create \ --name "Code Reviewer" \ --model claude-sonnet-4-6 \ --system "You are a senior code reviewer." \ --tool '{"type": "agent_toolset_20260401"}' \ --transform id --format raw) echo "Created agent: $AGENT_ID"
# Extract the agent ID
AGENT_ID=$(ant beta:agents create \ --name "Code Reviewer" \ --model claude-sonnet-4-6 \ --system "You are a senior code reviewer." \ --tool '{"type": "agent_toolset_20260401"}' \ --transform id --format raw) echo "Created agent: $AGENT_ID"
# Extract the agent ID
AGENT_ID=$(ant beta:agents create \ --name "Code Reviewer" \ --model claude-sonnet-4-6 \ --system "You are a senior code reviewer." \ --tool '{"type": "agent_toolset_20260401"}' \ --transform id --format raw) echo "Created agent: $AGENT_ID"
ENV_ID=$(ant beta:environments create \ --name "python-dev" \ ---weight: 500;">pip-packages '["pytest", "ruff", "mypy"]' \ --networking unrestricted \ --transform id --format raw) echo "Created environment: $ENV_ID"
ENV_ID=$(ant beta:environments create \ --name "python-dev" \ ---weight: 500;">pip-packages '["pytest", "ruff", "mypy"]' \ --networking unrestricted \ --transform id --format raw) echo "Created environment: $ENV_ID"
ENV_ID=$(ant beta:environments create \ --name "python-dev" \ ---weight: 500;">pip-packages '["pytest", "ruff", "mypy"]' \ --networking unrestricted \ --transform id --format raw) echo "Created environment: $ENV_ID"
SESSION_ID=$(ant beta:sessions create \ --agent-id "$AGENT_ID" \ --environment-id "$ENV_ID" \ --transform id --format raw) echo "Started session: $SESSION_ID"
SESSION_ID=$(ant beta:sessions create \ --agent-id "$AGENT_ID" \ --environment-id "$ENV_ID" \ --transform id --format raw) echo "Started session: $SESSION_ID"
SESSION_ID=$(ant beta:sessions create \ --agent-id "$AGENT_ID" \ --environment-id "$ENV_ID" \ --transform id --format raw) echo "Started session: $SESSION_ID"
# Send a review request
ant beta:sessions:events send \ --session-id "$SESSION_ID" \ --type user.message \ --content-type text \ --content-text "Review this Python function for bugs: def divide(a, b): return a / b
" # Stream the agent's response in real-time
ant beta:sessions stream --session-id "$SESSION_ID"
# Send a review request
ant beta:sessions:events send \ --session-id "$SESSION_ID" \ --type user.message \ --content-type text \ --content-text "Review this Python function for bugs: def divide(a, b): return a / b
" # Stream the agent's response in real-time
ant beta:sessions stream --session-id "$SESSION_ID"
# Send a review request
ant beta:sessions:events send \ --session-id "$SESSION_ID" \ --type user.message \ --content-type text \ --content-text "Review this Python function for bugs: def divide(a, b): return a / b
" # Stream the agent's response in real-time
ant beta:sessions stream --session-id "$SESSION_ID"
# code-reviewer.agent.yaml
name: Code Reviewer
model: claude-sonnet-4-6
system: | You are a senior code reviewer. Read the code carefully, check for bugs, security issues, and style problems. Be specific about line numbers and provide fix suggestions.
tools: - type: agent_toolset_20260401 configs: - name: web_fetch enabled: false
# code-reviewer.agent.yaml
name: Code Reviewer
model: claude-sonnet-4-6
system: | You are a senior code reviewer. Read the code carefully, check for bugs, security issues, and style problems. Be specific about line numbers and provide fix suggestions.
tools: - type: agent_toolset_20260401 configs: - name: web_fetch enabled: false
# code-reviewer.agent.yaml
name: Code Reviewer
model: claude-sonnet-4-6
system: | You are a senior code reviewer. Read the code carefully, check for bugs, security issues, and style problems. Be specific about line numbers and provide fix suggestions.
tools: - type: agent_toolset_20260401 configs: - name: web_fetch enabled: false
# code-reviewer.environment.yaml
name: python-dev
pip_packages: - pytest - ruff - mypy
networking: unrestricted
# code-reviewer.environment.yaml
name: python-dev
pip_packages: - pytest - ruff - mypy
networking: unrestricted
# code-reviewer.environment.yaml
name: python-dev
pip_packages: - pytest - ruff - mypy
networking: unrestricted
# Create from YAML
ant beta:agents create < code-reviewer.agent.yaml # Update an existing agent (version is required for safety)
ant beta:agents -weight: 500;">update \ --agent-id "$AGENT_ID" \ --version 1 \ < code-reviewer.agent.yaml
# Create from YAML
ant beta:agents create < code-reviewer.agent.yaml # Update an existing agent (version is required for safety)
ant beta:agents -weight: 500;">update \ --agent-id "$AGENT_ID" \ --version 1 \ < code-reviewer.agent.yaml
# Create from YAML
ant beta:agents create < code-reviewer.agent.yaml # Update an existing agent (version is required for safety)
ant beta:agents -weight: 500;">update \ --agent-id "$AGENT_ID" \ --version 1 \ < code-reviewer.agent.yaml
#!/bin/bash
set -euo pipefail # Create agent and capture the ID
AGENT_ID=$(ant beta:agents create \ < agents/reviewer.agent.yaml \ --transform id --format raw) # Create environment and capture the ID
ENV_ID=$(ant beta:environments create \ < agents/reviewer.environment.yaml \ --transform id --format raw) echo "Agent: $AGENT_ID"
echo "Environment: $ENV_ID" # Store for later use
echo "AGENT_ID=$AGENT_ID" >> .env.agents
echo "ENV_ID=$ENV_ID" >> .env.agents
#!/bin/bash
set -euo pipefail # Create agent and capture the ID
AGENT_ID=$(ant beta:agents create \ < agents/reviewer.agent.yaml \ --transform id --format raw) # Create environment and capture the ID
ENV_ID=$(ant beta:environments create \ < agents/reviewer.environment.yaml \ --transform id --format raw) echo "Agent: $AGENT_ID"
echo "Environment: $ENV_ID" # Store for later use
echo "AGENT_ID=$AGENT_ID" >> .env.agents
echo "ENV_ID=$ENV_ID" >> .env.agents
#!/bin/bash
set -euo pipefail # Create agent and capture the ID
AGENT_ID=$(ant beta:agents create \ < agents/reviewer.agent.yaml \ --transform id --format raw) # Create environment and capture the ID
ENV_ID=$(ant beta:environments create \ < agents/reviewer.environment.yaml \ --transform id --format raw) echo "Agent: $AGENT_ID"
echo "Environment: $ENV_ID" # Store for later use
echo "AGENT_ID=$AGENT_ID" >> .env.agents
echo "ENV_ID=$ENV_ID" >> .env.agents
name: Deploy Agents
on: push: branches: [main] paths: ['agents/**'] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install ant CLI run: | -weight: 500;">curl -fsSL \ "https://github.com/anthropics/anthropic-cli/releases/download/v1.2.1/ant_1.2.1_linux_amd64.tar.gz" \ | -weight: 600;">sudo tar -xz -C /usr/local/bin ant - name: Update agent config env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} run: | ant beta:agents -weight: 500;">update \ --agent-id "${{ vars.AGENT_ID }}" \ --version "${{ vars.AGENT_VERSION }}" \ < agents/reviewer.agent.yaml
name: Deploy Agents
on: push: branches: [main] paths: ['agents/**'] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install ant CLI run: | -weight: 500;">curl -fsSL \ "https://github.com/anthropics/anthropic-cli/releases/download/v1.2.1/ant_1.2.1_linux_amd64.tar.gz" \ | -weight: 600;">sudo tar -xz -C /usr/local/bin ant - name: Update agent config env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} run: | ant beta:agents -weight: 500;">update \ --agent-id "${{ vars.AGENT_ID }}" \ --version "${{ vars.AGENT_VERSION }}" \ < agents/reviewer.agent.yaml
name: Deploy Agents
on: push: branches: [main] paths: ['agents/**'] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install ant CLI run: | -weight: 500;">curl -fsSL \ "https://github.com/anthropics/anthropic-cli/releases/download/v1.2.1/ant_1.2.1_linux_amd64.tar.gz" \ | -weight: 600;">sudo tar -xz -C /usr/local/bin ant - name: Update agent config env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} run: | ant beta:agents -weight: 500;">update \ --agent-id "${{ vars.AGENT_ID }}" \ --version "${{ vars.AGENT_VERSION }}" \ < agents/reviewer.agent.yaml
# List agents in a readable table
ant beta:agents list --format yaml # List environments with just names and IDs
ant beta:environments list --transform "data.#.{id,name}" --format yaml # Check session -weight: 500;">status
ant beta:sessions retrieve \ --session-id "$SESSION_ID" \ --transform -weight: 500;">status --format raw
# List agents in a readable table
ant beta:agents list --format yaml # List environments with just names and IDs
ant beta:environments list --transform "data.#.{id,name}" --format yaml # Check session -weight: 500;">status
ant beta:sessions retrieve \ --session-id "$SESSION_ID" \ --transform -weight: 500;">status --format raw
# List agents in a readable table
ant beta:agents list --format yaml # List environments with just names and IDs
ant beta:environments list --transform "data.#.{id,name}" --format yaml # Check session -weight: 500;">status
ant beta:sessions retrieve \ --session-id "$SESSION_ID" \ --transform -weight: 500;">status --format raw
# readonly-reviewer.agent.yaml
name: Read-Only Reviewer
model: claude-sonnet-4-6
system: Review code without modifying it.
tools: - type: agent_toolset_20260401 configs: - name: write enabled: false - name: edit enabled: false - name: web_fetch enabled: false
# readonly-reviewer.agent.yaml
name: Read-Only Reviewer
model: claude-sonnet-4-6
system: Review code without modifying it.
tools: - type: agent_toolset_20260401 configs: - name: write enabled: false - name: edit enabled: false - name: web_fetch enabled: false
# readonly-reviewer.agent.yaml
name: Read-Only Reviewer
model: claude-sonnet-4-6
system: Review code without modifying it.
tools: - type: agent_toolset_20260401 configs: - name: write enabled: false - name: edit enabled: false - name: web_fetch enabled: false
tools: - type: agent_toolset_20260401 default_config: enabled: false configs: - name: bash enabled: true - name: read enabled: true
tools: - type: agent_toolset_20260401 default_config: enabled: false configs: - name: bash enabled: true - name: read enabled: true
tools: - type: agent_toolset_20260401 default_config: enabled: false configs: - name: bash enabled: true - name: read enabled: true - The ant CLI is Anthropic's official Go-based CLI for the Claude API, launched April 2026. It manages agents, environments, and sessions from your terminal.
- Install on macOS with -weight: 500;">brew -weight: 500;">install anthropics/tap/ant. Linux and Go installs are also supported.
- Define agents as YAML files, check them into Git, and deploy through CI - full GitOps for your agent configs.
- Sessions cost $0.08/hour (billed to the millisecond) plus standard Claude token rates. Idle time is free.