Skip to content
项目

关于

Design real interfaces with your own AI agents

人工智能与机器学习

这些数字如何统计

实测星标增长

24小时
0
7天
正在收集历史
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Gui

Gui is a Mac and Linux app for designing real interfaces with the AI coding agent you already use. It runs your project's dev server and shows your app. Point at an element, or drag around an area, and say what to change. Your agent edits your actual code, and the preview updates as it does.

Gui showing a website in its preview, with the chat panel open and Claude Code as the agent

Download for Mac (Apple silicon, brew install --cask brijr/gui/gui) or Linux (curl -fsSL https://usegui.com/install.sh | sh) · usegui.com · alpha

What it does

  • Point at what to change. In design mode (⌘D), click elements or drag around an area. Each pick lands as a numbered marker in your message with a screenshot, its HTML and styles, and the source file and line it came from. Double-click text in design mode to edit it in place, or ask for variations to flip through real-code versions right in the preview.
  • Your agent, your code. Gui doesn't include a model. It drives the agent on your computer with your login and your plan, and the agent edits files in your project. You can also turn on Gui's local MCP server in Settings so Claude Code, Codex, or Cursor running in your terminal or editor can use Gui's preview and canvases too.
  • Undo any turn. Gui snapshots your files before and after every turn, so you can undo one, or go back to any earlier message. Your .git is never touched.
  • Every screen size. Desktop fills the window; Laptop, Tablet and Mobile show your app at exactly their size, with optional rulers and snapping guides (⇧R) the agent can read and check alignment against. The agent knows which one you're looking at.
  • iPhone and Expo. On macOS 14+ with Xcode, Gui runs a built-in headless iPhone simulator for web apps in Safari and Expo (SDK 54+) apps in Expo Go, with click-to-source view picking and a Mobile app starter. Agents can switch to the phone (preview_device), see its screen, tap, swipe, and type.
  • The agent can see. Agents get tools to screenshot, inspect, click and type in the same preview you're looking at, and to play an animation and watch it frame by frame, so they check their own work.
  • Canvases. Start without a project: ask for a page, or a few versions of one, and compare them side by side on a board, or keep a canvas folder inside a git repo.
  • The rest of a dev setup. Tabs per project, a floating or docked chat panel (and draggable collapsed bubble), the dev server's logs, your own shell in a terminal, screen recordings (with on-device voice narration on macOS 26+), and reference images you paste or drop into the chat.

Using Gui covers every feature and shortcut.

Agents

Gui speaks the Agent Client Protocol and reuses each agent's own login.

Agent How Gui runs it Sign in
Claude Code Bundled adapter. Uses your claude (2.1.296+), or installs the version it needs From Gui
Codex Bundled adapter. Uses your codex (0.164.0+), or installs the version it needs From Gui
Grok Build grok agent stdio grok login
Kiro kiro-cli acp kiro-cli login
OpenCode opencode acp opencode auth login
Pi Your pi 0.81+, through the bundled pi-acp adapter pi, then /login
Muse Code muse acp --trust-workspace (Muse 1.4.23+) muse login
Amp Your amp, through the bundled amp-acp adapter amp login
Devin devin acp devin auth login
Cursor cursor-agent acp, or agent acp when that command is Cursor's cursor-agent login
fx fx acp fx login
jcode jcode acp jcode, which runs its setup
Antigravity CLI agy acp --process-per-session (agy 1.5.0+) agy acp --login

Gui runs the agents it finds on your PATH, and offers a Sign in button that runs the login for you. Any other ACP agent can be added in Settings → Agents.

Build from source

You need macOS 13+ (Apple silicon), Bun 1.4+, git (Xcode Command Line Tools) and at least one agent from the table. Projects that need Node.js (or a newer Node.js than your computer has) can run on Gui's own Node.js without changing your system install.

git clone https://github.com/brijr/gui.git
cd gui
bun install
bun run dev

To install your build as /Applications/Gui.app, with the gui terminal command that opens a folder in it, run bun run install-app. Packaging needs Xcode 26+; iPhone and Expo previews need macOS 14+, Xcode, and an iOS Simulator runtime. Builds from source don't ask for a Gui account, don't take updates from usegui.com, and never send crash reports or usage data; only official releases do.

Linux

To install the official Linux build, run curl -fsSL https://usegui.com/install.sh | sh. It installs the AppImage for x64 or arm64 to ~/.local/share/gui and adds Gui to your app launcher. The AppImage (self-updating) and a .deb are also at usegui.com/download/linux. Official builds store your Gui sign-in in your desktop's keyring (gnome-keyring + libsecret, KeePassXC with Secret Service, or KWallet) and won't save it without one.

To build it from source, you need Bun 1.4+, git, and a C++ toolchain (gcc, g++, make, python3) to compile node-pty. Run bun install and bun run dev as above. To package Gui yourself, run bun run dist:linux. It writes an AppImage and a .deb to release/. The .deb build needs libxcrypt-compat on Fedora. In Gui, use Gui → 'gui' Command → Install 'gui' Command… to add the gui command to ~/.local/bin.

iPhone and Expo previews and narrated recording transcription are macOS-only.

Connecting GitHub to clone your repositories needs the account service in accounts/. Cloning by address works without it. See account service setup.

Development

Command What it does
bun run dev The app with hot reload
bun run check Type checks, lint, architecture rules, fast tests and the account service's tests. Run it before every pull request
bun run test:e2e End-to-end tests against real dev servers. Agent turns run only with GUI_E2E_AGENT=<agent id>, since they use your real usage
bun run test:fast Lifecycle, IPC, persistence and chat checks without launching Electron
bun run build Production bundle in out/
bun run dist Packaged macOS app in release/ (bun run dist:linux for Linux; packaging and releases)

The code is in four parts: the Electron main process in src/main, preloads in src/preload, the UI in src/renderer, and shared types in src/shared. The macOS transcription helper is in native/, the website is www/, and the account service is accounts/. How Gui works explains each part, and AGENTS.md has the rules the code keeps.

Security model

The preview runs your app plus whatever third-party scripts it loads, so it is treated as semi-trusted. It never gets the preload Gui's own UI uses, and Gui's own messages are accepted from the window or tab page that sent them, which a preview is not. Its session denies permission requests (camera, clipboard reads, devices, external protocols) by default, and element picking only works on local origins.

The preview has a small preload of its own (src/preload/preview.ts), for editing text in place and for the rulers. It runs in an isolated world and exposes nothing to the page: no contextBridge API and no globals, so page scripts can't call it or read what it sends. It listens to main and to the page's events, and sends main four messages: the text of the element where design mode was double-clicked, when it holds only text (main sends the point; the page's own double-clicks never start an edit), to start an edit; how that edit ended (the new text, or nothing); how far the page is scrolled, so guides stay with the content; and ⇧R pressed outside anything that takes typing, to show or hide the rulers. An edit starts only from main, after a double-click in design mode's overlay (Gui's own view over the page, which the page can't reach), and the rulers switch only on a real key press (isTrusted), not on events a script dispatched. Main takes these messages only from the top frame of a view that a tab owns as its preview, and checks the arguments: finite numbers, and text of at most 4,000 characters. An edit starts only in an open project or canvas frame, on a local address, at the point main just asked about, one at a time, and its end must carry the id main issued. Main finds the element itself through the DevTools protocol. The rest comes from the page, and its scripts can change all of it: the old text, the new text, and which file wrote the element (React's debug data, or Astro's source attributes). So main trusts none of it. A rewrite it makes is a turn of its own in the chat, checkpointed before and after like the agent's, so Undo puts the file back. It rewrites the file itself only to swap plain text for plain text: the file must be JSX, Astro or HTML; the old text must be all that one element holds there, between its own opening and closing tags and not in a <script> or <style>; and neither text may hold anything that isn't literal wherever markup can sit (<, >, braces, backslashes, character references, percent escapes, a comment's end, control characters, or a quote that could close a string or attribute the markup is inside). String literals, attribute values, code that happens to read the same, and every other file in the project are left alone, so a rewrite can change the wording of one element and nothing else. Any other edit goes to the agent, and not as your words: the message is Gui's own fixed text ("Change this text."), and the old and new text travel in a <text_edit_…> block, one line each, fenced and marked as untrusted the same as selected-element context. They stay apart from a queued message's text, also when you edit it.

The terminals are your own shell, started only when you open one, at the project root; nothing the project defines runs in them on its own (your shell's startup files run as they do in Terminal, so tools hooked into them, like direnv, react to the folder as usual). Only the window's own UI can type into them.

Agents get Gui's preview tools over a loopback MCP server that needs a token made for each project opening and rejects other Host headers. The page tools act on your app at its local address, or on a public website the agent opens (preview_open_website; in a canvas, canvas_screenshot_url), which asks first in Ask mode. Agents whose own settings decide what they ask (Amp, fx, Kiro, OpenCode, Pi) aren't offered preview_open_website, since Gui can't make them ask first. A website loads in a view with no preload, in a separate signed-out session that is kept in memory and wiped when it closes: public addresses only, with no permissions, downloads or form posts. Everything they return from the page or dev server (element data, console, logs) is fenced and marked as untrusted, the same as selected-element context. Claude's preview tools are pre-allowed by exact name, except the two that open websites (which carry a Claude ask rule so Ask mode leaves them to you); nothing is auto-approved by matching a tool's title. Chat history is stored owner-only (0600), without URL query strings.

Optional access for outside agents (Settings → Agents → Let other agents use Gui, off by default) runs a separate loopback-only MCP server (127.0.0.1:29417) behind a rotatable owner-only (0600) bearer token and rejects other Host headers. It exposes an explicit allow-list of preview, canvas and selection tools and leaves out shell-command, dev-server-control, website-opening and chat tools; opening a folder Gui hasn't opened before asks you in Gui first. On macOS, the iPhone simulator's screen and touch helper runs in an isolated utility process that communicates over a parent port rather than opening a network port, and Expo Go downloads come only from a strict HTTPS allow-list of Expo's release hosts with no user or project data sent, verified for size, archive entries and bundle ID before unpacking.

Auto (on by default, per project) answers every permission request from the agent with a one-time approval (never "always allow", so Gui makes no lasting grants in the agent's own settings): commands, fetches, reads and edits anywhere, sensitive files, opening websites, and anything the agent flags. It still leaves to you the agent's own questions, Claude Code's plan approvals (switch_mode), requests with no one-time approval option, and Gui's own prompts before changing how your app starts (set_start_command) or running changed start scripts. Commands aren't sandboxed. In Ask (⇧⌘A), Gui approves edits to ordinary source files inside the project and asks you in the chat about everything else: commands, files outside the project, sensitive files (build, tool and deploy config, dotfiles, dependency manifests and lockfiles, scripts, Dockerfiles, git hooks), opening websites, and anything the agent itself flags.

Not yet

Windows, Android emulator, drawing on a picked area, quick direct-manipulation tweaks, Vue/Svelte source mapping, exact Next.js webpack mapping, and parallel variations.

Contributing

Issues and pull requests are welcome. Run bun run check before you open one. Report security issues privately, as SECURITY.md describes.

License

Apache License 2.0. The Gui name and logo aren't covered by the license; please don't use them for a fork. Agent logos belong to their owners.

探索相关项目

加载中…