ant — Claude Platform CLI

ant

The official ant tool: Claude messages, agents, sessions and files through the API from the terminal and scripts

  • 728 ★ on the repository
  • Last commit
  • Apache-2.0
CLIOfficialEditors’ pick

Extended access

Why this level

  • The CLI works with your API key and platform account: requests cost money and the commands manage agents, sessions and files.
All reasons and checks
Needs a VPN

anthropics/anthropic-cli

Install

Works in

Manual install

brew install anthropics/tap/ant

Through Go: `go install 'github.com/anthropics/anthropic-cli/v2/cmd/ant@latest'`, Go 1.22 or newer is needed. Then `ant auth login` or `ANTHROPIC_API_KEY`.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The CLI works with your API key and platform account: requests cost money and the commands manage agents, sessions and files.

This is third-party code. Review the repository files before installing.

What it does

`ant` is the official CLI of the Claude Platform from Anthropic. It puts the Claude API in the terminal: it sends messages with `ant messages create`, lists models with `ant models list`, manages agents and sessions, uploads files and lets you script against any API endpoint. Structured flags accept relaxed JSON or YAML, so keys can go unquoted. There are two ways to sign in. The `ant auth login` command opens sign-in through a Claude Console account, and the `ANTHROPIC_API_KEY` variable takes a console key directly. To keep a key out of the environment, pipe it through stdin: `op read op://vault/anthropic/api-key | ant --api-key-stdin models list`. Besides Anthropic's own API, the tool reaches Claude models through Google Cloud in Anthropic-managed mode, through the Claude Platform on AWS and through Microsoft Foundry. Each gateway has its own flags and environment variables: a Google project and workspace, an AWS region and workspace, a Foundry resource and key. Version 2 is covered by a migration guide in the Claude API documentation.

Who it is for. Developers and engineers who work with the Claude API from the terminal, script around it and want to give an agent a familiar CLI instead of hand-made curl calls.

Good fit when

  • You want to quickly test a Claude request from the terminal without writing SDK code
  • A CI script has to send a message to the model and parse the answer as JSON
  • Files for the API have to be uploaded in bulk by a command rather than by hand in the console
  • Platform agents and sessions are managed from the shell, for example in automation
  • Claude models are connected through Google Cloud, AWS or Microsoft Foundry and you need one CLI for every gateway

Not a fit when

  • You need interactive work with code: Claude Code does that, while `ant` only calls the API
  • The service lives inside an application: official SDKs fit production code better than CLI calls
  • You have no access to the Anthropic API: it is unavailable directly from Russia and the CLI adds no access
  • You need a key only for a local model: the tool works with the Claude platform and does not support local models

Example request

Send the message "Hello, Claude" through ant with a 1024-token limit and show only the text of the answer.

Limitations

The tool works only with the Claude platform and its gateways through Google Cloud, AWS and Microsoft Foundry. The Anthropic API is unavailable directly from Russia, so the CLI is useless without platform access.

Each gateway needs its own settings. In Foundry the CLI does not refresh a Microsoft Entra ID token itself and you set it again when it expires. The `ant beta:worker` command is not supported on Foundry. The gateway is chosen by specific flags or variables, and `AWS_REGION` and `AWS_PROFILE` alone do not switch it on.

The repository holds a separate Go module, `sandboxes/`, with components for self-hosted sandboxes for Claude Managed Agents. Installing from source needs Go 1.22 or newer. The license is Apache 2.0 and older versions stay under MIT.

How to disable. Remove the tool with `brew uninstall ant` or delete the binary from the Go bin directory. Delete the saved sign-in data by hand and revoke the API key in the platform console.

FAQ

How do I install ant?

With `brew install anthropics/tap/ant` or through Go: `go install 'github.com/anthropics/anthropic-cli/v2/cmd/ant@latest'`. After installing, the Go bin directory has to be on PATH.

How do I sign in?

With `ant auth login` using a Claude Console account or with the `ANTHROPIC_API_KEY` variable. A key can also be piped through stdin with `--api-key-stdin`.

How do I use Claude through Google Cloud or AWS?

Set a Google project and workspace, or an AWS region and workspace, through variables or flags. The CLI routes requests through the right gateway itself.

Does ant work with Microsoft Foundry?

Yes. You need `ANTHROPIC_FOUNDRY_RESOURCE` and a key or an Entra ID token. The `ant beta:worker` command is not supported on Foundry.

Which systems does ant run on?

macOS, Linux and Windows.

Discussion

No questions or reviews yet.

CLI tools

An archive of Anthropic documentation in Markdown: Claude Code, API, MCP, products, support, 4100 files, updated four times daily

WorkflowMinimal access172Repository stars

A Rust CLI for language models from a terminal: an answer, an image, a video, OCR, commit messages and shell commands

CLIExtended access204Repository stars

A CLI that keeps tasks and architecture decisions in the repo so any coding agent can read them and take work.

CLIExtended access93Repository stars

A set of slash commands, skills and subagents for Claude Code: review, tests, security, releases, docs and GitHub to Linear sync

PluginBroad access1.4KRepository stars

A Rust coding agent with a native GUI, a terminal mode, an ACP mode for Zed and an MCP server

CLIBroad access189Repository stars

An HTTP gateway for Claude Code and Codex switches API endpoints on failure and converts requests between model formats

CLIBroad access971Repository stars

README in short

A short README: the tool's purpose, installation through Homebrew or Go, two sign-in methods and a first request. Most of it describes setting up the Google Cloud, AWS and Microsoft Foundry gateways. Full documentation lives on the Claude platform.

README badge

Report a problem