Documentation · operator manual

Drive the
terminal agent.

Mesh is a terminal-first AI engineering agent. It indexes your repo, routes every prompt to the cheapest model that fits, edits across files, and runs your tests before it calls anything done. This is the operator manual — install it, then put it to work.

mesh — ~/your-repo
$ npm i -g @trymesh/cli
+ @trymesh/cli 0.4.104
$ mesh login
✓ authenticated as edgar@try-mesh.com
$ mesh "add rate-limiting to the auth route"
◇ planning · 3 files in context · gemini-3.5-flash
✎ edit apps/api/auth.ts
⚡ verify pnpm test ………… 24 passed
✓ done · +38 −4 · $0.004
⟢ Verified against @trymesh/cli 0.4.104 · @trymesh/mcp 2.1.8 · 2026-06-14 Install → Commands → MCP →
Get started

Pick a surface.

One code-context engine, four ways to run it. The CLI and MCP server are generally available today; the IDE and the hosted Gateway API are on the way.

GA

CLI

The terminal agent. Plan, edit across files, run tests, and ship — interactively or one-shot. @trymesh/cli.

npm i -g @trymesh/cli →
GA

MCP

Expose Mesh's tools to Claude Code, Cursor, Windsurf, and VS Code over the Model Context Protocol. @trymesh/mcp.

npx -y @trymesh/mcp →
Preview

IDE

A desktop workbench around the same engine. The shell exists; the live agent runtime bridge is still landing.

See preview status →
Coming soon

Gateway API

A hosted HTTPS endpoint for the engine. The v1 surface is designed; endpoints are not live yet.

Read the blueprint →

Install & log in.

Mesh ships as a single npm package. You need Node.js 20 or newer.

bash
$ npm i -g @trymesh/cli
$ mesh login        # opens your browser to authenticate
$ mesh              # start the interactive agent in your repo

The binary is mesh (aliases mesh-agent and mesh-daemon are installed too). Run it inside any project directory.

Authentication

mesh login opens a browser window against try-mesh.com and stores a session token in ~/.config/mesh/session.json. On a headless box or CI, pass --no-browser (or set MESH_AUTH_NO_BROWSER=1) to log in with email and password in the terminal instead.

i

No API key required. Model calls route through the hosted Mesh proxy, which holds the upstream Vertex AI and NVIDIA NIM credentials. You only bring a key if you want to — set GOOGLE_API_KEY to call Gemini directly and bypass the proxy.

First run · /start.

The fastest way to onboard a repo is the /start command. It runs the golden path in one shot: a health check, a full workspace index, a status card, and a short briefing on what it found.

mesh
 /start              # doctor + index + status + briefing
 /start reindex      # force a clean re-index
 /start fix          # run diagnostics and auto-fix what it can

Prefer to do it piecemeal? mesh doctor (add fix to apply repairs) runs diagnostics from the shell before you ever open the agent.

Your first change.

Give Mesh a goal. It plans against the indexed context, edits the files it needs, and then verifies — it runs your project's test, typecheck, and/or build scripts and won't report success on a non-zero exit.

mesh
 /change add a /healthz route that returns build SHA
  ◇ plan → ✎ edit → ⚡ verify (pnpm test) → ✓ summary
 /undo               # revert the agent's last file change

Everyday verbs live as plain commands: /change to make a focused edit, /fix to resolve the current error, /undo to roll back, /plan to toggle read-only planning. The full set is in the command reference.

Core concepts

The agent loop.

Every task runs the same loop: plan → edit → verify. Mesh assembles context from the index, proposes and applies edits across files, then runs your verification scripts and reads the result. If verification fails, it keeps working; it does not announce "done" without a green run.

  • Plan — pulls the relevant files, symbols, and call-graph neighbours into context. Toggle read-only planning with /plan.
  • Edit — applies multi-file changes directly to your working tree (honest diffs, no code dumps).
  • Verify — runs test / typecheck / build and gates on exit code.

You stay in control of how autonomous that loop is — see approvals & autonomy.

Models & cost-routing.

The default model is google/gemini-3.5-flash. If a call fails, Mesh falls back down a chain — gemini-2.5-pro, then moonshotai/kimi-k2.6 — so a single provider blip doesn't stop the turn.

You don't have to think about this per-prompt. Mesh classifies each task and routes it to the cheapest model that fits:

TaskRouted toWhy
Trivial / navigationgemini-2.5-flash-lite"hi", "list routes", "where is X"
Search / explaingemini-2.5-flash"how does auth work"
Edit / fix / refactorgemini-2.5-procode changes that must hold
Reasoning / auditgemini-2.5-pro"why", root-cause, architecture

Override any of it with /model, or pin a model for the session with the MESH_MODEL_ID environment variable. See the full model catalog (12 models) for IDs and pricing.

mesh
 /model pick          # interactive picker
 /model list          # show every available model
 /model gemini-2.5-pro save   # switch and persist for next time

The .mesh workspace.

Mesh keeps its per-repo state in a local .mesh/ directory (git-ignored). Nothing in it is required reading, but knowing the layout helps when you debug:

PathHolds
capsules/AST-precise file summaries (exports, types, JSDoc), invalidated on change
vectors.binthe embedding sidecar for semantic search
sessions/saved session capsules — what makes resume fast
metrics/per-turn token / cost metrics
traces/ · training/execution traces and outcome-joined training rows
config.jsonworkspace-local settings (model, theme, cache)

Rename the directory with MESH_DIR, or sweep orphaned files with /mesh gc (dry-run by default).

Guides

Index your codebase.

Mesh runs real embedding-based semantic search, not keyword grep. The index combines BM25 lexical scoring, chunk-vector cosine similarity, and call-graph expansion, so a query pulls in the functions that actually relate to it. Embeddings use google/gemini-embedding-001 (768-dim) via the proxy and persist to vectors.bin beside the index.

mesh
 /start reindex       # build or rebuild the index
 /debug index         # diagnose or repair a broken index

Indexing is incremental and resumable — it persists a lexical pass first, then layers embeddings on top, and auto-invalidates entries when the underlying file changes. Large repos index in seconds; the agent calls semantic_search under the hood as it works.

Approvals & autonomy.

By default Mesh auto-approves its own write and run tools so the loop flows. Dial that back whenever you want a human gate:

mesh
 /config approvals      # toggle auto-approval on/off
 /config steps 40       # cap tool steps for this session

With approvals off, every write or command surfaces a yes/no prompt before it runs. Quality and safety gates are advisory — they inform the agent but never silently block an edit; the one hard backstop is the patch-storm stop, which halts a run that keeps rewriting the same file.

MCP server.

GA

The @trymesh/mcp package (v2.1.8) exposes Mesh's tools over the Model Context Protocol, so other agents — Claude Code, Cursor, Windsurf, VS Code — can call them. Start it with:

bash
$ npx -y @trymesh/mcp

Then register it in your client. For example, in Claude Code's MCP config:

json
{
  "mcpServers": {
    "mesh": {
      "command": "npx",
      "args": ["-y", "@trymesh/mcp"]
    }
  }
}

Cursor, Windsurf, and the VS Code MCP extension take the same command + args shape in their respective config files.

Resume sessions.

Long sessions get compressed into a capsule — a machine-readable summary of turns, context, cost, and outcomes — so you can stop and pick up later without re-reading everything.

bash / mesh
 /compact              # compress the transcript into a session capsule
$ mesh resume          # resume the most recent session
$ mesh --resume <id>   # resume a specific one

Capsules are saved under .mesh/sessions/ and hydrate the transcript on resume. Mesh also auto-compacts as you approach the model's context window, so the loop keeps running on long tasks.

Preview & experimental

IDE / Desktop.

Preview

There's a desktop workbench — a React/Electron shell (with a native Tauri build in the tree) wrapped around the same code-context engine. It's real and you can open it, but treat it as a preview: the production assistant-runtime bridge that connects the UI to the live agent loop is still landing. For day-to-day work, the CLI is the supported surface.

Voice mode.

Preview

Mesh has a speech-to-speech mode you can toggle with /config voice. It's wired but early — handy for hands-free narration of what the agent is doing, not yet a primary interface.

Gateway API.

Coming soon

The hosted HTTPS Gateway API exposes the engine over a stable v1 surface, authenticated with the same bearer token the CLI uses. The shape is designed, but the endpoints are not live yet — this section is a blueprint, not a contract. Use the CLI or MCP server today; we'll document the live API here the moment it ships.

Experimental /lab.

Experimental

The /lab namespace is research-grade and gated behind MESH_EXPERIMENTAL=1. Expect rough edges and breaking changes:

/lab runAutonomous hypothesis generation for hidden bugs.
/lab ghostLearn your style and predict your next edits.
/lab synthesizeDetect structural intent and propagate a change across the codebase.
/lab tribunalDebate a decision across three AI perspectives.
Reference

Slash commands.

Twenty top-level commands: eleven plain actions for the everyday loop, plus nine namespaces that group everything else. Old command names are aliased to their new homes, so muscle memory still works.

Actionsthe everyday loop
/helpShow the command tree, or detail for one command.
/planToggle read-only plan mode.
/change <goal>Make a focused change, verify it, summarize the diff.
/fixApply a background-resolved fix for the current error.
/undoRevert the agent's last file change.
/compactCompress the transcript into a session capsule.
/modelSwitch or save the active model (pick / list / <id>).
/goalInspect or update the session goal (set / done / block / clear).
/startOnboarding golden path (fix / reindex).
/clearClear the terminal.
/exitQuit.
/statusone unified card
/status [full]Model, context budget, tokens, cost & savings in one card. Replaces the old /cost, /savings, /context, /why.
/configsettings & session
/config setupInteractive or scripted settings wizard.
/config approvalsControl tool auto-approval.
/config stepsSet max tool steps for the session.
/config voiceToggle or configure speech-to-speech.
/config daemonControl the background daemon.
/config entangleLink a second repo for cross-reference.
/config resumeResume a saved workspace session.
/config syncCheck cloud cache sync status.
/config resetReset the current session.
/config debugToggle debug logging.
/memorycapsule & durable knowledge
/memory showInspect and manage the session capsule.
/memory brainQuery known fix patterns across workspaces.
/memory companyBuild/query durable architectural decisions.
/memory learnRead or refresh the engineering memory.
/memory distillUpdate the project brain from recent changes.
/memory twinBuild a structural model of the codebase.
/debugdiagnostics
/debug doctorRun diagnostics and optional auto-fixes.
/debug indexDiagnose or repair the workspace index.
/debug bisectAutonomous git bisect on a symptom.
/debug replayReplay a production trace locally.
/debug whatifCounterfactual analysis in an isolated timeline.
/debug hologramRun a process with V8 memory telemetry.
/debug causalBuild/query a causal dependency graph.
/debug repairInspect the predictive repair queue.
/debug sheriffFingerprint module semantics, alert on drift.
/shipissue → PR automation
/ship autopilotTurn an issue into a verified patch + PR.
/ship issuesScan and run GitHub / Linear / Jira issues.
/ship intentCompile a product intent into a phased contract.
/ship forkRun two competing implementations, compare.
/ship productionProduction telemetry / readiness gate.
/ship auditVerify or replay the audit trail.
/tuiterminal surface
/tui colorChange the theme color.
/tui statuslineBuild the bottom statusline.
/tui copy · exportCopy transcript to clipboard, or export to markdown.
/tui searchSearch the chat transcript.
/tui keysShow keyboard shortcuts.
/tui tools · statusFilter tool activity; show TUI state.
/mesh · /dashboard · /labhousekeeping, view, research
/mesh gcGarbage-collect orphaned .mesh files (dry-run by default).
/dashboardOpen the local repo operations dashboard.
/lab …Experimental research commands — see /lab.

Model catalog.

Twelve user-selectable models across Google Vertex AI and NVIDIA NIM. Prices are USD per 1,000 tokens (input / output); NVIDIA-hosted models are included through the proxy. Switch with /model <id> or any listed alias.

ModelIDBest for$ / 1k
Gemini 3.5 Flash defaultgoogle/gemini-3.5-flashfast everyday driver.000075 / .0003
Gemini 3.1 Pro Previewgoogle/gemini-3.1-pro-previewtop reasoning, slower.0035 / .0105
Gemini 2.5 Progoogle/gemini-2.5-prostable high-quality reasoning.00125 / .01
Gemini 2.5 Flash-Litegoogle/gemini-2.5-flash-litecheapest, auto for trivial turns.0000188 / .000075
Grok 4.20 Reasoningxai/grok-4.20-reasoningxAI reasoning.005 / .015
Grok 4.20 Non-Reasoningxai/grok-4.20-non-reasoningxAI low-latency.002 / .006
GLM 5zai-org/glm-5-maasZ.ai reasoning.0014 / .0044
Kimi K2.6moonshotai/kimi-k2.6Moonshot deep reasoningvia proxy
DeepSeek V4 Prodeepseek-ai/deepseek-v4-prostrong generalistvia proxy
Qwen 3 Coderqwen/qwen3-coder-480b-a35b-instruct480B code specialistvia proxy
Llama 4 Maverickmeta/llama-4-maverick-17b-128e-instructMeta MoEvia proxy
GPT-OSS 120Bopenai/gpt-oss-120bopen-weights 120Bvia proxy

Configuration.

Settings resolve from three places, most specific wins: a workspace-local .mesh/config.json, your global ~/.config/mesh/settings.json, and any .env in the repo root. The most useful environment variables:

VariableDoesDefault
MESH_MODEL_IDpin the active modelgemini-3.5-flash
MESH_ENDPOINToverride the LLM proxy URLhosted proxy
MESH_TEMPERATUREsampling temperature0
MESH_MAX_TOKENSmax output tokens8000
MESH_ENABLE_EMBEDDINGSturn semantic search on/offtrue
MESH_EMBEDDING_MODELembedding modelgemini-embedding-001
MESH_MCP_COMMAND · MESH_MCP_ARGSspawn a child MCP server
MESH_DIRrename the .mesh directory.mesh
WORKSPACE_ROOToverride the workspace rootcwd
GOOGLE_API_KEYbring-your-own key, bypass the proxyoptional
MESH_DEBUGverbose debug loggingoff

Or run /config setup for a guided wizard.

CLI & flags.

Beyond the interactive TUI, mesh is scriptable. Pass a task as an argument to run it one-shot — handy in CI:

bash
$ mesh "upgrade eslint and fix the new violations"   # one-shot
$ mesh resume                  # resume last session
$ mesh daemon start            # background daemon (status · digest · stop)
$ mesh pr                      # build a PR proof bundle
$ mesh live --verify "pnpm test"  # foreground watcher
$ mesh eval --since 2026-06-01 # replay & score historical turns
$ mesh bench                   # run the benchmark suite

Plus the basics: mesh doctor [fix], mesh login / mesh logout, mesh support, mesh --version, mesh --help.

Troubleshooting.

Login won't open a browser

On headless machines or CI, run mesh login --no-browser (or set MESH_AUTH_NO_BROWSER=1) to authenticate with email and password in the terminal.

A model returns a 4xx / 5xx

Mesh auto-falls-back down its chain, but you can switch immediately with /model gemini-2.5-pro. NVIDIA-hosted models (Qwen especially) are occasionally rate-limited upstream — try a Gemini model if one is unresponsive.

Indexing seems stuck

Run /debug index to diagnose or repair. Indexing is resumable, so re-running picks up where it left off. If embeddings are the bottleneck, you can disable them with MESH_ENABLE_EMBEDDINGS=false (lexical search still works).

Edits didn't seem to land

Check /status and the diff summary — Mesh shows honest diffs and never reverts its own writes. mesh support prints a bug-report bundle if you need to file something.

Changelog.

⟢ This page verified against @trymesh/cli 0.4.104 & @trymesh/mcp 2.1.8 on 2026-06-14.

0.4.104Static-analysis cleanup — the codebase is oxlint-clean.
0.4.102Honest write_file diffs; .mesh git-ignored by default.
0.4.97Native Gemini proxy caching (big cost win on cached input).
0.4.95Full standard toolset every turn; git-HEAD cache invalidation.
0.4.93Command consolidation: 62 → 20 (11 actions + 9 namespaces).