feat(cli): add comprehensive CLI with 11 commands#1283
feat(cli): add comprehensive CLI with 11 commands#1283fatihkutlar wants to merge 2 commits intothedotmack:mainfrom
Conversation
xkonjin
left a comment
There was a problem hiding this comment.
Quick review pass:
- Main risk area here is auth/session state and stale credential handling.
- Good to see test coverage move with the code; I’d still make sure it exercises the unhappy path around auth/session state and stale credential handling rather than only the happy path.
- Before merge, I’d smoke-test the behavior touched by CHANGELOG.md, CLAUDE.md, README.md (+39 more) with malformed input / retry / rollback cases, since that’s where this class of change usually breaks.
- Cancellation paths are notoriously flaky; a deterministic test proving cleanup happens on abort/timeout would reduce regression risk.
|
Thanks for the thorough review — these are exactly the right things to stress-test. Auth/session state & stale credentials Added unhappy-path coverage for four cases: expired credentials, missing credentials, malformed token format, and server-side session revocation (401 mock). Each exits non-zero with a human-readable message rather than a raw stack trace. Malformed input / retry / rollback Added smoke tests for all 11 CLI commands covering invalid/missing flag combinations. No-retry / fail-fast behavior on ECONNREFUSED is now explicitly tested. For multi-step operations with partial-state risk, atomicity tests verify either full apply or full rollback — gaps are flagged with TODO guards that point to the required production-side fix. Cancellation paths Added deterministic tests (fake timers, no real sleeps) for operation timeout and AbortController abort — each verifies connections and temp files are cleaned up before exit. SIGINT cleanup is marked as a TODO guard pending a process-signal hook in production code.
Let me know if you'd prefer any of these split into a separate follow-up PR. |
Add complete CLI tool for managing Claude-Mem from terminal: Commands (11): - System: doctor, repair, config, shell - Worker: logs - Data: backup, stats, search, clean, export, import Features: - doctor: 5 health checks with --fix for auto-repair - config: Settings validation (PORT, LOG_LEVEL, etc.) - logs: View/follow logs with filtering and cleanup - backup: Create/list backups (full, DB-only, settings-only) - stats: Database statistics with JSON output - search: Full-text memory search with filters - clean: Remove old data (sessions, observations, logs) - export/import: JSON/Markdown support - shell: Bash/Zsh/Fish completion Technical: - Modular architecture (utils/services/commands) - Colorized output with helpful error messages - Cross-platform support (Windows, macOS, Linux) - 35 unit tests included Documentation: - docs/CLI_GUIDE.md - Complete command reference - README.md - Updated with CLI quick reference - CHANGELOG.md - v10.6.0 release notes Version: 10.6.0
…r CLI - auth-session-unhappy: expired, missing, malformed, revoked (401) credentials - malformed-input: invalid flags/args for all 11 CLI commands - worker-connection-fail-fast: ECONNREFUSED fail-fast behavior - interruption-atomicity: partial-apply risk guards + rollback TODOs - cancellation: timeout and AbortController cleanup (deterministic/fake timers) - server + integration tests: stabilized with ephemeral ports
Add complete CLI tool for managing Claude-Mem from terminal:
Commands (11):
Features:
Technical:
Documentation:
Version: 10.6.0