banner.png

monkeybyte: A Native GTK4 AI Code Editor in C++23

Last week I wrote about icarus (a CLI) and daedalus (a library). The third project in Lee Stripp's stack is the one those two were quietly building toward: monkeybyte, a native desktop AI code editor in C++23 with GTK4 / gtkmm — a GTK4 port of a previously browser-based UI, with daedalus sitting under the chat panel doing the actual work.

It looks like VS Code and behaves like VS Code, but it ships as a single monkeybyte binary that links against GTK4, gtksourceview-5, webkitgtk-6, libcurl, sqlite3, libmd4c, and the daedalus agent library. No Electron runtime. No Node. No 200 MB unpacked node_modules. The install.sh puts everything in ~/.local, no sudo.

The repo is at gitlab.com/leestripp/monkeybyte. MIT-licensed, created 24 July 2026, no tagged releases yet — the version string (daedalus-monkeybyte/<version>) is derived from the latest git tag at configure time, with the CMake project version as a fallback. The 89 KB docs/design.md is the canonical source of truth and explicitly says: "Treat it as the source of truth."

The IDE Shell

The layout is exactly what you'd expect from a VS Code / Cursor descendant, and the design doc is unusually honest about copying the web version's choices 1:1:

  • Activity Bar — a 48 px wide vertical rail of four 40×40 icon buttons (Workspace, Search, Git, Settings). It's the only navigation control that switches which sidebar panel is visible. A 2 px "active rail" on the left of the active icon lights up in --accent (#89b4fa, Catppuccin blue).
  • Sidebar — 260 px wide, resizable 150–500 px, holds four stacked panels (Workspace Explorer, Search, Source Control, Settings). Only one is visible at a time. When Settings is the active panel the editor and chat hide and the sidebar takes 100% of the client width — same trick the web app uses with body.settings-active.
  • Editor — tabbed, with gtksourceview-5 for the CodeMirror-equivalent widget. Tabs live inside the editor area; there are no OS-level document tabs.
  • Chat Panel — docked right, real GtkGestureDrag resizer between editor and chat. The 6 px wide resizer turns accent on hover/active drag, with a 24 px grip glyph drawn vertically centered.
  • Status Bar — 24 px, uses --accent directly as its background (not --bg-tertiary, which is the more obvious choice). Branch info on the left, model + tokens on the right.

Two real GtkGestureDrag widgets sit between sidebar | main and main | chat_panel. The geometry-persist-on-gesture-end rule is in the design doc: widths are committed to GSettings only when the drag finishes, not per-pixel. The default sizes are 1100×720, but the window is resizable and remembers its size.

The Backend Stays Put

This is the bit I want to underline, because it's the architectural decision the whole project rests on.

"GTK4 is a replacement for the browser-based UI, not the agent engine. Backend to keep = C++ HTTP server (OmniNet) + daedalus agent + SQLite settings + SettingsStore + McpClient — unchanged." — docs/design.md, section 1.

What that means in practice:

  • The chat panel drives a daedalus::Agent exactly the way icarus does. The MonkeybyteSink translates daedalus callbacks (on_assistant_delta, on_tool_call, on_tool_result, on_state_change, on_error) into the SSE event vocabulary the web app already uses: turn_start, state, text, tool_start, tool_progress, tool_done, log, error.
  • Storage is split between two SQLite databases: monkeybyte.db at $XDG_DATA_HOME/monkeybyte/ for interface settings (workspace, system prompts, per-model prompt bindings), and daedalus's daedalus.db for providers, models, MCP servers, kv settings, agent tuning. The skill and tool enablement is host policy — daedalus doesn't persist disabled lists, so monkeybyte stores agent.disabled_skills and agent.disabled_tools in its own DB and seeds AgentConfig on every agent build.
  • GSettings (io.github.monkeybyte.*) is used only as a UI cache (window/sidebar/chat widths, theme name, selected model, chat history blob). The window/sidebar/chat geometry is authoritative in the monkeybyte.db kv table, because dconf doesn't always persist in containerised environments (foreign session bus, etc.).
  • LLM providers are configured via an OpenAI-compatible chat API — base URL + endpoint + model name + API key per provider. The agent identifies itself as daedalus-monkeybyte/<version> to the LLM, where <version> comes from the latest git tag at CMake configure time.

The Backend Contract

Section 10 of the design doc lists the 31 /api/* endpoints the GTK front-end must keep talking to. The HTTP server (OmniNet, on 127.0.0.1:17878 by default, overridable via MONKEYBYTE_CONTROL_PORT) is the spine, and the GTK port is one of two valid front-ends. The other is the existing browser app. Both consume the same JSON shapes and SSE event vocabulary.

A few examples:

Method Path Purpose
GET /api/workspace Return current workspace + home/user info
POST /api/workspace Set workspace (must POST /api/chat/cancel first if a session is in flight — strict requirement)
GET /api/files/<path> List directory or read file (5 MB size limit)
GET /api/search?q=... Search workspace files
POST /api/chat/start Start a new streaming chat session
GET /api/chat/stream?session=... SSE event stream
GET /api/settings/models List models (referencing providers by name)
DELETE /api/settings/providers/<name> Remove provider — cascades to its models

The list runs the full lifecycle: workspace switching (with the mandatory chat cancel), file CRUD, Git status, chat streaming, settings CRUD across interface/providers/models/MCP/system-prompts.

Why the Backend Is GTK-Free

This is the other load-bearing decision in the project, and AGENTS.md is explicit about it:

"Keep backend/, tree/, and http/ (except ControlServer's OmniNet dependency) free of GTK. Includes so they stay unit-testable without a main loop — that separation is what tests/test_main.cpp relies on."

So FileService, SearchService, SettingsStore, WorkspaceTree, Markdown, MarkdownToHtml, the McpBridge, ModelBridge, SkillDiscovery and UserCommands registry all compile without GTK and are tested without a main loop. UI behaviour is exercised through the ControlServer HTTP endpoint + UiControl command surface — you can drive geometry, sizer positions, panel switching, and file uploads over HTTP instead of synthesising X events.

The unit-test file tests/test_main.cpp is a hand-rolled, assert-based runner — no doctest, no gtest, no Google Mock. Just a tiny check(cond, "name") helper. There are 16 suites:

test_file_service, test_settings_store, test_mcp_bridge, test_mcp_json_import, test_model_bridge (+ migration + thinking_levels), test_skill_discovery, test_workspace_tree_logic, test_search_service, test_markdown, test_markdown_to_html, test_user_commands, test_html_to_text, test_web_search_parse.

ctest --output-on-failure runs the 16 monkeybyte suites. (daedalus is fetched with EXCLUDE_FROM_ALL and DAEDALUS_BUILD_TESTS=OFF, so the default ctest run is monkeybyte-only.)

Theming: Catppuccin, System-Aware

Theming is a real subsystem in its own right. Two named colour schemes ship as CSS files: Catppuccin Mocha (dark, default) and Catppuccin Latte (light). The ThemeManager swaps providers via GtkStyleContext::add_provider_for_display at GTK_STYLE_PROVIDER_PRIORITY_APPLICATION. The web app's :root CSS variables map 1:1 to a 13-token palette:

--bg-primary, --bg-secondary, --bg-tertiary, --bg-hover, --bg-active, --bg-input, --text-primary, --text-secondary, --text-muted, --border, --accent, --error.

The default system theme setting follows a fallback chain that re-applies live: first the xdg-desktop-portal org.freedesktop.appearance color-scheme key (uint: 1 = dark, 2 = light, 0 = no preference), then the GNOME org.gnome.desktop.interface color-scheme enum (prefer-dark / prefer-light / default), then dark. signal_changed is wired on whichever schema is present so the app re-themes when the user toggles the system preference.

The accent colour is #89b4fa (catppuccin blue) — used for the active icon rail, selection underlines, primary button background, focus rings, and the status bar background (intentionally the one place where --bg-tertiary is not used).

Monospace fonts: Fira Code and Consolas.

Build & Install

System deps on Ubuntu (Debian-similar elsewhere):

sudo apt install -y \
    cmake ninja-build g++ \
    libgtkmm-4.0-dev libgtksourceview-5-dev \
    libwebkitgtk-6.0-dev libcurl4-gnutls-dev \
    libsqlite3-dev libmd4c-dev nlohmann-json3-dev

The first configure fetches daedalus (tag main, demos/tests off, embedded dependency) which in turn pulls OmniNet. nlohmann_json ≥ 3.11 is required (system package preferred, but CMake FetchContent falls back to GitHub v3.11.3 with GIT_SHALLOW TRUE).

cmake -B build -G Ninja
cmake --build build
./run.sh                       # exports GSETTINGS_SCHEMA_DIR for the dev build
ctest --test-dir build --output-on-failure

The default build type is Debug. Static analysis is available via cppcheck (auto-detected):

cmake --build build --target monkeybyte_cppcheck

To install to your user tree (no sudo):

./install.sh                   # installs to ~/.local
# or:
./install.sh /some/prefix      # custom prefix

The installer puts bin/monkeybyte in your prefix, copies data/ (Catppuccin CSS + io.github.monkeybyte.gschema.xml + symbolic SVG icons) to share/monkeybyte/data/, compiles the GSettings schema to share/glib-2.0/schemas/, drops a .desktop launcher in share/applications/, and the monkey-head icon in share/icons/hicolor/scalable/apps/. Under the ~/.local prefix GSettings finds the schema automatically via XDG data dirs, so the installed binary runs from anywhere — ~/.local/bin/monkeybyte just works.

⚠️ Running ./build/monkeybyte directly without GSETTINGS_SCHEMA_DIR aborts with "Settings schema 'io.github.monkeybyte.' is not installed"*. That's the design — run.sh exports the env var pointing at build/gschemas/.

Things Deliberately Not Built

Section 16 of the design doc lists what to skip from the web app:

  • WebSocket support — future, the GTK port doesn't need a browser; SSE or polling is fine.
  • Git staging/commit UI — the web app's Git panel was read-only; the agent has git_* tools.
  • Multi-window — one top-level window.
  • Drag-to-reorder tabs, diff viewer, drag-and-drop file upload, notifications, collaboration/multi-user — none of these were in the web app, so don't add them in the GTK port.

That list is itself interesting. It's not a roadmap gap; it's a deliberate scope statement that says "don't gold-plate what the source app didn't have." More projects should write that document.

Caveats

The project is nine days old as of writing. No tagged release yet — the user-agent string is whatever git describe says. The docs/design.md and AGENTS.md are well above average for a project this young, and the source tree is already large: about a hundred files under src/monkeybyte/ — 12 GTK-free backend services (FileService, GitService, HtmlToText, Logger, MarkdownToHtml, McpBridge, ModelBridge, SearchService, SettingsStore, SkillDiscovery, WebFetch, WebSearch), a GTK-ful ui/ layer with 8 top-level widgets (MainWindow, Sidebar, EditorArea, ActivityBar, StatusBar, HtmlView, UiControl, FileIcons), plus a 9-component chat/ subsystem, 9 modal dialogs/, 4 sidebar panels/, and theme/ThemeManager. The design doc still reads like a future-of-the-project roadmap, so expect churn in the per-panel behaviour for a while.

The browser-style tabs in the editor use WebKitGTK 6 for read-only preview — markdown rendered via backend/MarkdownToHtml (md4c with GFM tables / strikethrough / task lists, wrapped in a themed document), raw HTML files, and agent-drivable browser tabs with a nav bar that the agent can drive via the UiControl commands (browser.open / browser.navigate / browser.read / browser.eval / browser.links / browser.console / browser.upload / browser.list / browser.close). That's the most interesting feature in the editor and also the one with the highest "your LLM has shell access to a browser widget" risk surface.

There are no integration tests yet. Like icarus and daedalus, the heavy lifting is verified via unit tests; live LLM tests live in /workspace/Testing/ and are gated by environment flags (the pattern repeats across all three projects).

Why I'm Watching It

It's a GTK4 app, written in C++23, that runs the same backend as icarus. The chat panel is the same daedalus::Agent. The HTTP API is the same one the web app uses. The SQLite layout is the same minus a separate DB for UI cache. The settings vocabulary is the same. The SSE event vocabulary is the same. The whole point of building daedalus in C++23 was apparently so that a single binary desktop editor could be wired up against it with no IPC and no JSON-RPC subprocess management — and now here it is.

If you're a C++ developer who has been waiting for a real native AI editor that isn't an Electron shell, give it a look:

git clone https://gitlab.com/leestripp/monkeybyte.git
cd monkeybyte
cmake -B build -G Ninja && cmake --build build
./run.sh

It will not solve your tab-management muscle memory. But it might solve "I want a real desktop AI editor I can grep -r."