Merry
A lightweight terminal coding agent powered by a unified Rust runtime.
English · 简体中文
Features · Memory · Quick Start · Headless & CI · Shortcuts · Sandbox · SDKs · Config
https://github.com/user-attachments/assets/f7272d03-d4b8-4ae4-9ba7-547e3bc726f2
Why
Honestly, there isn't much of a why. I just wanted an agent of my own — it sounded fun, so I built one.
Features
One Rust runtime owns sessions, tool admission, context compilation, permissions, and lifecycle — serving the terminal UI, headless CLI, Rust crate, and Python SDK from the same core.
- Lightweight Footprint — Single native Rust binary with no JS runtime or background daemon, idling at ~23 MiB RSS in the full interactive TUI (comparison).
- Streaming TUI — Markdown & syntax-highlighted diffs, Plan Mode (
Alt+P), inline review comments (Alt+C),/copy& reply-anchor navigation, image paste, and built-in themes (Sakura,Tokyo Night,Catppuccin Mocha,Nord,Paper Light,Everforest,Terminal) with optional transparency. - Parallel Subagents — Built-in
explore,coder, andreviewroles plus custom roles, Git worktree isolation, and live monitoring in theTasksdock. - Sandboxed by Default — Confines every process action via Linux Landlock + seccomp or macOS Seatbelt with workspace trust,
MERRY_*environment isolation, and AI/human permission review (Windows defaults to host mode with permission review and Job Object process cleanup). - Structured Runtime — Automatic turn-preserving context compaction, cross-process session locking, on-demand
SKILL.mdskills, durable memory, HTTP MCP servers, and resumable sessions. - Multi-Provider — OpenAI Responses & Chat Completions, Anthropic Messages, per-role model overrides, and zero-disk
MERRY_*environment-variable provider config for CI.
Memory Footprint
Cold-start idle memory compared across coding agents on the same machine:
| Agent | Version | Idle RSS | Peak RSS (VmHWM) |
vs. Merry |
|---|---|---|---|---|
| Merry | 0.1.1 |
23.4 MiB | 23.4 MiB | 1.0× |
| Grok CLI | 1.0.89 |
114.1 MiB | 114.1 MiB | 4.9× |
| Codex CLI | 0.171.0 |
125.9 MiB | 125.9 MiB | 5.4× |
| Claude Code | 2.1.330 |
126.5 MiB | 137.2 MiB | 5.4× |
Antigravity CLI (agy) |
1.5.13 |
224.9 MiB | 224.9 MiB | 9.6× |
| OpenCode CLI | 2.3.0 |
514.6 MiB | 703.7 MiB | 22.0× |
| DeepSeek Harness (server only) | 0.2.2-rc.5 |
416.5 MiB | 416.5 MiB | 17.8× |
| DeepSeek Harness (server + Chrome) | 0.2.2-rc.5 |
789.9 MiB* | — | 33.8× |
Measured on Linux x86_64 by cold-starting each agent in a 120×40 PTY inside the same repository directory with zero prompts sent, reading total process-tree VmRSS / VmHWM from /proc after settling (8s). Numbers vary with OS, version, plugins, and active sessions. Claude Code was measured at its initial workspace trust screen. DeepSeek Harness (dsh web) excludes the npx wrapper; * adds headless Chrome's deduplicated PSS (334.0 MiB across all browser processes; renderer processes alone: 178.3 MiB PSS) to the connected dsh server (455.9 MiB VmRSS) to avoid double-counting shared browser pages.
Quick Start
Supported on Linux (5.13+ for Landlock), macOS (Seatbelt), and Windows (host mode with PowerShell 7 / Windows PowerShell).
Prebuilt binaries (no Rust or Node.js required; includes Alt+G Web viewer)
# Linux (static musl, x86_64 / arm64) & macOS (Apple Silicon / Intel)
|
# Windows (x86_64)
irm https://github.com/locez/merry/releases/latest/download/install.ps1 | iex
Or download directly from GitHub Releases, or use cargo binstall merry-cli.
From crates.io (requires Rust 1.95+)
# or with the local Web trajectory viewer (Alt+G), no Node.js required:
Nix & Home Manager
# or add `inputs.merry.homeManagerModules.default` in your Home Manager flake
Launch Merry in any project directory — on first launch, the TUI guides you through provider setup, and settings can be adjusted anytime via Alt+X → Settings:
For file-based configuration (custom providers, subagent roles, MCP servers, skills, themes, and keymaps), copy examples/config.toml to ~/.config/merry/config.toml (Linux/macOS) or %APPDATA%\merry\config.toml (Windows).
To build the local Web trajectory viewer from source, build web/dist/ first (requires Node.js/npm):
&&
( && && )
Headless & CI Automation
merry run and merry cmd share Merry's coding runtime, managed providers, and persisted preferences (defaults < config.toml < tui-preferences.toml < MERRY_* env < CLI flags). Pass --no-preferences in CI to ignore local TUI preferences.
# Zero-disk-config CI run using MERRY_* environment variables
MERRY_BASE_URL="https://api.openai.com/v1" \
MERRY_API_KEY="sk-..." \
MERRY_MODEL="gpt-5.4" \
# Enforce structured final output and override provider/model from CLI
All MERRY_* environment variables are automatically stripped by merry-process from child workspace commands (and MERRY_API_KEY_FILE is added to the denied path policy) so provider credentials never leak to tools or shell processes.
- Common overrides:
MERRY_MODEL,MERRY_REASONING_EFFORT,MERRY_SERVICE_TIER,MERRY_CONTEXT_WINDOW_TOKENS - Named mode (selects a configured alias; mutually exclusive with inline vars):
MERRY_PROVIDER - Inline mode (standalone ephemeral provider):
MERRY_API_KEYorMERRY_API_KEY_FILE,MERRY_BASE_URL,MERRY_PROVIDER_TYPE(openai-compatible|anthropic),MERRY_PROVIDER_PROTOCOL(responses|chat_completions),MERRY_ANTHROPIC_API_VERSION,MERRY_ANTHROPIC_MAX_OUTPUT_TOKENS
TUI Shortcuts
Customize bindings in [tui.keymap] (config accepts both alt+ and option+). On macOS, Option shortcuts below work out of the box on the standard ABC layout; enable "Use Option as Meta Key" in your terminal if you use a non-ABC layout or dead-key chords such as Option+U.
| Linux / Windows | macOS | Action |
|---|---|---|
Alt+X |
Option+X |
Command palette & Settings (models, themes, transparency) |
Alt+P |
Option+P |
Toggle Plan Mode |
Alt+C |
Option+C |
Quote timeline text and attach inline review comments |
Alt+T |
Option+T |
Inspect full output of executed commands |
Alt+G |
Option+G |
Open local Web trajectory viewer (--features web) |
Ctrl+V |
Ctrl+V / ⌘+V |
Paste image from clipboard |
Esc |
Esc |
Interrupt active turn |
Sandbox & Permissions
--sandbox workspace is on by default on Linux and macOS: process actions stay confined to the workspace with network closed unless approved and inherited MERRY_* variables scrubbed, while Merry's own model and MCP connections remain on the host. On Windows, Merry currently defaults to host mode (--sandbox off) using pwsh / powershell.exe (overridable via MERRY_SHELL) with Job Object process-tree cleanup; passing --sandbox workspace explicitly fails closed because a native Windows kernel sandbox is not yet implemented. Permission review defaults to --permission-mode auto (ask, always-approve, and deny are also available).
See SANDBOX.md for Landlock/seccomp, Seatbelt, Windows host mode, workspace trust, environment isolation, and host socket integrations.
SDKs
Rust (merry)
use ;
let provider = anthropic
.api_key?
.model_name?
.build?;
let agent = new
.provider
.build?;
let result = agent.run.await?;
Declare typed async tools with #[merry::tool], configure context windows and compaction on providers or AgentBuilder, protect concurrent access with cross-process session locks, and intercept model or tool turns with HookRegistry. See docs.rs/merry and crates/merry/src/lib.rs.
Python (merry-agent)
"""Look up an order status by id."""
return f
=
await
= await
Supports Agent(...) / await Agent.resume(...) with session locking and explicit close lifecycle, @merry.tool decorators, context window and compaction config, lifecycle hooks (merry.Hooks), structured outputs, and interactive sessions (agent.interactive()). See sdks/python/README.md and sdks/python/CAPABILITY_MATRIX.md.
Docs & Development
examples/config.toml— annotated configuration reference- SANDBOX.md — sandbox isolation and permission model
- CONTRIBUTING.md — contribution guidelines, UI screenshot requirements, and review expectations
- AGENTS.md — workspace architecture, crate boundaries, and contributor standards
License
Dual-licensed under either of Apache License, Version 2.0 or MIT License, at your option.
Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion in Merry, as defined in the Apache-2.0 license, is dual-licensed as above without additional terms or conditions.