Package Exports
- @trymesh/cli/dist/local-tools.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@trymesh/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
A terminal-first AI engineering agent. Built to prove its work, not perform it.
npm install -g @trymesh/cli
mesh login
meshmesh login opens a browser and hands the session back to your terminal. The shared Mesh gateway routes to Gemini 3.5 Flash by default. Requires Node 20+.
Headline behaviours
| Verifies | Every edit-turn runs pnpm test / pnpm typecheck / cargo check (auto-detected). No "tests pass" without an exit-0. |
| Anti-thrash | After 3 consecutive edits without a passing verify, write tools are hard-blocked. The agent has to diagnose. |
| Adaptive | Each prompt is classified — trivial gets a 900-byte prompt + 4 steps; complex gets the full scaffolding. |
| Pre-fetch | Vague audits ("is X safe?") auto-read the top-3 relevant files before the LLM call. |
| AST capsules | ts-morph for TS/JS, structured regex for Python/Rust/Go. Cached + invalidated on file change. |
| OOM-safe | Pre-stat gate at 256 KB, slim-write fallback on huge indexes, 8 GB default heap. |
Models
Default is Gemini 3.5 Flash. Switch with /model inside the CLI or --model <alias> on the command line.
| Provider | Model | Alias |
|---|---|---|
| gemini-3.5-flash | flash, default |
|
| gemini-3.1-pro-preview | pro, gemini-pro |
|
| gemini-2.5-flash | 2.5-flash |
|
| gemini-2.5-pro | 2.5-pro |
|
| Moonshot | kimi-k2.6 | kimi |
| NVIDIA NIM | qwen / mistral / deepseek / llama variants | per-model alias |
| Anthropic (via proxy) | claude-* | claude |
Commands
mesh # start interactive TUI
mesh --classic # legacy scrollback REPL
mesh "<task>" # one-shot
mesh init # first-run setup + repo briefing
mesh doctor [fix] # diagnose; --fix applies safe repairs
mesh /index # build the workspace index
mesh /tokens # context breakdown of the current session
mesh /undo # restore last file backup
mesh bench [--task id] # run benchmark suite
mesh eval [--since ISO] # replay historical turns; pass/fail scoring
mesh live # foreground watcher (verify + AI! triggers)
mesh pr [--intent …] # build a PR proof bundle from current diff
mesh logout
mesh --versionInside the interactive CLI, /help lists command groups.
Configuration
Environment variables. All optional — the defaults work.
| Variable | Default | Purpose |
|---|---|---|
MESH_FAST_PATH |
off | Strict one-shot subprocess mode: minimal tool set, 4-step budget, 60 s wallclock. |
MESH_FORCE_TIER |
auto |
Pin scaffolding tier: trivial / small / complex. |
MESH_BENCH_RAW |
off | Strip mesh's scaffolding for A/B comparison against a raw LLM. |
MESH_INDEX_TIMEOUT_MS |
8000 |
Wallclock cap on ensureIndex. |
MESH_FIRST_INDEX_TIMEOUT_MS |
20000 |
Wallclock cap on the first-run workspace index. |
MESH_TURN_TIMEOUT_MS |
60000 (fast-path only) |
Hard kill on a single turn. |
MESH_DEBUG_LLM |
off | Stream raw LLM request/response summaries to stderr. |
How a turn runs
prompt
→ classify complexity (trivial / small / complex)
→ maybe pre-fetch top-3 relevant files
→ build system prompt + capsule per tier
→ LLM call (streaming where supported)
↻ tool dispatch (read / grep / patch / run …)
→ verify command (extracted from package.json)
→ final answer with file:line citationsWorkspace state
<project>/.mesh/
├── workspace.json # meta marker; "indexed" | "partial" | "deferred"
├── index/ # ContextBudget + token-usage history
├── capsules/v1/ # AST capsule cache (mtime + content-hash keyed)
├── artifacts/ # tool-result artifacts (auto-pruned)
├── history/ # session transcripts
└── config.json # workspace overridesUser-level state lives in ~/.config/mesh/. Both are size-capped (50 MB hard limit) and auto-recoverable.
Develop
pnpm --filter @trymesh/cli dev # tsx watch
pnpm --filter @trymesh/cli build # tsc + vite + minify
pnpm --filter @trymesh/cli typecheck
pnpm --filter @trymesh/cli test # node:test, 276 tests
pnpm --filter @trymesh/cli smoke:release
pnpm --filter @trymesh/cli verify:release # typecheck + build + test + smokeLicense
Proprietary. See the root LICENSE.