feat: add pharn list command#15
Conversation
Shows installed vs. available modules and category:skill skills with optional update markers. `--json` emits a machine-readable inventory object on stdout (diagnostics to stderr) for scripting/CI use. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (19)
📝 WalkthroughWalkthroughAdds three new CLI commands to ChangesNew CLI Commands: list, remove, status
Sequence DiagramsequenceDiagram
participant User
participant CLI as src/index.ts
participant Remove as runRemove
participant Status as runStatus
participant Repo as fetchRepo/cloneRepo
participant Diff as diffInstalled
participant FS as .claude/ + pharn.config.json
rect rgba(255, 100, 100, 0.5)
note over User,FS: pharn remove <module>
User->>CLI: pharn remove review-module
CLI->>Remove: runRemove("review-module", {yes})
Remove->>Repo: cloneRepo (spinner)
Repo-->>Remove: repoDir
Remove->>Remove: installedDependents guard
Remove->>Remove: collectModuleFiles → file set
Remove->>FS: delete files, pruneEmptyDirs
Remove->>FS: rewrite pharn.config.json
Remove-->>User: removed
end
rect rgba(100, 100, 255, 0.5)
note over User,FS: pharn status
User->>CLI: pharn status [--strict] [--no-drift]
CLI->>Status: runStatus({strict, drift})
Status->>Repo: fetchRepo (remote manifest)
Repo-->>Status: remoteManifest
Status->>Repo: cloneRepo (drift mode only)
Repo-->>Status: repoDir
Status->>Diff: diffInstalled(repoDir, claudeDir, modules, skills)
Diff-->>Status: InstallDiff {modified, missing, okCount}
Status-->>User: VERSION + DRIFT notes
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- `pharn remove <module|category:skill>`: inverse of `add`; precise file-level deletion (no shared-dir clobber), refuses pharn-core or modules with dependents, interactive picker with no arg, `--yes`/`-y` flag, `rm` alias - `pharn status`: read-only audit with version check and drift detection (sha256 compare vs cloned @main); `--no-drift` skips clone, `--strict` exits 1 for CI; excludes user-owned CONSTITUTION.md and memory-bank/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
pharn list— a read-only command that shows installed vs. available modules andcategory:skillskills, with update markers when the manifest has newer versions--jsonflag emits a single machine-readable inventory object on stdout (diagnostics to stderr) for scripting/CI useTest plan
npm testpasses (newtests/list.test.ts+ extendedtests/index.test.ts)npm run typecheckpassesnpm run lintpassesnpm run format:checkpassespharn listin a project withpharn.config.jsonshows installed modules and available onespharn list --jsonprints clean JSON with no decorative output🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
removecommand to uninstall modules or individual skills with confirmation prompt and--yesflaglistcommand to display installed and available modules/skills with optional--jsonoutput formatstatuscommand for version and drift auditing with--strictand--no-driftoptionsDocumentation