Decision 005: Provide a lightweight, extensible Python CLI (the-loop)
- Status: accepted — superseded in part by decision-038: the "zero runtime dependencies / PyYAML is an optional extra" clause below no longer holds (PyYAML is required as of issue-97). Everything else — Python, the extensible command registry, the stdlib-first posture — stands. The clause is left as written; it records why the guarantee was made, which is what made retiring it a decision worth recording.
- Date: 2026-06-30
- Deciders: @MadaraUchiha-314 (via issue #1 update)
- Work item: issue-1
Context
Issue #1 was updated to add: although the-loop is primarily a Claude/Cursor plugin, it should ALSO expose a CLI for quality-of-life commands the plugin itself can use — for example, running a server that receives GitHub (or Jira) webhooks. The issue specifies the shape the-loop gh-webhook start|stop, requires the CLI to be extensible, and mandates Python (lightweight) because future self-learning/ML capabilities are mostly exposed as Python SDKs.
Decision
- Ship a Python CLI package named
the-loopundercli/(packagethe_loop), with the primary CLIthe-loopand an extensible command registry (subclassCommand, decorate with@register, drop the module incommands/). - Zero runtime dependencies in the core (stdlib
argparse+http.server); PyYAML is an optional extra used only to read.the-loop/config.yamldefaults; pytest is a dev extra. - First command:
gh-webhook start|stop— a GitHub webhook receiver that verifies theX-Hub-Signature-256HMAC (secret from an env var, never a flag), exposesGET /health, logs events, and is structured to route events to the harness later. - Config: a
webhooks.ghWebhooksection in the schema (host/port/path/secretEnv/ pidfile/events).
Consequences
- The plugin gains an out-of-harness companion for webhook receipt and future quality-of-life automation, on a path toward issue #1's webhook/"dream" goals.
- Python keeps the door open for ML/self-learning features.
- Routing received webhook events through to actually trigger the harness remains deferred (R8) — this delivers the receiver scaffold.
Alternatives considered
- Node/TS CLI to match the JS/TS tooling — rejected: the issue mandates Python for future ML SDKs.
- A heavy web framework (FastAPI/Flask) for the receiver — rejected: stdlib keeps it "very lightweight" with zero runtime deps.