Repository avatar
Other Tools
v0.7.0
active

gpui-agentation

io.github.emmanuel-defreitas/gpui-agentation

Read and manage development annotations from a local GPUI app.

Documentation

Contributors Forks Stargazers Issues MIT License


gpui-agentation logo

gpui-agentation

🎯 Point at a running GPUI app, leave a note, and your coding agent gets the element, its bounds, and its Rust source location.
Explore the docs »

View Demo · Report Bug · Request Feature

Version: 0.7.0. Debug builds only — release builds expose no annotation API. macOS is the only supported native platform. Pinned to gpui-pre =0.3.14.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Try the Example
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgments

About The Project

gpui-agentation dashboard demo

Agentation annotates web pages through the DOM. A native GPUI window has no DOM, so gpui-agentation registers screens (and optional finer targets) with an ID, label, bounds, and Rust call site, then attaches your note to that.

Use it when you would otherwise describe a UI bug to your agent in words or paste a screenshot. Notes persist to a local JSON file, carry a status (pending, acknowledged, resolved, dismissed) and a reply thread, and an agent reads them over a loopback MCP server or REST/SSE.

It is a development tool. It annotates registered targets, not arbitrary pixels (by default, the whole screen), and release builds do not include it. For production telemetry or session replay, use something else.

(back to top)

Built With

Rust GPUI MCP

(back to top)

Getting Started

Add gpui-agentation to your own GPUI app in three steps: install the crate, initialize once at launch, then mount and wrap your screen.

Prerequisites

  • macOS with Xcode command-line tools
  • Rust via rustup (the repository pins the toolchain)

GPUI Kit comes from crates.io. Follow the setup guide to share the pinned Kit version with your host.

Installation

  1. Add the crate with the native feature set:

    cargo add gpui-agentation --no-default-features --features native
    
  2. The crate does not exist in release builds, so every call sits behind #[cfg(debug_assertions)] and release returns your content unchanged:

    // Launch: serve Agentation's assets, then initialize.
    let app = gpui::application();
    #[cfg(debug_assertions)]
    let app = app.with_assets(gpui_agentation::Assets);
    #[cfg(not(debug_assertions))]
    let app = app.with_assets(gpui::assets::Assets);
    app.run(|cx| {
        #[cfg(debug_assertions)]
        gpui_agentation::init(cx).expect("initialize Agentation");
        #[cfg(not(debug_assertions))]
        gpui::init(cx);
        // ...open your window
    });
    
    // Window setup: app name, route, notes file, local port. Keep `feedback`
    // in a field of your root view that carries the same cfg.
    #[cfg(debug_assertions)]
    let feedback = gpui_agentation::Agentation::mount(
        "My app", "gpui://my-app/home", "target/agentation/feedback.json", 4748, window, cx,
    )?;
    
    // Render: wrap the screen in debug builds; release keeps `content` as is.
    #[cfg(debug_assertions)]
    let content = self.feedback.root("home", "Home screen", content, window, cx);
    content
    
  3. Add target(id, label, child) only where you want finer inspection. Ordinary controls need no wrappers. Use a Kit Root for the host window. Agentation owns its tool windows; an existing Kit host uses explicit initialization and inspector ownership options described in the setup guide.

Want your agent to do this for you? Use the setup skill.

More:

(back to top)

Usage

Inspect and annotate

The toolbar is its own window, docked to the right edge of your app. It follows your app when you move or resize it.

ToolWhat it does
InspectPick an element. Saves its source and properties as a numbered note.
Box, Arrow, PenDraw on the live window.
CommentDrop a numbered pin with a note.
TextboxClick or drag out a frame, then type plain text on the canvas.

Drawing tools need the Annotation mode switch on. Inspect does not. With annotation mode on, right-click the canvas to open the same tools and edits as a context menu.

Inspect an element

  1. Click Inspect, then click an element.
  2. Optional: change width, height, padding, margin, border, or opacity with the sliders, and the surface or text color with the swatches.
  3. Click the numbered pin to add a comment.
  4. Click Stop in the Inspector header, or Stop inspecting in the toolbar, to leave Inspect.

The inspector panel opens in the toolbar window, which grows to hold it; your app's window keeps its size and layout. See External inspector for how that works on stock GPUI and when the panel falls back to the app window.

Press Esc or click elsewhere to pick another element.

Inspecting a registered element

Your agent gets the comment, the property snapshot, and any style changes with suggested Rust builder calls. Click the last breadcrumb segment to open the source line in $EDITOR (Zed by default; VS Code, Cursor, and VSCodium work too). Other editors copy the path instead.

Draw

Point your agent at the exact spot with an arrow, box, or pen stroke.

Drawing an annotation arrow

Shortcuts (annotation mode on)

KeysAction
I B A P C TPick a tool
Ctrl/Cmd+SSave the draft
Ctrl/Cmd+Z, Ctrl/Cmd+Shift+ZUndo, redo
DeleteRemove the selected note

Pins, textboxes, mentions

  • Drag a pin to move it, separately from its drawing.
  • Textbox: drag with the tool to frame a box, or click for one that fits its text. Click to select, drag to move, pull a grip on the dashed bounding box to resize, Enter or double-click to edit. Save, Ctrl/Cmd+S, or clicking away saves; Cancel or Esc discards the edit. Text selection works normally while editing.
  • In a comment, type @ to pick a note or #12 to preview pin 12. Enter or Tab inserts @#12. Esc closes the list.
  • Right-click a note for Edit, Delete, and Color.

Toolbar, menus, Settings

  • Comments, Settings, and Close sit at the bottom of the toolbar.
  • Close hides it. Debug → Show Toolbar brings it back.
  • Add gpui_agentation::debug_menu() to cx.set_menus(...) to get the Debug menu.
  • Settings opens from the macOS menu-bar icon or ⌘⌥S.

Capture feedback

Write a comment and save it. Open Comments → Copy to copy your feedback as Markdown, ready to paste to your agent.

Copying comments as Markdown

Connect your agent

  1. Keep the debug app running.
  2. Open Settings → MCP and turn the server on.
  3. Copy the config into your MCP client.

The endpoint runs on loopback. Clients that require stdio can use the MCP bridge.

  • MCP Registry name: mcp-name: io.github.emmanuel-defreitas/gpui-agentation

For more examples, please refer to the Reference.

Agent skills

Two skills help your agent set up Agentation and work through feedback. Install them from skills.sh (needs Node.js 22.20+).

SkillUse it toTry
gpui-agentation-setupAdd Agentation to a GPUI app."Use gpui-agentation-setup to add development annotations to this app."
gpui-agentation-exploreRead your app's feedback over MCP and act on it."Use gpui-agentation-explore to summarize pending feedback without changing notes."
  1. From your app's folder, run:

    npx skills add emmanuel-defreitas/gpui-agentation
    
  2. Pick the skills and agents when asked.

  3. Start a new conversation, then run /gpui-agentation-setup or /gpui-agentation-explore, or paste a prompt above.

Options:

  • One skill only: add --skill gpui-agentation-setup.
  • Every project: add -g.
  • Update later: npx skills update.

Skills are instructions only. explore also needs your debug app running with Settings → MCP on. See Connect your agent.

(back to top)

Try the Example

Clone the repository and run the example app:

git clone https://github.com/emmanuel-defreitas/gpui-agentation
cd gpui-agentation
make example
  1. Choose Inspect, Box, Arrow, or Pen.
  2. Select an element or draw, then write a comment and save.
  3. Open Comments → Copy to copy your feedback as Markdown.

See the example app for the full integration.

(back to top)

Roadmap

  • Inspect, Box, Arrow, and Pen annotation tools
  • Loopback MCP server plus REST/SSE access
  • Add text annotation tool
  • Update Comment annotation UX
  • Add gpui-devtools features from joris-gallot/gpui-devtools
  • Extends AI features from hexuria/gpui-agent
  • Stabilize the API toward 1.0
  • Port MCP tools to a standalone macOS companion app

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are welcome. Read CONTRIBUTING.md for the workflow, checks, and release steps.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Emmanuel De Freitas — @emmanuel-defreitas

Project Link: https://github.com/emmanuel-defreitas/gpui-agentation

(back to top)

Acknowledgments

(back to top)

CARGO
gpui-agentation
Install Command
cargo install gpui-agentation