Documentation · @trymesh/cli 0.4.37 · @trymesh/mcp 2.1.8 · private alpha

Mesh in five minutes.

Mesh is a terminal-first code-context platform for AI-assisted software work: repository capsules, verified change workflows, runtime diagnostics, issue automation, and durable workspace memory. The CLI is the canonical product — slash commands and 100+ workspace.* agent tools. MCP exposes a focused subset for external clients; IDE and Gateway API are preview surfaces.

Pick a surface.

Install.

Mesh is shipped as a single npm binary. macOS, Linux, and WSL2 are first-class. Node 20+ required.

bashinstall · 1 line
# global install (recommended)
$ npm i -g @trymesh/cli

# or with pnpm / yarn
$ pnpm add -g @trymesh/cli
$ yarn global add @trymesh/cli

# verify
$ mesh --version
mesh 0.4.37

Global install is the recommended default. For one-off runs without installing, use npx -y @trymesh/cli. First launch prompts Mesh login for the shared LLM gateway (no AWS/Bedrock credentials required).

Homebrew is coming. A formal Homebrew tap (brew install mesh) is in private beta. Join the waitlist to get early access.

First run.

Mesh opens against your current working directory. New users should run the golden path first: doctor, optional safe fixes, index, status, and repo briefing.

bashsession
$ cd my-project
$ mesh

mesh › /start
▸ running doctor · checking gateway · reading git state
✓ workspace healthy · 247 files indexed
▸ company brain: no durable memory yet
✓ repo briefing ready

mesh › /change fix voided invoices being charged
▸ scoped: invoices.ts, webhooks.ts, billing.spec.ts
✓ patch drafted · verification detected: npm test
  review diff, then promote only after checks pass

What just happened?

  1. Brief/start runs diagnostics, indexes the repo, and gives the agent a grounded project briefing.
  2. Scope/change narrows the edit to likely files before any patch is written.
  3. Verify — Risky work flows through timelines, tests, audit logs, and proof artifacts before promotion.

Concepts.

Six things to understand before you go deep.

ConceptWhat it is
capsuleA compressed structural index of a workspace (Tree-sitter AST, summaries, relationships). Typical reference workspaces compress ~4× vs raw source — see benchmarks.
spanA byte-range in a real file. Returned verbatim — never paraphrased.
recallBenchmark metric: needle-in-a-haystack retrieval accuracy on the capsule track (not a CLI setting). Reported runs: 100% on the standard track — details.
company brainDurable repo memory for decisions, owners, risks, rules, and accepted patterns.
timelineAn isolated worktree or copy where risky patches can be tested before promotion.
proof bundleEvidence package: diff, risks, checks, rollback notes, and audit trail.
sessionAn interactive mesh shell with full capsule + chat history. Resumable.
workspaceAny directory Mesh has built a capsule for. Stored in ~/.mesh/.

Slash commands · operator surface.

Mesh slash commands are the operator controls for the CLI: onboarding, verified changes, workspace memory, issue automation, capsules, voice, isolated timelines, runtime diagnostics, visual inspection, model routing, and safety policy.

Command registry
One prompt line.
Many engines behind it.

Commands are grouped by function. Some are session controls; others enable issue automation, workspace memory, timeline verification, runtime tracing, predictive repair, or contract checks.

51slash commands in the CLI registry (plus aliases like /memory/capsule)
100+workspace.* agent tools behind those commands in the terminal CLI
25built-in MCP tools (mesh_*) across profiles — core ships 8
/startRun the first-user golden path: doctor, optional fixes, index, status, and repo briefing.
/change <goal>Make one narrow code change, run detected verification, and summarize the diff.
/autopilotTurn a GitHub, Linear, Jira, or manual issue into a timeline patch and proof bundle.
/companyBuild or query durable repo memory before planning changes.
Golden Path & AutopilotMove from first run to verified patches without hand-waving.ship
/startRun doctor, optional safe setup fixes, index, status, and repo briefing for a fresh workspace.
/change <small goal>Scope a narrow edit, apply a surgical patch, run detected verification, and report the diff.
/autopilot plan|run|prConvert an issue or manual title into a verified timeline patch, proof bundle, and optional PR.
/issuesScan GitHub, Linear, or Jira tickets and prepare issue-to-PR work drafts.
/doctor fixApply safe local setup repairs while leaving shell, Git, and auth changes manual.
Context & CapsulesTurn raw repos into model-sized structure with exact span recovery.core
/indexRebuild the workspace index: summaries, AST structure, file relationships, and cache metadata.
/capsuleInspect active capsule state, token shape, compacted memory, and exportable context artifacts.
/memoryAlias for capsule memory operations in long-running coding sessions.
/compactCompress transcript and tool history back into the session capsule to reclaim context budget.
/distillRefresh project-level distilled context from repository signals: symbols, dependencies, risks, and summaries.
Voice & sessionOperate Mesh without leaving the terminal, including local speech workflows.voice
/voice onEnable voice interaction with local speech-to-text and native speech output.
/voice offReturn to typed interaction without changing the active session or capsule.
/voice setupInitialize the local audio loop, microphone access, and speech dependencies.
/doctor voice fixDiagnose and repair missing voice dependencies such as FFmpeg or local model assets.
/clearClear the terminal UI while keeping the session state intact.
Timelines & verificationTry risky changes in isolated worktrees before promotion.verify
/forkCreate competing implementation paths and compare their blast radius, tests, and maintainability.
/whatifSimulate migrations or architecture changes in alternate timelines before committing.
/bisectRun symptom-driven git bisect with verification commands to locate the introducing commit.
/fixApply prepared speculative fixes for currently detected compiler, lint, or runtime failures.
/undoSurgically roll back the latest agent-applied file change without resetting unrelated work.
Runtime diagnosticsCapture why a program broke, not just where the stack trace ended.runtime
/hologram start <cmd>Run a command under runtime observation; persist stack traces, logs, and crash artifacts.
/replayReplay production traces locally and compare observed behavior against expected code paths.
/productionRead production signal summaries and prioritize the highest-risk regressions.
/causalBuild or query causal links across files, tests, churn, failures, and risk zones.
/auditVerify hash-chained logs for tool actions, decisions, and promotion trails.
Visual inspectionInspect UI surfaces and supervise runs when terminal output is not enough.ui
/inspectAttach the visual portal for UI-level inspection and intent-based code navigation.
/stop-inspectDetach the active visual portal and end the browser inspection bridge.
/previewCapture frontend previews or screenshots from the terminal workflow.
/dashboardLaunch the local dashboard with run supervision, graph views, and live event streams.
/entangle <path>Link an additional repository for cross-repo reasoning (e.g. frontend and backend).
Workspace memory & analysisPersist conventions, analyze structure, and plan changes with repository context.memory
/twinBuild or query a structural model of routes, packages, risk zones, and dependencies.
/repairPrioritize repair opportunities from diagnostics and runtime signals.
/companyBuild, query, or record durable workspace memory: decisions, risks, owners, and patterns.
/learnExtract engineering patterns from accepted work, git history, and team conventions.
/intentCompile a product request into implementation constraints, files, tests, and rollback checkpoints.
/brainQuery shared fix-pattern knowledge and telemetry contribution status.
/labRun automated hypothesis analysis over causal, repair, and workspace signals.
/ghostLearn and apply local implementation style from prior commits and accepted patches.
/resurrectRestore saved session intent, open questions, and next actions from a prior checkpoint.
Safety & GovernanceControl risk, cost, contracts, and model routing before the agent acts.policy
/approvalsConfigure auto-approval behavior for higher-risk tools and command execution.
/stepsSet the maximum tool-step budget for the active interactive session.
/costEstimate session cost from token counters and model pricing metadata.
/modelSelect, list, or persist the active model choice from the provider catalog.
/sheriffDetect semantic drift via contract fingerprints after refactors.
/tribunalRun a structured multi-criteria review (correctness, performance, resilience).
Setup, Help & ExitThe small controls that keep the interactive shell understandable.session
/helpPrint the available slash commands and usage hints in the terminal.
/commandsAlias for command discovery when you want the registry view.
/setupRun interactive or scripted setup for providers, theme, cloud sync, and voice defaults.
/doctorCheck local Node/tooling/provider configuration and repair common environment problems.
/syncInspect local/cloud cache sync status, latency, and coverage details.
/exitGracefully leave the current Mesh CLI session.
i

The CLI registry is the source of truth for interactive workflows. Slash commands orchestrate the full workspace.* tool surface (indexing, timelines, runtime capture, issue automation, and more). MCP exposes profile-scoped mesh_* tools for Claude Code, Cursor, and other clients, including timeline and impact tools in broader profiles.

CLI · overview.

The terminal CLI is the canonical Mesh experience. Everything else (IDE, MCP, API) wraps the same engine.

Commands

CommandPurpose
meshOpen an interactive agent session in the current directory.
mesh initInitialize the first-user golden path for a workspace.
/startRun doctor, safe setup fixes, index, status, and repo briefing from inside the shell.
/change <goal>Make one narrow verified edit with detected checks and a diff summary.
/company query <question>Search durable company codebase memory before planning a change.
/autopilot run <issue>Plan, patch in a timeline, verify, review, and write a proof bundle.
/doctorVerify auth, gateway connectivity, local environment, and optional fixes.
mesh supportCollect auth-free bug report diagnostics for support.

Models & keys

The CLI defaults to the Mesh LLM gateway with Gemini 3.5 Flash (google/gemini-3.5-flash). Sign in once with mesh (Supabase session); no AWS or Bedrock setup. Switch models with /model, route NVIDIA NIM models with NVIDIA_API_KEY, or point MESH_ENDPOINT at a custom HTTPS proxy.

bashmodels · current CLI
# default through the Mesh gateway (after mesh login)
$ mesh
mesh › /model list

# switch inside the shell
mesh › /model qwen3-coder

# optional direct NVIDIA route
export NVIDIA_API_KEY=nvapi-...

# optional custom proxy (legacy alias: BEDROCK_ENDPOINT)
export MESH_ENDPOINT=https://your-llm-proxy.example.com
ModelCatalog idNotes
Gemini 3.5 Flashgoogle/gemini-3.5-flashDefault gateway model.
Gemini 2.5 Progoogle/gemini-2.5-proDeeper planning and review.
Gemini 3.1 Pro Previewgoogle/gemini-3.1-pro-previewHigher reasoning preview route.
Qwen 3 Coderqwen/qwen3-coder-480b-a35b-instructNVIDIA NIM code specialist.
Kimi K2.6moonshotai/kimi-k2.6NVIDIA deep reasoning.
DeepSeek V4 Prodeepseek-ai/deepseek-v4-proNVIDIA strong generalist.
GLM 5zai-org/glm-5-maasZ.ai reasoning route.
Grok 4.20xai/grok-4.20-reasoning, xai/grok-4.20-non-reasoningXAI routes via Google MaaS.
Llama 4meta/llama-4-maverick-17b-128e-instructNVIDIA Maverick MoE route.
GPT-OSS 120Bopenai/gpt-oss-120bOpen-weights NVIDIA route.

Run /model list in the shell for the full catalog. Legacy Claude/Bedrock model IDs in old settings are migrated to the Gemini default automatically.

Voice mode

Speak instead of type from inside the interactive CLI. Voice uses local speech-to-text — audio stays on your machine.

bashvoice
$ mesh
mesh › /voice setup   # one-time: local model + mic permissions
mesh › /voice on      # enable voice in this session

✓ voice loop ready
🎙  press [space] to talk · [esc] to cancel
mesh › /doctor voice fix  # repair FFmpeg / model assets if needed

IDE · preview status.

The Mesh IDE is a desktop-first workbench shell: React/Electron UI, Monaco editor, file explorer, terminal SSE, git status/diff/commit APIs, and an assistant/action contract.

Status: the current IDE is not the canonical production agent yet. The assistant bridge to the real Mesh runtime is in progress; use the CLI or MCP server for verified agent work today.

  1. Use Mesh CLI as the source of truth for agent execution.
  2. Run mesh, /start, and /index in your repository first.
  3. Use the IDE preview for workbench exploration, file navigation, terminal, and git surfaces.
  4. Watch the runtime bridge milestone before relying on IDE chat for production changes.

Runtime bridge in progress. The planned architecture keeps the IDE as a separate product, but routes assistant turns through the shared Mesh runtime instead of a stub response layer.

First launch on macOS

The IDE is currently distributed unsigned (no Apple Developer Program yet). After downloading Mesh.dmg and dragging Mesh IDE.app into your /Applications folder, macOS may show "Mesh IDE is damaged and can't be opened". That's macOS Gatekeeper rejecting any binary without Apple-issued notarization.

Run this in Terminal once and the warning goes away:

xattr -cr "/Applications/Mesh IDE.app"

The command removes the com.apple.quarantine attribute Chrome/Safari adds to downloaded files. Notarized builds will land once we register with the Apple Developer Program.

Shortcuts

ActionShortcut
Open command palette⌘K / Ctrl K
Toggle Mesh chat panel⌘L / Ctrl L
Index / re-index workspace⌘⇧I
Quick file open⌘P
Structural search⌘⇧F
Apply suggested patch⌘↵

MCP · install & run.

@trymesh/mcp is a stdio MCP server for Claude Code, Claude Desktop, Cursor, Windsurf, and VS Code. It exposes profile-based mesh_* tools (25 built-in tools across profiles; 8 in default core). The full interactive slash-command workflow and 100+ workspace.* tools still live in the terminal CLI.

bashmcp · stdio server
$ npx -y @trymesh/mcp

▸ stdio MCP server · profile: core (8 tools)
✓ mesh_workspace_status
✓ mesh_search
✓ mesh_read_capsule
✓ mesh_read_targeted
  … review · terminal · memory · full profiles available

MCP now includes timelines/impact/review/memory tools in non-core profiles. Use mesh in the terminal when you need full interactive orchestration (slash workflows, approvals, long-run state, and session-level control).

Manual Claude / Cursor config

Add the server manually in your MCP client config. Point stdio at npx -y @trymesh/mcp and set the workspace path:

jsonmcp config
{
  "mcpServers": {
    "mesh": {
      "command": "npx",
      "args": ["-y", "@trymesh/mcp"],
      "env": {
        "MESH_WORKSPACE_PATH": "/absolute/path/to/your/project"
      }
    }
  }
}

Cursor and Windsurf use the same stdio command. Claude Code users can keep the generated config and let the installer update it.

MCP tools (core profile)

These are the default mesh_* tools in the core profile. Additional profiles (review, terminal, memory, full) add risk/test, command, memory, and timeline/impact capabilities. The full workspace.* catalog remains CLI-native.

ToolPurpose
mesh_workspace_statusIndexing counts and workspace health.
mesh_searchIntent-to-file search with compact matches.
mesh_read_capsuleCapsule-oriented file context by tier.
mesh_read_targetedTargeted symbol read with context lines.
mesh_recover_spanRecover a span by handle (verbatim source).
mesh_symbol_chainFollow symbol-linked context across files.
mesh_context_statsToken budget and capsule cost snapshot.
mesh_describe_profileList tools/resources for a profile (review, memory, full, …).

Gateway API · v1 blueprint (coming soon).

The hosted HTTPS Gateway API is coming soon. The shape below is the intended v1 contract so teams can design integrations early. Today, use the CLI as the production path.

Availability: API endpoints are not live yet. Expected launch is soon. Until then, run mesh + /start//index locally for indexing/search/recovery workflows.

Auth, workspaces, and indexing jobs

Planned auth is Bearer-token based, scoped to one or more workspaces. Indexing is asynchronous and returns a job id so large repositories can build in the background.

httpauth + workspace + index job
# auth header required on all /v1 endpoints
Authorization: Bearer msk_live_xxx

# create / register workspace (planned)
POST /v1/workspaces
{
  "name": "mesh-cli",
  "repoUrl": "https://github.com/dreddi-edit/mesh"
}

# start indexing job (planned)
POST /v1/workspaces/{workspaceId}/index
{
  "mode": "incremental", # full | incremental
  "paths": ["apps/cli/src"],
  "force": false
}

# poll job
GET /v1/jobs/{jobId}
status: queued | running | succeeded | failed | cancelled

Index job response shape (planned)

FieldTypeNotes
jobIdstringStable job handle for polling/cancel.
statusenumqueued, running, succeeded, failed, cancelled.
progressobjectIncludes files scanned/indexed and percent complete.
artifactobject|nullOn success: capsule/index snapshot metadata.
errorobject|nullOn failure: normalized API error payload.

Capsules and context reads (planned)

Capsules remain the core context unit. API reads mirror what CLI workflows consume: compact file context, targeted symbol reads, and handle-based recovery.

httpcapsule and targeted reads
POST /v1/workspaces/{workspaceId}/read/capsule
{
  "path": "apps/cli/src/agent-loop.ts",
  "tier": "summary" # summary | detailed
}

POST /v1/workspaces/{workspaceId}/read/targeted
{
  "path": "apps/cli/src/agent-loop.ts",
  "symbol": "getSlashCommands",
  "contextLines": 24
}

# handle-based recovery (planned)
GET /v1/workspaces/{workspaceId}/spans/{spanId}

Current CLI behavior is unchanged: local capsule artifacts are stored under ~/.mesh/. Hosted API storage/retention policy will be published at launch.

v1 search is intended to support both intent search and symbol-targeted retrieval. Recovery remains handle-first (spanId, symbolId) for deterministic follow-up reads.

httpsearch
POST /v1/workspaces/{workspaceId}/search
{
  "query": "where is slash command routing implemented?",
  "mode": "hybrid", # lexical | semantic | hybrid
  "limit": 10
}

# optional continuity for multi-step workflows
"cursor": "srch_..."
"filters": { "pathPrefix": "apps/cli/src" }

Errors, limits, and status model (planned)

Responses are intended to use a normalized error envelope with stable machine-readable codes. Rate limits and quotas will be account-tier based once the hosted API is available.

jsonerror envelope
{
  "error": {
    "code": "WORKSPACE_NOT_INDEXED",
    "message": "Workspace has no completed index yet.",
    "requestId": "req_01JY3Z4...",
    "hint": "Start POST /v1/workspaces/{workspaceId}/index and retry."
  }
}
HTTPCodeMeaning
400INVALID_ARGUMENTSchema or parameter validation failed.
401UNAUTHENTICATEDMissing/invalid bearer token.
403FORBIDDENToken lacks workspace scope.
404NOT_FOUNDWorkspace/job/span handle missing.
409INDEX_CONFLICTMutating operation conflicts with active index job.
429RATE_LIMITEDQuota or burst limit exceeded.
500INTERNALUnexpected backend error.

Configuration.

Mesh reads repo-local settings, user settings in ~/.config/mesh/settings.json, and environment variables. Gateway routing uses MESH_ENDPOINT and MESH_MODEL_ID (legacy BEDROCK_* names still work as aliases).

bashenvironment
# Mesh LLM gateway (default; login via mesh CLI)
export MESH_ENDPOINT=https://mesh-llm.edgar-baumann.workers.dev
export MESH_MODEL_ID=google/gemini-3.5-flash

# runtime limits (defaults: max_tokens 8000, temperature 0)
export MESH_MAX_TOKENS=8000
export MESH_TEMPERATURE=0

# optional direct NVIDIA NIM models
export NVIDIA_API_KEY=nvapi-...

# opt-in expensive local features
export MESH_ENABLE_EMBEDDINGS=1
export MESH_ENABLE_BACKGROUND_RESOLVER=1

# deterministic CI/local runs
export MESH_DISABLE_WATCHERS=1

# legacy aliases still accepted: BEDROCK_ENDPOINT, BEDROCK_MODEL_ID, …

Telemetry

Mesh ships with telemetry off. On first run you may be asked to opt in; that sets telemetry.contribute in ~/.config/mesh/settings.json. When enabled, we collect anonymous session metadata (command invocations, error types, capsule sizes) — never source code or prompts. Set telemetry.contribute to false any time.

Troubleshooting

SymptomFix
First run feels unclearRun /start; it executes doctor, indexing, status, and repo briefing.
Gateway/model errorsRun /doctor full, re-login if needed, then /model list; set NVIDIA_API_KEY only for direct NVIDIA routing.
Too many file watchersSet MESH_DISABLE_WATCHERS=1; current releases avoid recursive full-repo watchers by default.
MCP client can't see MeshVerify npx -y @trymesh/mcp in client config and set MESH_WORKSPACE_PATH to an absolute repo path.
Voice mode silentRun /doctor voice fix. Check FFmpeg/model assets and microphone permissions.

Private alpha. Mesh CLI is in the 0.4.x line. Pin exact versions used by your team, and treat IDE/API surfaces as preview until their runtime bridge and hosted quotas are production-complete.

Changelog


Stuck? Join the waitlist for direct support during private preview, or open an issue on GitHub.