Repository navigation
Description
Context
The CLI currently exposes seventeen top-level commands: render, sync, watch, import, search, inspect, status, dashboards, settings, env, runs, prune, doctor, index, completions, help, and _complete. Running polylogue --help produces a wall of text where the operational commands (sync, import) sit alongside maintenance utilities (prune, doctor) and introspection tools (status, env, runs) with no grouping.
Shell completions are generated statically—bash gets a hardcoded word list for the first positional argument and nothing beyond that. Subcommand flags, provider names, conversation slugs, and branch IDs all require manual typing. Fish completions are similarly static. Only zsh uses the dynamic _complete endpoint, but the engine behind it only handles a subset of the command tree.
Additional concerns
Vendor shims: _vendor/frontmatter.py, _vendor/pyperclip.py, and _vendor/watchfiles.py pre-date the current pyproject.toml dependency declarations. They're dead code in normal operation but still get imported as fallbacks, creating a testing surface that diverges from production.
Memory-bound JSON parsing: The ChatGPT and Claude importers call json.loads() on entire conversations.json files. For archives with thousands of conversations this pulls the full parse tree into memory before iteration begins.
N+1 branch queries: branch_explorer._load_branch_overview issues a separate _fetch_divergence_message query per branch. Conversations with many branches generate noticeable latency.
Prune destructiveness: The prune path calls shutil.rmtree directly on output directories. An interrupted prune can leave partially deleted conversation trees that confuse subsequent syncs.
NixOS deployment: There's no NixOS module—deploying on a NixOS host requires hand-written systemd units that duplicate CLI flag knowledge and don't track target configuration declaratively.
Scope
- Regroup commands into
sync,import,browse,maintain,confighierarchies - Fold
watchintosync --watch; removedashboards(redundant withbrowse status) - Replace static completion scripts with dynamic completers for all subcommands
- Add a NixOS module generating systemd timers from a declarative target manifest
- Switch importers to streaming JSON parsing
- Batch branch explorer divergence queries
- Safe-prune via rename-to-trash before rmtree
- Remove vendor shims
Acceptance criteria
polylogue --helpshows ≤8 top-level commands with brief descriptionspolylogue sync codex --watchreplacespolylogue watch codex- Tab-completing
polylogue browsein bash/fish/zsh offersbranches,stats,status,runs - Tab-completing
--providerarguments offers live provider names from the state DB - NixOS module produces working systemd timers when
services.polylogue.targets.codex.enable = true - ChatGPT/Claude imports stream without loading full JSON into memory
- Prune interrupted mid-operation leaves data recoverable in
.trash/
Activity