Grok WorldGrok Build CLI field station

GROK BUILD CLI / 18

更新、診斷並整合 shell completions

最安全 maintenance 是 evidence sequence:辨識 release、檢查 health、預覽變更、驗證 exact result。

CHANNELCLI 維護 / 中階 / 11 MIN
來源核對日期2026-10-21
ORIGINOFFICIAL DOCS / PRIMARY

分開 check 與 install

用 grok update --check 或 --check --json 查 availability,不修改 installation。Command 可切換到 --stable(預設 channel,help 描述為每週發布)或 --alpha,也可安裝 specific --version;切 channel 是刻意 policy。

安裝前記錄 grok version --json。xAI 並未在 docs.x.ai 發布逐版 Grok Build changelog,因此更新後閱讀 TUI 內的 /release-notes 並重跑 smoke test;只有修復已知問題才 --force-reinstall。

  • Automation 中 pin 版本並記錄 version 輸出。
  • CI 或 container 中以 GROK_DISABLE_AUTOUPDATER 或 [cli] 下的 auto_update = false 抑制背景更新檢查。
  • 每次切換 channel 或版本後都重跑 smoke test。
grok version --json
grok update --check --json

Fix 前先 diagnose

grok doctor 不啟動 Grok 即可檢查 terminal、clipboard、color 與 input 支援;--json 供 machine 讀。grok inspect 則檢查 discovered config/extensions,是不同 evidence surface。

不帶 ID 執行 grok doctor fix 會列出可用的 automatic fixes;review 後再套用單一 named fix。--yes 會不經確認套用顯示的變更,只能用於已稽核這些變更的程序。

  • 分享前 review debug-file。
  • 先修第一個 failing layer。
  • Repair 後重跑 doctor。
grok doctor --json
grok doctor fix
grok doctor fix FIX_ID

刻意產生 completion code

grok completions 需要指定 shell(bash、elvish、fish、powershell 或 zsh)並輸出 script。先寫 temp file、inspect,再依 shell convention 安裝,不直接 append unknown text。

Captured ledger 中 TUI /doctor 是 source-preview;grok doctor shell command 是 runtime-confirmed,/terminal-setup 則是官方文件記載的 TUI terminal 檢查。教學必須保留 availability label。

grok completions zsh > /tmp/_grok
sed -n "1,40p" /tmp/_grok