Skip to content

Capability: cli

The the-loop Python CLI companion — lightweight, one-dependency, extensible quality-of-life commands the plugin (and users) can call.

What it is

A Python package (cli/, import package the_loop, console script the-loop) with an extensible command registry. Python is deliberate: it leaves room for future self-learning/ML capabilities.

Current behaviour

  • The CLI SHALL register commands via an extensible registry (the_loop.commands).
  • The CLI SHALL have exactly one runtime dependency, pyyaml>=6, and be stdlib otherwise. PyYAML is REQUIRED, not an extra: the CLI config, the harness config and every default the daemons read are YAML, so a missing parser used to degrade each read to empty, with the cause logged at debug or not at all — leaving poll to exit with "no polling sources configured" against a file that listed sources (issue-97, decision-038). The [config] extra that once carried it SHALL be retained as an empty, deprecated no-op so pinned install lines keep resolving.
  • the-loop --version SHALL report the installed package version, derived from package metadata (importlib.metadata.version("the-loopy-one")) rather than a hardcoded string, so it always tracks the actually-installed release (issue-78).
  • the-loop gh-webhook start|stop SHALL run/stop the HMAC-verified GitHub webhook receiver (see webhook-triggers).
  • the-loop sessions register|list|close SHALL manage the work-item ↔ harness-session registry used for webhook routing.
  • the-loop scenarios SHALL output the table of every Gherkin scenario covered by the integration tests (--format table|markdown|json; see testing-and-contracts).
  • the-loop events SHALL query the structured JSONL event log of the CLI's own routing/dispatch/session decisions (see observability).
  • The package SHALL be installable from PyPI as the-loopy-one (import package the_loop and the the-loop script unchanged; see release-publishing).
  • gh-webhook/poll/sessions/events SHALL read their defaults from a CLI config (cli-config.yaml) independent of any repo's .the-loop/harness-config.yaml (the plugin config) — resolved via --config/-c, else $THE_LOOP_CLI_CONFIG, else ./.the-loop/cli-config.yaml (repo-relative, so an operator can track it in a chosen repo), else ~/.the-loop/cli-config.yaml, so the CLI is not tied to a single repo (cli/README.md, decision-032).

Design

cli/README.md · architecture § CLI companion

History

Work itemWhat changedLinks
issue-97PyYAML promoted from the [config] extra to a required runtime dependency; the three silent ImportError fallbacks removed and the zero-runtime-dependency guarantee retiredspec, decision-038
issue-82Plugin config renamed config.yamlharness-config.yaml (scenarios reads the new name with a pre-rename fallback); CLI config gained operator-declared collaborators + daemon-side notifications event filtersdecision-035
issue-78--version derives from package metadata instead of a hardcoded string that had frozen at 0.1.0spec
issue-63Split the CLI daemon's config (webhooks/polling/eventLog) out of the per-repo plugin config into an independent, repo-agnostic CLI configspec, decision-032
issue-50Added the structured event log and the events query commandspec, decision-025
issue-21Published to PyPI as the-loopy-one with automatic semantic releasesspec, decision-019
issue-15Added sessions registry commands and webhook --route dispatchspec, decision-016
issue-11Added scenarios (queryable integration-test scenario table)spec, decision-014
issue-1Established the CLI skeleton and the gh-webhook receiver (v0)spec, decision-005

Released under the MIT License.