<div align="center">
  <img src="https://cdn.jsdelivr.net/npm/@trymesh/cli/assets/mesh-banner.png" alt="Mesh — terminal-first AI engineering agent" width="100%" />
</div>

<div align="center">

[![npm](https://img.shields.io/npm/v/@trymesh/cli?color=00d4e8&labelColor=03070d&label=mesh)](https://www.npmjs.com/package/@trymesh/cli)
[![node](https://img.shields.io/badge/node-%E2%89%A520-00d4e8&labelColor=03070d)](https://nodejs.org)

**[try-mesh.com](https://try-mesh.com)** · [Docs](https://try-mesh.com/docs)

</div>

---

**Mesh is a terminal agent built to spend fewer tokens on the same work.**

Most coding agents resend the whole chat, bloated tool schemas, and redundant file reads every turn. Mesh compacts what goes into the model — tool specs, transcript history, workspace context — so multi-step tasks stay cheap and fast. Same gateway, same models, less noise in the prompt.

```bash
npm install -g @trymesh/cli
mesh
```

On first run, `mesh` opens sign-in in your browser. Default model is **Gemini 3.5 Flash**. Requires **Node 20+**.

## Why Mesh

- **Fewer tokens per turn.** Compacted tool definitions, session capsules, and context planning cut prompt size versus a raw agent loop — often by a large margin on longer sessions.
- **Cheaper models when it fits.** Flash-Lite auto-routing and `/model` let you trade speed vs. depth without leaving the session.
- **Search before you read.** `/index` builds a workspace index so the agent can grep and search instead of dumping whole files into context.
- **One install, one account.** Sign in once; model calls go through the shared Mesh gateway on [try-mesh.com](https://try-mesh.com).
- **Many models, one session.** Gemini, Grok, GLM, Kimi, DeepSeek, Qwen, Llama, and more via `/model` or `--model <alias>`.

## Benchmarks

Head-to-head on a real multi-turn task (`nextjs-full`, 3 turns, Gemini 3.5 Flash) — **Mesh** vs a **raw** LLM loop on the *same* model and prompts.

```text
nextjs-full · 3 turns · Gemini 3.5 Flash

Input tokens sent to the model   (lower is better)
  Mesh   ██████████                            27.4K
  Raw    ████████████████████████████████████  94.6K     −71%

Wall-clock time
  Mesh   ██████████████████████                60.0s
  Raw    ████████████████████████████████████  96.7s     −38%
```

| Turn | Mesh | Raw | Reduction |
| --- | --- | --- | --- |
| 1 | 4.6K | 7.6K | **−39%** |
| 2 | 8.9K | 56.0K | **−84%** |
| 3 | 13.9K | 31.1K | **−55%** |
| **Total** | **27.4K** | **94.6K** | **−71%** |

Replay with `mesh eval`. Raw baseline uses provider prompt caching, so Mesh’s advantage is conservative.

## Quickstart

```bash
npm install -g @trymesh/cli
mesh
mesh "fix the failing auth test"
mesh resume
mesh --resume <session-id>
```

`mesh` starts the interactive terminal UI. Pass a quoted task for a one-shot run. Use `/help` in a session for the full command list.

## Commands

| Command | What it does |
| --- | --- |
| `mesh` | Interactive session (sign-in on first run) |
| `mesh "<task>"` | One-shot task, then exit |
| `mesh resume` | Resume the latest session in this workspace |
| `mesh --resume <id>` | Resume a specific session |
| `mesh logout` / `mesh whoami` | Sign out · show signed-in email |
| `mesh doctor [fix]` | Diagnose the install |
| `mesh eval [--since <ISO>]` | Replay turns and measure token efficiency |
| `mesh support` | Debug info for bug reports |

**In-session — the five worth knowing:**

| Command | What it does |
| --- | --- |
| `/cost` | Token spend and savings this session |
| `/dashboard` | Live repo dashboard in the browser |
| `/model` | Switch model (cost vs. quality) |
| `/index` | Build or repair the workspace search index |
| `/help` | Full command reference |

## Models

Default: **Gemini 3.5 Flash**. Pick another with `/model` or `mesh --model <alias>`.

| Model | Alias | Notes |
| --- | --- | --- |
| Gemini 3.5 Flash | `default`, `3.5-flash` | Default — fast |
| Gemini 3.1 Pro Preview | `3.1-pro` | Stronger reasoning |
| Gemini 2.5 Pro | `pro` | Stable reasoning |
| Gemini 2.5 Flash-Lite | `lite` | Cheapest — auto-routed on trivial turns |
| Grok 4.20 Reasoning | `grok-reasoning` | xAI reasoning |
| Grok 4.20 Non-Reasoning | `grok`, `grok-fast` | xAI low-latency |
| GLM 5 | `glm` | Z.ai |
| Kimi K2.6 | `kimi` | Moonshot |
| DeepSeek V4 Pro | `deepseek` | Generalist |
| Qwen 3 Coder | `qwen` | Code specialist |
| Llama 4 | `llama`, `maverick` | Meta MoE |
| GPT-OSS 120B | `gpt-oss` | Open weights |

If the primary model errors out, Mesh tries **Gemini 2.5 Pro**, then **Kimi K2.6**.

## Account

1. Go to **[try-mesh.com](https://try-mesh.com)** and create an account (free tier available).
2. Run `mesh` in your project — the CLI opens browser sign-in and stores your session in the OS keychain (with a `~/.config/mesh` fallback).
3. **Pro plan:** email [edgar.baumann@try-mesh.com](mailto:edgar.baumann@try-mesh.com) or [philipp.horn@try-mesh.com](mailto:philipp.horn@try-mesh.com) to request access.

Your prompts and code context are sent to the model provider you select to generate responses. Run `mesh logout` to clear local credentials.

## Requirements

- Node.js **20+**
- A Mesh account on [try-mesh.com](https://try-mesh.com)

## Links

**[try-mesh.com](https://try-mesh.com)** · [Docs](https://try-mesh.com/docs) · [Changelog](./CHANGELOG.md)

## Contact

- Edgar Baumann — [edgar.baumann@try-mesh.com](mailto:edgar.baumann@try-mesh.com)
- Philipp Horn — [philipp.horn@try-mesh.com](mailto:philipp.horn@try-mesh.com)

## License

Mesh Commercial License — see [LICENSE](./LICENSE).
