Skip to main content

The `swarph` binary — multi-LLM CLI with mesh-gateway integration. Phase 2 one-shot mode shipped (PLAN.md §13).

Project description

swarph-cli

The swarph binary — multi-LLM CLI with mesh-gateway integration. Thin client over the swarph-mesh substrate.

pip install swarph-cli
swarph --version

This is one of three repos in the v0.3.x architecture:

Repo Role
swarph-mesh Substrate Python package — Protocol + adapters + SwarphCall + MeshClient. Pure library, no CLI
swarph-cli This repo — the swarph binary
swarph-meshlm Simon Willison llm plugin

Status

v0.1.0 — Phase 2 one-shot mode. The swarph "prompt" binary works end-to-end against --provider gemini per PLAN.md §13 falsifiability gate. Subsequent phases extend the CLI surface (REPL, --ask <peer>, onboard/ratify, daemon, import).

$ swarph "say pong" --provider gemini
Pong!
# 3+26t  $0.0000  0.73s  caller=cli.oneshot.ubuntu  provider=gemini

--json mode semantics

--json is a harness trigger, not a strict-validation gate. When set, swarph routes the response through the swarph-mesh JSON harness:

  • A permissive {"type": "object"} schema is synthesised when --schema is absent (Phase 5+ adds Pydantic validation).
  • The harness retries once with [USER]-turn feedback on parse failure.
  • Malformed-JSON exits with code 1 + raw text on stdout for caller recovery. Useful for shell scripts:
    if swarph "give me a trade" --json; then
      # parsed dict was on stdout
      ...
    fi
    
  • Pretty-printed parsed dict on stdout when parse succeeds; error_class=malformed_json shows up in the stderr attribution footer when it doesn't.

Spec

hedge-fund-mcp / research/swarph_cli/PLAN.md

Phase rollout

Phase What lands
0 (this) Scaffold — entry-point + status banner
2 One-shot mode: swarph "hello" --provider gemini
3 --ask <peer> mesh-aware one-shot via MeshClient
5 Interactive REPL — /inbox, /reply, /dm, /watch
5.5 swarph onboard <peer-name> + swarph ratify <peer-name> (PLAN.md §15)
5.7 swarph daemon foreground drain loop + swarph chat REPL with drain coroutine (PLAN.md §16)
6 PyPI publish

Why split CLI from substrate

swarph-mesh (the library) is imported by omega-boss, Council judges, lab-orchestrator, and any future swarph peer that wants to write programs against the Protocol. Those callers don't need the CLI surface or the console-script entry point. Keeping the CLI in a separate repo means library users pip install swarph-mesh without pulling argparse + REPL plumbing they'll never run.

Install (dev)

git clone https://github.com/darw007d/swarph-cli
cd swarph-cli
python -m venv venv && source venv/bin/activate
pip install -e ".[dev]"
pytest
swarph --version

License

MIT. Pierre Samson + Claude Opus, 2026.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarph_cli-0.1.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swarph_cli-0.1.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file swarph_cli-0.1.1.tar.gz.

File metadata

  • Download URL: swarph_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for swarph_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8c241c13f8102e2af77821c5c7a2798e687d414e09b9c3d57006d8a126843eb5
MD5 658e9c624389f5108267d8d199ca66a3
BLAKE2b-256 3bdd9fbfc4224b535da9bcbd66c87b140e40ac98c8a9e5e12f3d1d20e2aad184

See more details on using hashes here.

File details

Details for the file swarph_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: swarph_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for swarph_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8fb49cad835d908dc04682d2078ed190990287f6b793058f8242ec71fc9a1764
MD5 0e5a2d23d4822911a43a6f79ed5c6543
BLAKE2b-256 ad3d18b658f0b946861d476f07099ef41c666cf4689609249e7f0a8b7dc15f49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page