CLI 參考
claudex [OPTIONS] [COMMAND]| 選項 | 說明 |
|---|---|
--config <PATH> | 覆寫設定檔路徑 |
--version | 印出版本 |
--help | 印出說明 |
不帶指令執行時,若已設定 profile,Claudex 會啟動 TUI 儀表板;若無 profile,則顯示歡迎訊息。
以特定提供商 profile 執行 Claude Code。
claudex run <PROFILE> [PROMPT] [OPTIONS] [-- ARGS...]| 引數 / 選項 | 說明 |
|---|---|
PROFILE | Profile 名稱,或 auto 以使用智慧路由 |
PROMPT | 選用的提示詞,用於非互動(一次性)執行 |
-m, --model MODEL | 覆寫此工作階段的預設模型 |
--hyperlinks | 強制啟用 OSC 8 終端超連結 |
--print | 印出回應後退出(非互動模式) |
--dangerously-skip-permissions | 跳過所有權限提示(與 --print 搭配用於 CI/CD) |
ARGS... | 傳遞給 claude 的額外引數(-- 之後) |
# 使用 Grok(互動模式)claudex run grok
# 使用 Grok 並指定特定模型claudex run grok -m grok-3-mini-beta
# 智慧路由claudex run auto
# 強制終端超連結claudex run grok --hyperlinks
# 非互動一次性執行claudex run grok "Explain this codebase" --print
# CI/CD 流水線使用(無提示、無權限)claudex run grok "Fix lint errors" --print --dangerously-skip-permissions
# 傳遞額外引數給 claudeclaudex run grok -- --verboseprofile
Section titled “profile”管理提供商 profile。
profile list
Section titled “profile list”claudex profile list列出所有已設定的 profile 及其狀態、提供商類型和模型。
profile add
Section titled “profile add”claudex profile add互動式精靈,用於新增 profile。引導完成提供商選擇、API 金鑰輸入(支援金鑰鏈儲存)、模型選擇和連線測試。
profile show
Section titled “profile show”claudex profile show <NAME>顯示特定 profile 的詳細資訊,包括所有設定欄位。
profile remove
Section titled “profile remove”claudex profile remove <NAME>從設定中移除 profile。
profile test
Section titled “profile test”claudex profile test <NAME|all>測試特定 profile 或所有 profile 的連線。向提供商的 /models 端點發送輕量請求。
管理提供商 profile 的 OAuth 訂閱認證。
auth login
Section titled “auth login”claudex auth login <PROVIDER> [OPTIONS]| 選項 | 說明 |
|---|---|
--profile <NAME> | 關聯到特定 profile |
--enterprise-url <URL> | 自訂企業伺服器 URL(用於自行管理的 GitLab 等) |
--headless | 使用無頭(Device Code)流程,跳過瀏覽器啟動 |
使用 OAuth 登入提供商。支援的提供商:claude、openai、google、qwen、kimi、github、gitlab。
# 登入 OpenAI(從 Codex CLI 讀取)claudex auth login openai --profile codex-sub
# 登入 Claude(從 ~/.claude 讀取)claudex auth login claude
# 登入 Googleclaudex auth login google --profile gemini-sub
# 登入 GitLab 並指定企業 URLclaudex auth login gitlab --enterprise-url https://gitlab.mycompany.com
# 無頭模式(不開啟瀏覽器,僅 Device Code)claudex auth login github --headlessauth status
Section titled “auth status”claudex auth status [PROVIDER]顯示目前的認證狀態。不指定提供商時,顯示所有已設定 OAuth profile 的狀態。
# 檢查所有 OAuth profileclaudex auth status
# 檢查特定提供商claudex auth status openaiauth refresh
Section titled “auth refresh”claudex auth refresh <PROVIDER>手動刷新提供商的 OAuth token。代理也會在 token 過期時自動刷新。
auth logout
Section titled “auth logout”claudex auth logout <PROVIDER>從系統金鑰鏈中移除提供商的已儲存 OAuth token。
管理翻譯代理伺服器。
proxy start
Section titled “proxy start”claudex proxy start [OPTIONS]| 旗標 | 說明 |
|---|---|
-p, --port PORT | 覆寫代理連接埠(預設:來自設定) |
-d, --daemon | 以背景程式執行 |
proxy stop
Section titled “proxy stop”claudex proxy stop停止代理背景程式(透過 PID 檔案傳送 SIGTERM)。
proxy status
Section titled “proxy status”claudex proxy status顯示代理是否正在執行及使用的連接埠。
dashboard
Section titled “dashboard”claudex dashboard啟動 TUI 儀表板進行即時監控和快速啟動。
config
Section titled “config”管理設定檔。
config show
Section titled “config show”claudex config show顯示載入的設定檔路徑、搜尋順序和目前的設定值。
config path
Section titled “config path”claudex config path僅印出解析後的設定檔路徑。
config init
Section titled “config init”claudex config init從內建範本在當前目錄建立新設定檔。
config recreate
Section titled “config recreate”claudex config recreate從 config.example.toml 重建設定檔,覆寫現有設定。
config edit
Section titled “config edit”claudex config edit用 $EDITOR(或 $VISUAL)開啟設定檔。
config validate
Section titled “config validate”claudex config validate驗證設定語法、profile 參照(backup_providers、router 規則)和 OAuth 提供商設定。回報錯誤和警告。
config get
Section titled “config get”claudex config get <KEY>透過鍵路徑取得特定設定值(例如 proxy_port、profiles.0.name)。
config set
Section titled “config set”claudex config set <KEY> <VALUE>透過鍵路徑設定特定設定值。
config export
Section titled “config export”claudex config export以 TOML 格式將目前合併的設定匯出到 stdout。
管理設定集(可安裝的規則、技能和 MCP 伺服器套件包)。
sets add
Section titled “sets add”claudex sets add <PATH>從包含 manifest.json(或 manifest.yaml)的本地目錄安裝設定集。
sets remove
Section titled “sets remove”claudex sets remove <NAME>依名稱移除已安裝的設定集。
sets list
Section titled “sets list”claudex sets list列出所有已安裝的設定集及其版本、說明和組件摘要。
sets update
Section titled “sets update”claudex sets update <NAME> <PATH>從新的 manifest 路徑更新現有設定集。
sets show
Section titled “sets show”claudex sets show <NAME>顯示已安裝設定集的詳細資訊,包括所有組件。
update
Section titled “update”claudex update [OPTIONS]| 旗標 | 說明 |
|---|---|
--check | 僅檢查更新,不安裝 |
不帶 --check 時,從 GitHub Releases 下載並安裝最新版本。