Skip to content

Latest commit

 

History

History
135 lines (100 loc) · 7.37 KB

File metadata and controls

135 lines (100 loc) · 7.37 KB

Mantis CLI

Spaces, maps, and MCP tools for AI coding agents, straight from your terminal.

Docs · npm · Get an API key · Issues

npm version npm downloads Node ≥18 MCP ready License: MIT Built at MIT CSAIL

Mantis CLI overview


Mantis is a spatial data workspace. It embeds records (dataset rows, documents, code files, anything with text) into a 2D semantic map where proximity means similarity, then auto-groups them into labelled clusters so the shape of a dataset is visible at a glance.

This CLI puts the whole workspace in your terminal. Every Mantis MCP tool is reachable through mantis use <tool> (no editor plugin required), so AI coding agents (Claude Code, OpenCode, Codex, Cursor, and more) can inspect, search, and reshape spatial data directly.

🧰 Full MCP surfaceEvery Mantis tool via mantis use <tool>: inspect, search, compare, set algebra, bags, pages, export. JSON in, JSON out. No MCP plugin needed.
🤖 Agent skill syncOne command installs editor skills for Claude Code, OpenCode, Codex, Cursor, Windsurf, Copilot, and Antigravity.
🔗 URI substrateEvery entity has a stable mantis:// URI you pipe from one tool into the next: spaces, maps, clusters, bags, points, dimensions.
📦 Build maps locallyTurn a CSV/XLSX into a Mantis map, or index an entire codebase into a searchable semantic map in one call.
⚡ Fast cold startShips as a single bundled artifact, ~2.5× faster startup than an unbundled install. Bundled with Bun, runs on plain Node.
🔍 ScriptableSpaces, threads, and tools all emit JSON. Drop it straight into jq, pipelines, or agent loops.

Quick Start

npm install -g mantisai-cli      # Node ≥18, no Bun needed
mantis setup                     # API key + space + thread
mantis setup claude              # optional: install Claude Code skills
mantis use get_space_context     # confirm you're connected

Config lives at ~/.mantis/config.json. Grab a developer key at mantis.csail.mit.edu/developer.

Naming: repo KellisLab/mantis-cli · npm package mantisai-cli · binary mantis.

Using with Claude Code

Run mantis setup claude once to install the Mantis skills, then drive your spaces and maps straight from a Claude Code session, no MCP plugin required.

Mantis CLI in Claude Code

See the Claude Code guide for the full workflow.

Commands

Command Description
mantis setup [editor] API + space/thread, or sync skills for claude/opencode/codex/cursor/windsurf/copilot/antigravity
mantis status Show current space, thread, and config
mantis select [space|thread|both] Switch the active space and/or thread
mantis spaces list|resolve|set Scriptable space ops (JSON)
mantis threads list|new|set Scriptable thread ops (JSON)
mantis tools List every MCP tool and its arguments
mantis use <tool> Call any MCP tool (JSON output)
mantis create map <file> Build a map from a local CSV/XLSX
mantis create codebase [root] Index a repo into CSV; add --create-map to embed it

The mantis use toolbox

Reach for these through mantis use <tool> (run mantis tools for full argument schemas):

Tier Tools
Orient get_space_context, inspect
Reason search, compare, intersect, diff, union, export
Act create_bag, add_to_bag, remove_from_bag, rename_bag, delete_bag, filter_to_bag, set_plot_variables, legend_command, create_page, project
# Orient: what's in this space?
mantis use get_space_context

# Reason: semantically search a map
mantis use search --args '{"query":"memory systems","kind":"point","scope":["mantis://map/<id>"]}'

# Act: save a cluster as a reusable bag
mantis use create_bag --from-uri "mantis://map/<id>/cluster/<cid>" --name "My Bag"

# Act: project text (or a file's contents) onto a map as a new point, get its URI back
mantis use project --text "attention is all you need" --map-id <id>
mantis use project --file notes.md --map-id <id>

Documentation

Requirements

Contributing

git clone https://github.com/KellisLab/mantis-cli.git
cd mantis-cli
bun install          # or: npm install
bun run build        # bundles bin/mantis.js -> dist/mantis.js
node dist/mantis.js --version

Publishing is automated: push a v* tag and the GitHub Actions workflow builds the bundle and publishes to npm.


Built at MIT CSAIL · MIT License