Practical Notes
- Use headless
--promptfor automation; use TUI for longer sessions. - Keep prompts task-scoped (1 request = 1 outcome) for predictable runs.
Two modes: interactive vs headless
Interactive (TUI)
Use interactive mode when you want multi-step reasoning, file browsing, and iterative edits:
grokHeadless (one-shot)
Use headless mode in scripts or CI:
grok --prompt "explain failing tests and propose a minimal fix"Practical guardrails
- Start by asking for a plan and a dry-run command list (no destructive actions).
- For code changes: request a diff-only proposal, then run tests.
- Keep secrets out of pasted logs; prefer env vars or config files.
Suggested use cases
- “Run tests and summarize failures”
- “Scan the repo and propose refactors”
- “Draft a changelog from recent commits”
Treat it like a programmable teammate: deterministic inputs → reproducible outputs.
FAQ
Q: Do I need the Grok API key to install? A: No. Installation is separate; you need an API key to actually use the agent.
Q: Is headless mode good for CI? A: Yes. It’s the most repeatable mode for scripted runs.
Q: How do I keep results stable? A: Keep prompts narrow, ask for diffs, and always run verification commands.