grok_ask
Consult Grok for answers, or enable worker mode to let Grok edit files and run shell commands in your workspace. Returns structured JSON.
Instructions
Ask Grok (consult by default; worker=True to let Grok edit/run shell in cwd).
prompt: the instruction to Grok (required)
channel: persistent conversation channel (default "default")
cwd: working directory (default: the repo root; worker mode requires a worktree/scratch — enforced by bin/grok-ask's own dual-gate)
worker: True = worker mode (write + shell, auto-approved; main tree refused unless dual-gate override)
model: grok model id (default grok-4.5)
attach_file: file path to attach into the prompt (repeatable not supported here)
timeout_secs: wall-clock timeout in seconds (0 = default)
Returns JSON: {"status","class","text","run_id","handoff","cwd"} status is SUCCESS | FAILED(class) | TIMEOUT; text is the reply body.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| model | No | ||
| prompt | Yes | ||
| worker | No | ||
| channel | No | default | |
| attach_file | No | ||
| timeout_secs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |