m4code is a native desktop app, written in Rust with GPUI, that runs coding-agent sessions (Claude Code, Codex, OpenCode and Antigravity) around the user's own CLIs. Agents talk to m4code over ACP and show in its chat view. The repository is m4rocks/m4code.
src/main.rs: startup, menus and assets.src/app/: workspace state and behavior.act.rsdispatches actions,keymap.rsholds the key bindings, and the other files group methods by task.headless.rsandheadless/drive the workspace on GPUI's test platform.src/panels/: workspace rendering.workspace_view.rsis the root view.src/harness/: harness-agnostic core (mod.rs,acp.rs,compaction.rs,defaults.rs,limits.rs,permission.rs,runner.rs,subagents.rs,text_generation.rs,thread.rs) plus isolated per-harness adapters (claude/,codex/,opencode.rs,antigravity/).src/mcp/: m4code's built-in MCP server (mod.rs) and IPC request bridge (bridge.rs), shared across harnesses.src/thread/: the conversation view and its composer.src/store.rsandsrc/store/: persisted app state.src/git/andsrc/github/: local Git and the GitHub pane.src/terminal/: the shell panel, the only PTY in the app.src/lsp/: language servers.bridge/: the Node bridge Claude Code sessions run through (Claude Agent SDK).mod/: the Claude Code plugin m4code installs, with tests inmod/hooks/*.test.ts.web/: the Astro site (Bun).vendor/gpui-base: vendored GPUI code.scripts/: packaging and icons.
just lists every recipe. The main ones:
just build,just runjust lint:cargo clippy --locked --all-targets -- -D warnings. CI runs this.just test-app: Rust tests. The headless tests are#[ignore]d; run them withcargo test -- --ignored --test-threads=1 app::headless.just test: app, bridge and mod tests. The mod tests need theclaudeCLI on PATH.
- Run
just screenshot homeorjust screenshot settingsafter a UI change. Opentarget/screenshots/<scenario>.pngwith an image viewer and inspect the affected view.just screenshotdefaults tohome. - The runner in
src/screenshots.rsrenders the real workspace on GPUI's test platform with temporary app data and live harness and update checks disabled. The Settings scenario opens the dialog using the normal shortcut. Add a scenario there when testing another view or interaction. - The renderer needs a usable Vulkan or OpenGL adapter on Windows and Linux, or a Metal device on macOS. The PNG contains the GPUI window content at its test scale. Host fonts and native window decorations can differ from a desktop capture.
- Debug builds use their own data folder, so they can run next to an installed release. Only one instance runs per data folder.
- Some tests bake
CARGO_MANIFEST_DIRin at compile time. A test binary built from another worktree that shares thistarget/will look for files in that worktree. - A NUL byte in any
.rsfile failssource_tests::no_source_file_holds_a_nul_byte, because git would treat the file as binary. Write'\0'instead. - The README describes user-visible behavior; update it when that changes.