Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
ant CLI는 터미널에서 Claude API에 접근할 수 있게 해줍니다. 모든 API 리소스는 하위 명령어로 제공되며, 출력 형식 지정, 응답 필터링, YAML 또는 JSON 파일 입력을 지원합니다.
curl과 비교하면, ant는 직접 작성한 JSON 대신 타입이 지정된 플래그나 파이프로 전달된 YAML로 요청 본문을 구성하고, @path 참조를 사용하여 파일 내용을 문자열 필드에 인라인으로 삽입합니다. 내장된 --transform 쿼리로 응답 필드를 추출하므로 jq와 같은 별도의 도구가 필요하지 않으며, 목록 엔드포인트를 자동으로 페이지네이션합니다.
brew install anthropics/tap/ant설치를 확인하세요:
ant --versionant auth login은 Claude Console에 대해 브라우저 기반 OAuth 플로우를 열고 결과 자격 증명을 로컬에 저장하므로, API 키를 생성하거나 관리하지 않고도 API를 호출할 수 있습니다.
ant auth login바이너리가 설치되고 인증이 완료되면 Messages API를 호출하세요:
ant messages create \
--model claude-opus-5 \
--max-tokens 1024 \
--message '{role: user, content: "Hello, Claude"}'{
"model": "claude-opus-5",
"id": "msg_01YMmR5XodC5nTqMxLZMKaq6",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How are you doing today? Is there something I can help you with?"
}
],
"stop_reason": "end_turn",
"usage": { "input_tokens": 27, "output_tokens": 20 /*, ... */ }
}응답은 전체 API 객체이며, stdout이 터미널이므로 보기 좋게 출력됩니다.
CLI는 bash, zsh, fish, PowerShell용 자동 완성 스크립트를 함께 제공합니다. 사용 중인 셸에 맞는 스크립트를 생성하고 설치하세요:
ant @completion zsh > "${fpath[1]}/_ant"
# 셸을 재시작하거나 다음을 실행하세요: autoload -U compinit && compinitAPI 키, 헤드리스 호스트, 여러 워크스페이스, 명명된 프로필
명령어 구조, 출력 형식, GJSON 변환, 요청 본문
API 리소스 버전 관리, 스크립팅 패턴, Claude Code에서의 사용
Was this page helpful?