Choose the official installation path
The xAI installer supports macOS, Linux, and WSL. Windows users can run the official PowerShell installer. Run installation commands in a trusted terminal and let the process finish before opening a new shell.
For managed environments, xAI also documents the npm package as an alternative. Standardize one method per team so upgrades and incident response have a single owner.
curl -fsSL https://x.ai/cli/install.sh | bash
# Windows PowerShell
irm https://x.ai/cli/install.ps1 | iex
# Managed alternative
npm install -g @xai-official/grok Verify the executable you will actually run
Open a fresh terminal so PATH changes are loaded, then ask Grok for version information. If the command is missing or resolves to an unexpected location, fix PATH before authenticating.
The public source repository is useful for understanding the harness, but a source checkout and the released CLI can move on different schedules. Record the installed version when reporting a reproducible bug.
- Confirm the command is grok, not grok-build.
- Do not treat an API model slug as the CLI version.
- Keep installation output free of credentials.
grok --version
grok --help Make updates deliberate
Check for an update before a workshop, CI rollout, or team-wide migration, then update at a controlled time. Re-run the version command afterward and smoke-test one repository.
Avoid pinning a page to a supposedly permanent latest release. Use the live changelog and the CLI update channel as the current source of truth.
grok update --check
grok update
grok --version