162 lines
5.5 KiB
YAML
162 lines
5.5 KiB
YAML
# ============================================================
|
||
# AgentDock 适配器 · Anthropic Claude Code(Wave 2.1)
|
||
# 数据依据:调研底稿 agent-cli-survey-2026-08-24.md §2 + 架构 §3.3
|
||
# ============================================================
|
||
id: claude-code
|
||
name: Claude Code
|
||
name_zh: Claude Code
|
||
vendor: Anthropic
|
||
status: available
|
||
adapter_version: 1.1.0
|
||
license: 专有(仅官方渠道安装、不重打包、不修改二进制)
|
||
|
||
platforms:
|
||
windows:
|
||
architectures: [x64]
|
||
notes: 原生支持,Windows 10 1809+ / Windows Server 2019+
|
||
linux:
|
||
distributions: [ubuntu]
|
||
architectures: [x64]
|
||
min_ubuntu: "20.04"
|
||
|
||
official:
|
||
homepage: https://claude.ai
|
||
docs: https://code.claude.com/docs/en/setup
|
||
allowed_hosts: [claude.ai, registry.npmjs.org, github.com]
|
||
|
||
runtime_deps: []
|
||
|
||
install:
|
||
preferred: winget
|
||
channels:
|
||
- id: winget
|
||
platforms: [windows]
|
||
command: [winget, install, Anthropic.ClaudeCode]
|
||
package: Anthropic.ClaudeCode
|
||
elevate: never
|
||
post_checks: [detect]
|
||
- id: official_script
|
||
platforms: [windows]
|
||
script:
|
||
url: https://claude.ai/install.ps1
|
||
kind: powershell_irm
|
||
elevate: never
|
||
post_checks: [detect]
|
||
- id: npm
|
||
platforms: [windows, linux]
|
||
command: [npm, install, -g, "@anthropic-ai/claude-code"]
|
||
package: "@anthropic-ai/claude-code"
|
||
elevate: never
|
||
post_checks: [detect]
|
||
|
||
detect:
|
||
executable: claude
|
||
version_args: ["--version"]
|
||
version_regex: "^(\\d+\\.\\d+\\.\\d+)"
|
||
|
||
update:
|
||
method: winget_upgrade
|
||
command: [winget, upgrade, Anthropic.ClaudeCode]
|
||
|
||
uninstall:
|
||
method: package_manager
|
||
command: [winget, uninstall, Anthropic.ClaudeCode]
|
||
keep_config_default: true
|
||
|
||
authorization:
|
||
modes:
|
||
- mode: browser_oauth
|
||
command: [claude]
|
||
notes_zh: 运行 claude 后按浏览器提示登录(Pro/Max/Team/Enterprise/Console 账号)
|
||
- mode: api_key
|
||
env_keys: [ANTHROPIC_API_KEY]
|
||
notes_zh: 设置 ANTHROPIC_API_KEY 后 CLI 优先使用 API Key
|
||
|
||
# 配置机制(调研底稿 §2「配置机制」):用户级 ~/.claude/settings.json(JSON)
|
||
# 官方确认:settings.json 内 env 块可注入环境变量;ANTHROPIC_API_KEY / ANTHROPIC_BASE_URL /
|
||
# ANTHROPIC_AUTH_TOKEN / ANTHROPIC_CUSTOM_HEADERS;默认模型经 /model 命令调整(非 settings.json 字段)。
|
||
configuration:
|
||
files:
|
||
- path: "~/.claude/settings.json"
|
||
format: json
|
||
scope: user
|
||
environment:
|
||
- key: ANTHROPIC_API_KEY
|
||
sensitive: true
|
||
maps_to_field: api_key
|
||
- key: ANTHROPIC_AUTH_TOKEN
|
||
sensitive: true
|
||
maps_to_field: auth_token
|
||
fields:
|
||
- id: env.ANTHROPIC_BASE_URL
|
||
label_zh: Base URL
|
||
group: advanced
|
||
help_zh: 官方环境变量 ANTHROPIC_BASE_URL,写入 settings.json 的 env 块(自定义 API 端点/网关/代理)
|
||
required: false
|
||
sensitive: false
|
||
type: url
|
||
storage: file
|
||
docs_url: https://code.claude.com/docs/en/env-vars
|
||
- id: api_key
|
||
label_zh: API Key
|
||
group: auth
|
||
help_zh: 存入系统密钥库(对应 ANTHROPIC_API_KEY),设置后优先于订阅登录
|
||
required: false
|
||
sensitive: true
|
||
type: string
|
||
storage: keyring
|
||
docs_url: https://code.claude.com/docs/en/env-vars
|
||
- id: auth_token
|
||
label_zh: Bearer 令牌
|
||
group: auth
|
||
help_zh: 可选,存入系统密钥库(对应 ANTHROPIC_AUTH_TOKEN,Bearer 头);一般用户无需填写
|
||
required: false
|
||
sensitive: true
|
||
type: string
|
||
storage: keyring
|
||
docs_url: https://code.claude.com/docs/en/env-vars
|
||
|
||
diagnostics:
|
||
- rule_id: path.not_installed
|
||
- rule_id: path.not_in_path
|
||
- rule_id: version_conflict.multiple_copies
|
||
- rule_id: config.corrupt
|
||
|
||
documentation:
|
||
quickstart_zh: 安装后运行 `claude` 登录,或用 `claude -p "提示词"` 无头执行。
|
||
install_zh: 推荐 winget(`winget install Anthropic.ClaudeCode`);也可走官方 PowerShell 脚本(irm https://claude.ai/install.ps1)或 npm(`@anthropic-ai/claude-code`,Node 22+)。
|
||
auth_zh: ① 浏览器 OAuth:运行 `claude` 按提示登录(Pro/Max/Team/Enterprise/Console 账号;免费版不含 Claude Code);② API Key:设置 ANTHROPIC_API_KEY 后 CLI 优先使用(非交互 -p 模式下有 key 即直接使用)。
|
||
commands:
|
||
- cmd: claude
|
||
desc_zh: 启动交互式会话
|
||
- cmd: claude -p "提示词"
|
||
desc_zh: 无头单次执行(--print)
|
||
- cmd: claude -p "提示词" --output-format json
|
||
desc_zh: 结构化 JSON 输出
|
||
- cmd: claude --allowedTools "Bash(git:*)"
|
||
desc_zh: 预授权指定工具
|
||
- cmd: claude --continue
|
||
desc_zh: 续接最近的会话
|
||
- cmd: claude --resume <会话ID>
|
||
desc_zh: 恢复指定会话
|
||
- cmd: claude doctor
|
||
desc_zh: 环境诊断
|
||
- cmd: claude --version
|
||
desc_zh: 显示版本号
|
||
params:
|
||
- param: -p / --print
|
||
desc_zh: 非交互模式,执行后退出
|
||
- param: --output-format
|
||
desc_zh: 输出格式(text / json / stream-json)
|
||
- param: --json-schema
|
||
desc_zh: 约束输出为指定 JSON Schema
|
||
- param: --allowedTools
|
||
desc_zh: 预授权工具列表
|
||
- param: --bare
|
||
desc_zh: 极简启动模式
|
||
updated_at: "2026-08-25"
|
||
risks_zh:
|
||
- 专有许可:只引导官方渠道安装,不重打包、不修改二进制、不代付费
|
||
- 原生 Windows 无沙箱功能,需要沙箱请使用 WSL2(以官方文档为准)
|
||
- 默认模型经 /model 命令调整,非 settings.json 字段,故本表单未提供模型字段
|