今日已更新 84 条资讯 | 累计 29818 条内容
关于我们

Building a desktop client for an AI coding agent

King Wan 2026年07月26日 05:15 7 次阅读 来源:Dev.to

Lessons from wrapping grok-build — the architecture, the traps, and why we picked Tauri over Electron. TL;DR grok-build is xAI's open-source Rust coding agent. It ships as a TUI. We wrote a native desktop client for it — Tauri 2 (~8 MB binary), React frontend, Rust runtime that spawns the CLI as a child process and talks to it over ACP/JSON-RPC 2.0. This post is the architecture deep-dive: how the pieces fit together, what surprised us, and the parts we'd build differently next time. The full source is at github.com/timexingxin/grok-gui . MIT-licensed. Demo GIF in the README. The problem grok-build is genuinely good at code work — comparable to Claude Code for my workflow. But it ships as a Rust TUI. After six months of cmd+tab between the terminal and my browser tabs, I wanted a real desktop UX without losing what makes the CLI good. The naive options all had problems: Wrap it as a tmux session in a webview. Doesn't help — you're still reading scrollback. Use a community-built web wrapper. They all wrap the OpenAI Chat Completions API directly. They don't talk to the actual agent runtime, so they miss tool calls, plan updates, permission requests, and the streaming event surface that makes coding agents feel responsive. Write a desktop GUI from scratch. Means re-implementing the agent loop, the model integration, the tool calling. Six months of work, plus the resulting client would always lag the upstream. The right answer was staring at me: grok-build already has a JSON-RPC 2.0 over stdio interface called the Agent Client Protocol (ACP). That's the protocol I should be a client of. My job is just to write the client. What is ACP? ACP is a JSON-RPC 2.0 protocol that coding-agent CLIs expose over their stdin/stdout. The agent emits notifications (text deltas, tool calls, plan updates, permission requests, session lifecycle); the client sends requests (user prompts, permission responses, model switches, session loads). If your agent speaks ACP, you can write a client

本文内容来源于互联网,版权归原作者所有
查看原文