Metadata-Version: 2.4
Name: meridian-cli
Version: 0.29.7
Summary: Orchestrate CLI + MCP server for multi-model agent workflows
Project-URL: Homepage, https://github.com/haowjy/meridian-cli
Project-URL: Repository, https://github.com/haowjy/meridian-cli
Project-URL: Issues, https://github.com/haowjy/meridian-cli/issues
License: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: >=3.12
Requires-Dist: ag-ui-protocol>=0.1
Requires-Dist: aiohttp>=3.11
Requires-Dist: coolname>=4.0.0
Requires-Dist: cyclopts>=3.0
Requires-Dist: fastapi>=0.115
Requires-Dist: markdown-it-py>=4.0
Requires-Dist: mars-agents==0.41.3
Requires-Dist: mcp<2,>=1.0
Requires-Dist: meridian-sync==0.29.7; sys_platform != 'win32'
Requires-Dist: pathspec>=1.1.0
Requires-Dist: prompt-toolkit<4,>=3.0
Requires-Dist: psutil>=7.2.2
Requires-Dist: pydantic>=2.12
Requires-Dist: python-frontmatter>=1.1
Requires-Dist: sqlalchemy<3,>=2.0
Requires-Dist: structlog>=25.0
Requires-Dist: tomlkit>=0.14.0
Requires-Dist: uvicorn[standard]>=0.34
Requires-Dist: watchfiles>=1.1.1
Requires-Dist: websockets>=14.0
Provides-Extra: app
Requires-Dist: httpx>=0.28; extra == 'app'
Provides-Extra: dev
Requires-Dist: pyright>=1.1.400; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest-timeout>=2.4.0; extra == 'dev'
Requires-Dist: pytest>=8.4.0; extra == 'dev'
Requires-Dist: ruff>=0.12.0; extra == 'dev'
Provides-Extra: templates
Requires-Dist: jinja2>=3.1; extra == 'templates'
Description-Content-Type: text/markdown

# meridian-cli

Let coding harnesses call each other. meridian-cli lets agents running in Claude Code, Codex CLI, and OpenCode spawn named specialist agents in the other harnesses, each with the model, cost, and tool environment you configured.

It is for people who already use more than one AI coding CLI and want one team of agents instead of separate chat sessions.

> **Early development.** meridian-cli is not stable. Expect breaking changes in any release. If you need a stable workflow, this project is not ready for you yet.

## Why

Good agentic coding is an allocation problem. Some tasks need the strongest model you have; some need cheap, parallel throughput; some need a specific harness feature such as sandboxing, tool behavior, context handling, or integrations.

Without meridian-cli, those choices are trapped inside separate CLIs. Switching harnesses means manually copying context between sessions and hoping the next agent understands what happened.

meridian-cli turns that handoff into a command. A caller can delegate to a named specialist, pass only the context that agent needs, and pick up the result from disk. Use the expensive model where judgment matters, use cheaper agents where throughput matters, and keep every agent inside the harness that fits the job.

## One Harness Can Call Another

> **Demo placeholder:** add a short terminal recording or screenshot here showing one coding harness spawning an agent in another harness, then collecting the result with `meridian spawn wait` or `meridian spawn show`.

## Install

```bash
uv tool install meridian-cli
```

The package is `meridian-cli`; the command it installs is `meridian`.

<details>
<summary>Other methods</summary>

```bash
pipx install meridian-cli
pip install meridian-cli
```

From source:

```bash
git clone https://github.com/haowjy/meridian-cli.git
cd meridian-cli
uv tool install --force . --no-cache --reinstall
```

A checkout install compiles the `meridian-sync` Rust crate; maturin fetches a Rust toolchain
if none is installed.

</details>

You need at least one harness installed: [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Codex CLI](https://github.com/openai/codex), or [OpenCode](https://opencode.ai).

## Set Up a Project

`meridian init` by itself only bootstraps meridian-cli project config:

```bash
meridian init
```

To initialize Mars package content in the same step, use setup flags:

```bash
meridian init --add haowjy/meridian-dev-workflow --link .claude
```

For first-run onboarding, bootstrap can do setup + launch in one command:

```bash
meridian bootstrap --add haowjy/meridian-dev-workflow --link .claude
```

`--add` / `--link` setup flags cannot be combined with `--dry-run`.

## Usage

Launch an interactive session:

```bash
meridian
```

Or spawn agents directly:

```bash
# Code on Codex, review on Claude
meridian spawn -a coder -p "Add rate limiting to the API endpoints"
meridian spawn -a reviewer --from p1 -p "Review the rate limiting implementation"

# Check on work
meridian spawn list
meridian spawn show p1
```

Agents route to their configured model and harness automatically. Each spawn gets a fresh context window with only the context it needs.

## Uninstalling

`uv tool uninstall meridian-cli` removes only the command. Meridian can also leave a sync
service, Codex rule files, a rule in Antigravity's settings, files in your projects' harness
folders and its state in `~/.meridian`, and it never cleans any of them up. The sessions it launched stay in each
harness's own store (`~/.claude`, `~/.codex`, …) and remain resumable without Meridian;
Pi sessions are the exception, kept under `~/.meridian` (step 8 below).

To remove the rest, paste this prompt into a coding agent. Start that agent in its harness
directly (`claude`, `codex`, …), not through `meridian`, because the last steps delete the
state a Meridian session runs on.

```text
Uninstall Meridian (the meridian-cli package) from this machine. It does not clean up after
itself, so find each piece below and show me the exact paths you found. Ask me before you
stop, edit or delete anything, one group at a time, because I may want to keep some of it.
Touch only the Meridian pieces named here, never a harness's own config or sessions
beyond the one Antigravity entry in step 4. If MERIDIAN_HOME is set, it replaces
~/.meridian everywhere below. Steps 1 to 6 need the `meridian` command, so do them before
step 7.

1. Running work. Check that no Meridian session or spawn is running (`meridian spawn list`
   in each project). Run `meridian machine list`; on each machine it names I may want to
   run this uninstall too. Run `meridian artifact list`, then `meridian artifact stop
   <slug>` for each serve: this also removes its `tailscale serve` or `tailscale funnel`
   path, which otherwise stays registered.

2. The sync service. `meridian sync service uninstall` stops and deletes the user service
   for the current home: ~/.config/systemd/user/meridian-sync.service on Linux,
   ~/Library/LaunchAgents/dev.meridian.sync.plist on macOS. Look for more units named
   meridian-sync-<8 hex digits>.service or plists named dev.meridian.sync.<8 hex
   digits>.plist, from installs with another MERIDIAN_HOME. Remove each one by hand:
   `systemctl --user disable --now <unit>`, delete the file, `systemctl --user
   daemon-reload`; on macOS, `launchctl bootout gui/$(id -u)/<label>`, then delete the plist.

3. Project files. The folders Meridian ran in are the "path" values in
   ~/.meridian/projects/*/roots/*.json, plus any I name. In each one that has a mars.toml,
   run `meridian mars unlink <target>` for every entry in `targets` in mars.toml and
   mars.local.toml (.claude, .codex, .opencode, .pi, .agy, …). That deletes the skills,
   agents, hooks and MCP entries Mars installed in those folders and keeps files that
   aren't Mars's. Then show me the Meridian and Mars files left in the project:
   meridian.toml, meridian.local.toml, mars.toml, mars.local.toml, mars.lock, .mars/ and
   .mars-src/. Say which ones git tracks, because deleting a committed file changes the
   project for everyone who shares it. .mars-src/ holds agents and skills written for
   that project, so ask before deleting it. Skip this step for a project that keeps
   using Mars.

4. Harness rules. Delete the files named meridian*.rules in ~/.codex/rules/, and in the
   rules/ folder of any other CODEX_HOME I use. Each one lets every Codex session run a
   `meridian` command outside its sandbox. Leave default.rules and every other file there
   alone: they are Codex's or mine.
   In ~/.gemini/antigravity-cli/settings.json (Antigravity's settings), remove the one
   entry `read_file(<Meridian home>/agy/watch)` from `permissions.allow`, where <Meridian
   home> is ~/.meridian written out in full. It lets every agy sandbox read that folder.
   Edit only that entry and keep the file valid JSON.

5. Shell completion, if `meridian completion install` ever ran. The script is at
   ~/.local/share/bash-completion/completions/meridian, ~/.zsh/completions/_meridian,
   $ZSH_CUSTOM/completions/_meridian or ~/.config/fish/completions/meridian.fish, or
   wherever --output put it. With --add-to-startup it also added two lines: in ~/.bashrc
   the line "# Load meridian completion" and the line after it, or in ~/.zshrc the line
   "# meridian completions" and the fpath line after it.

6. Mars outside projects. Ask me first whether I still use Mars, the package manager
   Meridian bundles; if I do, skip this step. If ~/mars.toml exists, an older Mars
   installed into folders under my home (~/.claude and others): run `meridian mars --root
   ~ unlink <target>` for each entry in its `targets` before deleting ~/mars.toml,
   ~/mars.local.toml and ~/mars.lock. Then the rest: ~/.mars or $MARS_HOME (my own Mars
   packages), Mars's download cache (`meridian mars cache info` prints its path, such as
   ~/.cache/mars/cache; delete the mars/ folder that holds it), ~/.mars-src,
   ~/.mars-migration-backup/, and old Mars config in ~/.config/mars/,
   $XDG_CONFIG_HOME/mars/, $MARS_CONFIG_DIR or, on macOS, ~/Library/Application
   Support/mars/.

7. The command. `uv tool uninstall meridian-cli`, or `pipx uninstall meridian-cli` if
   pipx installed it (`uv tool list` and `pipx list` show which). After a plain `pip
   install`, `pip uninstall meridian-cli` leaves its dependencies installed, among them
   mars-agents and meridian-sync, which provide the `mars` and `meridian-sync` commands;
   ask me whether to uninstall those too.

8. ~/.meridian, Meridian's state. Deleting it loses Meridian's records of every spawn and
   session, their reports, work items, saved machines, this machine's Meridian identity
   and ~/.meridian/config.toml. Before deleting it, check and tell me about:
   - ~/.meridian/git/: clones of git contexts. Show any uncommitted or unpushed changes.
   - ~/.meridian/context/: work items and notes for contexts that aren't in git.
   - ~/.meridian/meridian-pi/sessions/: Pi sessions that Meridian launched live only
     here, not in Pi's own store.
   - session archives in another folder, if history.archive.destination in a Meridian
     config points there.
   Then delete /tmp/meridian-<my uid>/, which holds Meridian's control sockets.

9. Settings I may have added myself while following Meridian's docs. Search
   ~/.claude/settings.json, ~/.gemini/antigravity-cli/settings.json, my shell startup
   files and ~/.ssh/environment for "meridian", ENABLE_PROMPT_CACHING_1H,
   crossSessionInbound and MERIDIAN_ variables, show me the matches and change nothing
   unless I say so.
```

## Architecture

```mermaid
graph TB
    User([You]) --> Primary["meridian<br/>(primary session)"]

    subgraph Packages
        Sources["git sources"] -->|"mars add/sync"| Store[".mars/"]
        Store -->|"materialize targets"| Tool[".claude/ · .codex/ · .opencode/ · .pi/"]
    end

    subgraph Runtime
        Primary -->|"meridian spawn"| Router{"Model router"}
        Router --> Claude["Claude Code"]
        Router --> Codex["Codex CLI"]
        Router --> OpenCode["OpenCode"]
    end

    subgraph State[".meridian/"]
        Spawns["spawns + reports"]
        Sessions["sessions"]
        Work["work items"]
    end

    Agents --> Primary
    Primary --> State
    Claude & Codex & OpenCode -->|"meridian CLI"| State
```

## Agent Packages

**[meridian-dev-workflow](https://github.com/haowjy/meridian-dev-workflow)** — A dev team: architects, coders, reviewers, testers, researchers, documenters, and the orchestrators that coordinate them.

**[meridian-base](https://github.com/haowjy/meridian-base)** — Core coordination primitives. Included as a dependency of meridian-dev-workflow.

## Docs

- [Getting Started](docs/getting-started.md) — prerequisites, harness setup, tool integration
- [Upgrading to 0.7](docs/upgrading.md) — upgrade steps, chat repair, rollback limits
- [Commands](docs/commands.md) — full CLI reference
- [Configuration](docs/configuration.md) — config keys, state layout, environment variables
- [History](docs/history.md) — indexed discovery, ZIP retention, transfer and restore
- [MCP Tools](docs/mcp-tools.md) — tool surface and payload examples
- [Troubleshooting](docs/troubleshooting.md) — common issues and diagnostics
- [Antigravity](docs/antigravity.md) — using Meridian from a plain `agy` session
- [INSTALL.md](INSTALL.md) — agent-friendly install guide

## Development

```bash
uv sync --extra dev
uv run ruff check .
uv run ruff format --check .
uv run pytest-llm
uv run --extra dev python -m pyright --warnings
```

See [DEVELOPMENT.md](DEVELOPMENT.md) for full dev setup.

## Contributing

This project is not accepting external contributions at this time. The maintainer is keeping it closed to outside contributions until the codebase is stable enough to support them well. Bug reports and feedback are welcome as GitHub issues.

## License

[Apache 2.0](LICENSE)
