superagent-ai/grok-cli
Tool · Free
A community terminal agent for the Grok API, with web/X search and coding tools. Supports headless execution, sessions, and Telegram control.
What you can use for free
The CLI code is available under MIT without a license fee. This is not a free Grok API: requests require a key and separate API terms. A consumer Grok subscription must not be treated as a promise of free API access.
Paid features and costs
Grok API requests are billed by tokens for the chosen model. Web/X search and voice message recognition through Speech-to-Text have separate pricing; image and video generation are separate API costs.
Access and limitations
The CLI code is available under MIT without a license fee. This is not a free Grok API: requests require a key and separate API terms. A consumer Grok subscription must not be treated as a promise of free API access. Grok API requests are billed by tokens for the chosen model. Web/X search and voice message recognition through Speech-to-Text have separate pricing; image and video generation are separate API costs.
Use cases
- Perform a coding task through the Grok API
- Obtain structured output from a headless task
Example workflow
A possible workflow; this is not a report of hands-on testing.
Example workflow with superagent-ai/grok-cli: Perform a coding task through the Grok API.
Before you start
- A repository, a description of one change, and a reproducible example of the expected behavior.
- Project context: affected files, constraints, and the established validation method.
Steps
- For the task “Perform a coding task through the Grok API”: open the relevant project and let the agent inspect the affected implementation before making changes.
- Set a bounded task with completion criteria; review the proposed changes and how they address the requirement.
- Run the appropriate project checks and compare behavior before and after the change.
Check your result
- The change solves the stated task and does not touch unrelated files unnecessarily.
- Investigate check failures; review generated code, configuration, and data access permissions.
Choosing superagent-ai/grok-cli
Perform a coding task through the Grok API
Choose this when
- Perform a coding task through the Grok API
- Obtain structured output from a headless task
Consider alternatives when
- When choosing for this topic, compare superagent-ai/grok-cli with Gemini CLI. A candidate to compare under the topic: Terminal agents, Command line. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- When choosing for this topic, compare superagent-ai/grok-cli with OpenAI Codex CLI. A candidate to compare under the topic: Terminal agents, Command line. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
Requirements
- A Grok API key; interactive OpenTUI requires a modern terminal emulator. The alternative bun add -g grok-dev installation requires Bun in PATH; the published installer includes Bun. package.json separately declares Node>=18.
Things to consider
- Costs and limits of free use: Grok API requests are billed by tokens for the chosen model. Web/X search and voice message recognition through Speech-to-Text have separate pricing; image and video generation are separate API costs.
- Terms of use: MIT for the CLI code: use, modification, and distribution are permitted with copyright and permission notices retained. Code has no warranties; this license does not transfer Grok rights or API access.
- An unofficial project, explicitly unaffiliated with xAI.
- Desktop computer automation in the README is tied to macOS; this capability must not be promised on Windows.
- The built-in computer sub-agent currently targets macOS.
- A possible workflow: assign a bounded task through --prompt, save the JSON events for analysis, review the diff, and run the project's tests. An agent's output alone does not prove that a change is correct.
Frequently asked questions
What can you use for free in superagent-ai/grok-cli?
The CLI code is available under MIT without a license fee. This is not a free Grok API: requests require a key and separate API terms. A consumer Grok subscription must not be treated as a promise of free API access.
What additional costs might arise with superagent-ai/grok-cli?
Grok API requests are billed by tokens for the chosen model. Web/X search and voice message recognition through Speech-to-Text have separate pricing; image and video generation are separate API costs.
What terms of use matter for superagent-ai/grok-cli?
MIT for the CLI code: use, modification, and distribution are permitted with copyright and permission notices retained. Code has no warranties; this license does not transfer Grok rights or API access.
How do you get started with superagent-ai/grok-cli?
For the task “Perform a coding task through the Grok API”: open the relevant project and let the agent inspect the affected implementation before making changes. Set a bounded task with completion criteria; review the proposed changes and how they address the requirement. Run the appropriate project checks and compare behavior before and after the change.
How can Grok CLI run without an interactive interface?
Headless --prompt performs one task and exits; --format json emits a stream of newline-delimited JSON events. This path does not require terminal UI support. These are step_start/text/tool_use/step_finish/error events, not a promise of one complete JSON object. --session latest or -s <session-id> resumes a saved session.
What is needed to control the desktop?
The computer sub-agent in the current README targets macOS and requires Accessibility permission for the terminal. This capability cannot be assumed to work on Windows by analogy.
How are project rules, skills, and MCP connected?
AGENTS.md files are collected from the Git root to the current directory; AGENTS.override.md takes precedence within its directory. Skills are read from the project's .agents/skills/<name>/SKILL.md or ~/.agents/skills; MCP servers are configured in .grok/settings.json through mcpServers or in /mcps.
What is needed for control through Telegram?
A bot token and approval of the pairing code in the terminal are required. Long polling runs inside the active CLI process, which must remain running; a headless telegram-bridge is also described. Voice messages are sent to the Grok Speech-to-Text API before the text is passed to the agent.
Which systems support the built-in sandbox?
The documented Shuru microVM sandbox requires macOS 14+ on Apple Silicon. It is enabled with --sandbox or /sandbox; networking is disabled by default. Availability of the ordinary CLI on another OS does not imply availability of this sandbox.
Related tasks and approaches
- Gemini CLI
A candidate to compare under the topic: Terminal agents, Command line. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- OpenAI Codex CLI
A candidate to compare under the topic: Terminal agents, Command line. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- OpenCode
A candidate to compare under the topic: Terminal agents, Command line. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
License
MIT for the CLI code: use, modification, and distribution are permitted with copyright and permission notices retained. Code has no warranties; this license does not transfer Grok rights or API access.
MIT — permissive license
You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.
License termsUsage details
An unofficial project, explicitly unaffiliated with xAI. README desktop computer automation is tied to macOS; do not promise that capability on Windows.
Technologies and topics
- CLI