[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-83307":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":15,"starSnapshotCount":15,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},83307,"anthropic-cli","anthropics\u002Fanthropic-cli","anthropics","The CLI for the Claude API",null,"https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fanthropic-cli","Go",508,66,28,0,23,27,69,9.48,false,"main",[23,24,25,26],"anthropic","api","claude","cli","2026-06-12 02:04:33","# Claude Platform CLI\n\nThe official CLI for the [Claude Developer Platform](https:\u002F\u002Fplatform.claude.com\u002Fdocs\u002Fen\u002Fapi).\n\n\u003C!-- x-release-please-start-version -->\n\n## Installation\n\n### Installing with Homebrew\n\n```sh\nbrew install anthropics\u002Ftap\u002Fant\n```\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https:\u002F\u002Fgo.dev\u002Fdoc\u002Finstall) version 1.22 or later installed.\n\n```sh\ngo install 'github.com\u002Fanthropics\u002Fanthropic-cli\u002Fcmd\u002Fant@latest'\n```\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME\u002Fgo\u002Fbin` (or `$GOPATH\u002Fbin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n```sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)\u002Fbin\"\n```\n\n\u003C!-- x-release-please-end -->\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts\u002Frun` script to run the tool locally:\n\n```sh\n.\u002Fscripts\u002Frun args...\n```\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n```sh\nant [resource] \u003Ccommand> [flags...]\n```\n\n```sh\nant messages create \\\n  --api-key my-anthropic-api-key \\\n  --max-tokens 1024 \\\n  --message '{content: [{text: x, type: text}], role: user}' \\\n  --model claude-sonnet-4-5-20250929\n```\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable            | Required | Default value |\n| ------------------------------- | -------- | ------------- |\n| `ANTHROPIC_API_KEY`             | no       | `null`        |\n| `ANTHROPIC_AUTH_TOKEN`          | no       | `null`        |\n| `ANTHROPIC_WEBHOOK_SIGNING_KEY` | no       | `null`        |\n\n### Global flags\n\n- `--api-key` (can also be set with `ANTHROPIC_API_KEY` env var)\n- `--auth-token` (can also be set with `ANTHROPIC_AUTH_TOKEN` env var)\n- `--webhook-key` (can also be set with `ANTHROPIC_WEBHOOK_SIGNING_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request\u002Fresponse details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https:\u002F\u002Fgithub.com\u002Ftidwall\u002Fgjson\u002Fblob\u002Fmaster\u002FSYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https:\u002F\u002Fgithub.com\u002Ftidwall\u002Fgjson\u002Fblob\u002Fmaster\u002FSYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n```bash\nant \u003Ccommand> --arg @abe.jpg\n```\n\nFiles can also be passed inside JSON or YAML blobs:\n\n```bash\nant \u003Ccommand> --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nant \u003Ccommand> \u003C\u003CYAML\narg:\n  image: \"@abe.jpg\"\nYAML\n```\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n```bash\nant \u003Ccommand> --username '\\@abe'\n```\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file:\u002F\u002Fmyfile.txt` (for string encoding) or `@data:\u002F\u002Fmyfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file:\u002F\u002F` or\n`@data:\u002F\u002F`, followed by a third `\u002F` (for example, `@file:\u002F\u002F\u002Ftmp\u002Ffile.txt`).\n\n```bash\nant \u003Ccommand> --arg @data:\u002F\u002Ffile.txt\n```\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Anthropic Go SDK\nfor development purposes using the `.\u002Fscripts\u002Flink` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n```bash\n.\u002Fscripts\u002Flink github.com\u002Forg\u002Frepo@version\n```\n\nTo link to a local copy of the SDK:\n\n```bash\n.\u002Fscripts\u002Flink ..\u002Fpath\u002Fto\u002Fanthropic-go\n```\n\nIf you run the link script without any arguments, it will default to `..\u002Fanthropic-go`.\n","anthropic-cli 是 Claude API 的官方命令行工具。它使用 Go 语言开发，提供了一种简便的方式来与 Claude 平台进行交互，支持消息创建、模型选择等核心功能，并允许用户通过环境变量或全局标志设置 API 密钥及其他认证信息。该 CLI 具有丰富的输出格式选项和调试能力，能够满足不同用户的定制化需求。适用于需要通过命令行界面与 Claude API 进行集成的开发者场景，如自动化脚本编写、API 调试及测试等。",2,"2026-06-11 04:10:51","trending"]