Grok CLI
Manual install
Section titled “Manual install”If your machine does not have the grok command yet, install Grok Build CLI for your system first. If Grok CLI is already installed, go straight to manual setup.
irm https://x.ai/cli/install.ps1 | iexOpen a new terminal:
grok --versioncurl -fsSL https://x.ai/cli/install.sh | bashOpen a new terminal:
grok --versioncurl -fsSL https://x.ai/cli/install.sh | bashOpen a new terminal:
grok --versionManual setup
Section titled “Manual setup”If you are not using CC Switch, update Grok’s config.toml manually. Use the OpenAI-compatible Base URL with /v1, and use a token from the Grok CLI group.
-
Create and enter the configuration directory.
mkdir %USERPROFILE%\.grok cd %USERPROFILE%\.grokmkdir -p ~/.grok cd ~/.grokmkdir -p ~/.grok cd ~/.grok -
Create or update
config.toml.Choose an available Grok model from the dynamic model marketplace, then replace
<model-id>with the exact model name.[model.custom] model = "<model-id>" base_url = "https://api.qiuqiutoken.net/v1" name = "Qiuqiu" api_key = "sk-your-token" [models] default = "custom" -
Close all Grok CLI terminal windows, open a new terminal, then start Grok CLI from your project.
cd your-project-folder grok inspect grokcd your-project-folder grok inspect grokcd your-project-folder grok inspect grok
