Grok Build CLI: IDE Integration with ACP
Grok is not only a terminal app. It speaks the Agent Client Protocol, an open JSON-RPC standard for AI agents, so it can run inside your editor with full session management, streamed thoughts, live tool visibility, and interactive permissions. If you would rather drive Grok from Zed or Neovim than a terminal, this is how.
New to Grok? Start at Grok Build CLI: Zero to Hero (Start Here).
Run Grok as an agent
The primary integration is stdio: Grok communicates over stdin and stdout in JSON-RPC. There is also a server mode for sharing one agent process across multiple clients over HTTP or WebSocket.
What ACP gives a client
Unlike headless mode, which runs one prompt and exits, agent mode keeps a persistent process and streams structured events. A client gets separate update types for response text, thinking tokens, tool calls, and plan entries, which is how editors render rich panels for thoughts and tool activity instead of a wall of text.
The protocol lifecycle is simple: initialize, create a session with a working directory, send prompts, receive streamed updates, and handle permission requests interactively.
Beyond the base protocol
Grok layers xAI-specific extension methods under an x.ai/ prefix for filesystem access, git and worktree operations, fuzzy search, terminal control, code navigation, session forking, and history rewind. There are dozens of them, which is what lets an editor offer deep integration rather than a chat box.
Compatible editors
ACP support is already shipping in real tools. Zed, Neovim (via CodeCompanion and avante.nvim), Emacs, and marimo notebooks all connect today, with JetBrains on the way. Official SDKs exist for TypeScript, Rust, Python, Go, and Kotlin if you want to build your own client.
If browsers cannot spawn local processes in your setup, run a WebSocket relay and have Grok connect out to it, which is how you build a web UI on top of the agent.
Continue the series
The full series
- Grok Build CLI: Zero to Hero (Start Here)
- Grok Build CLI: Sessions, Rewind and Compaction
- Grok Build CLI: Slash Commands and Keyboard Mastery
- Grok Build CLI: Teaching Grok Your Project (AGENTS.md)
- Grok Build CLI: Models and Custom Endpoints
- Grok Build CLI: Extending Grok with MCP, Skills, Plugins and Hooks
- Grok Build CLI: Cross-Session Memory
- Grok Build CLI: Subagents, Plan Mode and Background Work
- Grok Build CLI: Headless Mode and Automation
- Grok Build CLI: Sandbox and Permissions
- Grok Build CLI: IDE Integration with ACP (you are here)
- Grok Build CLI: The Evolution (Power-User Version History)