Python CLI control plane: replace bash logic with a single-file CLI - #1
Merged
Conversation
Replace the bash logic (poke.sh dispatcher, peon-poke-setup, uninstall.sh, four adapters) with a single python3.8+ CLI (peon-poke) and keep every entry-point name as a zero-logic sh shim: - dispatch/play: config-gated pattern resolution, detached+quiet spawn, always exit 0 (invariants preserved) - setup/uninstall: markers, safe_rm refuse-list, exact-shape hook/TOML ownership (legacy bash/poke.sh + adapters/codex.sh shapes still owned, old installs heal on upgrade), stable .peon-poke-bak, atomic writes - adapters/codex.sh deleted: notify now points at bin/peon-poke directly; gemini/cursor/grok are 2-line shims to CLI subcommands - new: peon-poke doctor; peon-poke + peon-poke-uninstall PATH symlinks (uninstall chosen by argv[0], no launcher script) - pi/opencode plugins spawn bin/peon-poke directly (no bash in the path) - Claude hooks now registered as shlex-joined CLI commands (space/quote safe) - installer payload allowlist + SHA256SUMS include peon-poke (same commit); CI py_compiles the CLI; tap formula must add peon-poke at next release (documented in PLAN-python-cli.md + AGENTS.md) tests: adapter matrix via CLI subcommands, legacy-shape migration/removal cases, updated link/hook-shape assertions; full suite green
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the bash logic (dispatcher, setup, uninstaller, adapters) with a single-file Python CLI (
peon-poke, python3.8+, stdlib only) and keeps every existing entry-point name as a zero-logicshshim. Plan:PLAN-python-cli.md.Changes
peon-poke(new): dispatch/play (config-gated, detached+quiet, always exit 0), agent event adapters, setup, uninstall, doctorpoke.sh,peon-poke-setup,uninstall.sh(5 lines),adapters/{gemini,cursor,grok}.sh(2 lines) — kept for the brew formula, user-owned manual wiring, and mid-upgrade legacy hooks (retirement path documented)adapters/codex.shdeleted: Codexnotifynow points directly at the CLI —notify = [".../bin/peon-poke", "codex"]shlex.join-ed CLI commands (space/quote safe); legacybash .../poke.shshapes still recognized as ours — setup heals them, uninstall removes both shapespeon-poke+peon-poke-uninstallsymlinks both point at the one CLI file (uninstall chosen byargv[0], no launcher script)bin/peon-pokedirectly — no bash in the hot pathsafe_rmrefuse-list, exact-shape hook/TOML ownership, stable.peon-poke-bakbackups, atomic writes everywhere (setup's Claude write is now atomic too)install-remote.shallowlist +scripts/sha256sums.sh+ regeneratedSHA256SUMSincludepeon-poke; CIpy_compiles the CLITests
Full suite green (144 assertions): adapter matrix via CLI subcommands (incl. JSON argv / stdin / legacy names / unknown-silence), TOML setup fixtures (empty / table-ending / user-notify / malformed / quoted-paths / idempotency / new: legacy-shape migration), uninstall destructive-safety guards (new: both notify shapes, legacy Claude hook removal), ownership/symlink hardening, installer manifest traversal guards, plugin harnesses. Verified end-to-end:
file://remote install → setup → dispatch, plus a real haptic boop.Release notes
peon-poketolibexec.install(and chmod 0755) in the same session the next tag is cut — before that tag, the old formula + old tag keep working; after, the new formula is required. Documented in AGENTS.md.peon-poke setuprun.