Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

install.ts

22 lines806 Bytes

1/**
2 * Grok CLI install for sandbox bootstrap.
3 *
4 * Primary: {@link https://x.ai/cli/install.sh} (official).
5 * Fallback: GCS mirror used by the installer when x.ai is unreachable — needed
6 * on Daytona and other sandboxes whose egress firewall blocks `x.ai` but allows
7 * `storage.googleapis.com` (Daytona essential service).
8 *
9 * @see https://x.ai/cli
10 * @see https://docs.x.ai/build/overview#install
11 */
12const GROK_INSTALL_SCRIPT_PRIMARY = 'https://x.ai/cli/install.sh'
13const GROK_INSTALL_SCRIPT_FALLBACK =
14 'https://storage.googleapis.com/grok-build-public-artifacts/cli/install.sh'
15​
16export const GROK_CLI_INSTALL_COMMAND =
17 '(curl -fsSL ' +
18 GROK_INSTALL_SCRIPT_PRIMARY +
19 ' || curl -fsSL ' +
20 GROK_INSTALL_SCRIPT_FALLBACK +
21 ') | bash && ' +
22 '"$HOME/.grok/bin/grok" --version </dev/null'