anthropics/anthropic-cli
The CLI for the Claude API
ant – Claude Platform CLI
What it is
antis the official command‑line interface for Anthropic’s Claude Platform. It lets you call the Claude large‑language‑model API directly from your terminal.
Key capabilities
- Message handling – send prompts, receive completions, and pipe results into other tools.
- Resource management – list models, create and manage beta resources such as agents, sessions, and uploaded files.
- Convenient auth – log in with your Claude Console account, use an
ANTHROPIC_API_KEYenv var, or pipe a secret from a manager (e.g., 1Password) via stdin. - Output shaping – extract fields with a jq‑style
--transformflag and output raw text for scripting. - File uploads – embed images or other files in messages using the
@pathsyntax.
Installation
- Homebrew (macOS/Linux):
brew install anthropics/tap/ant - From source (any platform): install Go 1.22+, then run
go install 'github.com/anthropics/anthropic-cli/cmd/ant@latest'. The binary lands in$(go env GOPATH)/bin.
Getting started
- Authenticate:
ant auth login # or set ANTHROPIC_API_KEY with a key from the Claude Console - Send a simple prompt:
The CLI accepts relaxed JSON/YAML, so you don’t need to quote every key.ant messages create \ --model claude-opus-4-8 \ --max-tokens 1024 \ --message '{role: user, content: "Hello, Claude"}'
Typical command pattern
ant <resource>[:<subresource>] <command> [flags]
- Example:
ant models list– shows all available Claude models. - Example:
ant beta:agents list– lists beta‑stage agents. - Use
--helpon any command for detailed flag information.
Why it matters
- Provides a lightweight, script‑friendly way to integrate Claude into automation pipelines, CI jobs, or personal tooling without writing code.
- Mirrors the full Claude API surface, so anything you can do via HTTP you can do from the terminal.
License
- MIT License (see
LICENSE).
Further reading
- Full docs: https://platform.claude.com/docs/en/api/sdks/cli
- Contributing guidelines:
CONTRIBUTING.md.
関連
- プロジェクト
- プロジェクト
- プロジェクト
- プロジェクト
- プロジェクト