diff --git a/FEATURES.md b/FEATURES.md index a4d8b14..c65b373 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -693,7 +693,7 @@ AnyBot 是一個桌面聊天 App,介面和運作方式照 Grok Bot 重做。 | 「xAI Grok」 | https://api.x.ai/v1 | grok-4 | grok-4、grok-4-fast、grok-3-mini | 要 | XAI_API_KEY | 「在 console.x.ai 取得 API 金鑰」 | | 「OpenAI」 | https://api.openai.com/v1 | gpt-5 | gpt-5、gpt-5-mini、gpt-4.1 | 要 | OPENAI_API_KEY | 「在 platform.openai.com 取得 API 金鑰」 | | 「Claude」 | https://api.anthropic.com/v1 | claude-opus-5-5 | claude-opus-5-5、claude-sonnet-5-5、claude-haiku-5-5、claude-fable-5-1 | 要 | ANTHROPIC_API_KEY | 「在 console.anthropic.com 取得 API 金鑰」 | -| 「Claude Code」 | (無:用這台電腦的 claude 指令,見 `src/claudecli.rs`) | sonnet | opus、sonnet、haiku | 不用 | – | 「用這台電腦上已登入的 Claude Code(Claude 訂閱),不用 API 金鑰:先安裝 claude,再在終端機執行 claude auth login」 | +| 「Claude Code」 | (無:用這台電腦的 claude 指令,見 `src/claudecli.rs`) | sonnet | opus、sonnet、haiku、fable 和 4 個完整名稱(見 `src/claudecli.rs`) | 不用 | – | 「用這台電腦上已登入的 Claude Code(Claude 訂閱),不用 API 金鑰:先安裝 claude,再在終端機執行 claude auth login」 | | 「Google Gemini」 | https://generativelanguage.googleapis.com/v1beta/openai | gemini-2.5-flash | gemini-2.5-flash、gemini-2.5-pro | 要 | GEMINI_API_KEY | 「在 aistudio.google.com 取得 API 金鑰」 | | 「OpenRouter」 | https://openrouter.ai/api/v1 | openrouter/auto | openrouter/auto | 要 | OPENROUTER_API_KEY | 「在 openrouter.ai 取得 API 金鑰」 | | 「Ollama」 | http://localhost:11434/v1 | llama3.2 | llama3.2、qwen2.5、gemma3 | 不用 | – | 「先安裝並開啟 Ollama,不需要金鑰」 | diff --git a/docs/feature-map/claudecode.md b/docs/feature-map/claudecode.md index adc92b7..e80d338 100644 --- a/docs/feature-map/claudecode.md +++ b/docs/feature-map/claudecode.md @@ -4,7 +4,7 @@ ## 子功能 -- `claudecode-run` 當大腦:在 設定 › 模型 或 Bot 設定選「Claude Code」,每一步就用這台電腦的 `claude` 指令跑。沒有金鑰、沒有服務網址;模型是 opus、sonnet、haiku(跟著 Claude Code 的最新版)。雲端大腦(伺服器上的大腦)沒有 `claude`,選了會回「找不到 Claude Code」;要在雲端用就選「Claude」(API 金鑰),或把這台電腦當大腦(見陷阱)。 +- `claudecode-run` 當大腦:在 設定 › 模型 或 Bot 設定選「Claude Code」,每一步就用這台電腦的 `claude` 指令跑。沒有金鑰、沒有服務網址;模型清單是別名 opus、sonnet、haiku、fable(跟著 Claude Code 的最新版)加上目前幾個完整名稱;帳號不能用的名字,那一步回 Claude Code 自己的錯誤。雲端大腦(伺服器上的大腦)沒有 `claude`,選了會回「找不到 Claude Code」;要在雲端用就選「Claude」(API 金鑰),或把這台電腦當大腦(見陷阱)。 - `claudecode-missing` 沒裝或沒登入:找不到 `claude` 時,Bot 回「找不到 Claude Code(claude 指令)…」;還沒登入時說明要執行 `claude auth login`。格子寫「未設定」,裝好重新開啟 AnyBot 後寫「可以用」。 - `claudecode-tools` 工具與審批不變:Claude 的內建工具全部關掉,它要用工具就在回答裡提出,AnyBot 照原來的規則處理,要問的照樣出卡片。 - `claudecode-answer` 回答與圖片:整段說完才出現(不逐字),圖片和截圖直接給 Claude 看;訂閱額度用完時說「已達用量上限」,Bot 有備用模型就換。 diff --git a/src/claudecli.rs b/src/claudecli.rs index 9c0ec9c..baa516d 100644 --- a/src/claudecli.rs +++ b/src/claudecli.rs @@ -26,7 +26,21 @@ const ALIVE_EVERY: Duration = Duration::from_secs(1); /// The model when a bot names none: the CLI's own alias for the newest Sonnet. const DEFAULT_MODEL: &str = "sonnet"; /// The aliases the CLI takes; each follows the newest model of its family. -pub const MODELS: [&str; 3] = ["opus", "sonnet", "haiku"]; +/// The aliases the CLI takes (they follow its latest model) and the current full names from the +/// CLI's own model list. The CLI has no command to list what a subscription can use, so this is +/// the list; a name the account can't use fails at the step with the CLI's own message. +pub const MODELS: [&str; 10] = [ + "opus", + "sonnet", + "haiku", + "fable", + "claude-opus-5-5", + "claude-sonnet-5-5", + "claude-haiku-5-5", + "claude-fable-5-2", + "claude-opus-4-8", + "claude-sonnet-4-6", +]; const CLI_NAME: &str = if cfg!(windows) { "claude.exe" } else { "claude" };