Docker Sandboxes mixin adding the Grok CLI (xAI, DMR, OpenAI)
536
sha256:bd4c8c3bd652…
10.1 kB
about 2 months ago
A standalone Docker Sandboxes kit
(kind: mixin) that adds the Grok CLI
(@vibe-kit/grok-cli) to any sandbox agent. Grok CLI is an OpenAI-compatible
client, so this image ships in three backend flavors, one per tag.
Source and full docs: https://github.com/ajeetraina/sbx-kits-grok
| Tag | Backend | GROK_BASE_URL | Default model | Credential |
|---|---|---|---|---|
latest, xai | xAI (Grok) | https://api.x.ai/v1 | grok-code-fast-1 | xAI key |
dmr | Docker Model Runner (local) | http://host.docker.internal:12434/engines/v1 | ai/gemma3 | none |
openai | OpenAI | https://api.openai.com/v1 | gpt-4o-mini | OpenAI key |
xAI is the default because Grok CLI is, first and foremost, a Grok client. The DMR tag is the zero-key path (it runs an open-weights model locally through the same CLI); the OpenAI tag reuses the CLI's OpenAI compatibility.
xAI (default). Store your key once with sbx, then run:
sbx secret set-custom -g --host api.x.ai --env GROK_API_KEY \
--placeholder "xai-{rand}" --value "$XAI_API_KEY"
sbx run --kit docker.io/ajeetraina777/sbx-grok-kits:latest claude
Local (DMR). Enable Docker Model Runner and pull the model on the host - no key:
docker model pull ai/gemma3
sbx run --kit docker.io/ajeetraina777/sbx-grok-kits:dmr claude
OpenAI:
sbx secret set-custom -g --host api.openai.com --env GROK_API_KEY \
--placeholder "sk-{rand}" --value "$OPENAI_API_KEY"
sbx run --kit docker.io/ajeetraina777/sbx-grok-kits:openai claude
The cloud tags hold no key. The sbx proxy injects it from the stored secret on
the wire, so the key never enters the sandbox (sbx run has no -e flag).
Each tag installs @vibe-kit/grok-cli via npm, writes
/home/agent/.grok/user-settings.json for the right backend, sets
GROK_BASE_URL/GROK_MODEL, and (for the cloud tags) adds a narrow
serviceDomains/serviceAuth rule so the proxy injects the stored key on
outbound requests. Inside the sandbox, run grok for the interactive TUI or
grok -p "..." for a headless one-off.
Per-backend setup notes, validation steps, and the raw spec.yaml for each kit
live on GitHub:
https://github.com/ajeetraina/sbx-kits-grok/tree/main/providers