feat: add --resume/--continue CLI session flags#682
Conversation
akramcodez
left a comment
There was a problem hiding this comment.
LGTM! Excellent work on this PR. The implementation is clean, the user flow feels well thought out, and the test coverage is thorough.
One small request for future contributions: for features of this scope, please open a GitHub issue before starting implementation. It gives us a chance to discuss the design and expected behavior up front, keeps development aligned with the roadmap, and provides useful context for future contributors.
Fair point on opening an issue first. In this case the changes were already built and incubating on my fork, where I use and test them daily, since I implemented them ahead of time for my own personal use. So there's no wasted effort to worry about here, even without a prior discussion. That said, I'm open to feedback, and I'd prefer to have it on the PR itself. If the PR doesn't cleanly match the repo's goals or overlaps an existing one, that's fine by me. The changes I bring are things I already run daily, and if the community wants them, they can have them. |
|
Hey @llupRisinglll - brilliant work :) |
Description
--continue/-c— resume the most recent session for the current directory (starts fresh with a notice if none exists).--resume [id]/-r [id]— resume a session by id, 1-based list index, orlast; a bare--resumeopens the session picker at startup. Both flags are interactive-only and mutually exclusive.--helptext and docs updated.Type of Change
Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)25 new tests: 10 specs for
resolveSession(source/session/resolve-session.spec.ts—last, undefined-arg default, index resolution, raw uuid from another cwd, not-found, out-of-range index, empty scoped list, empty global list, thealloption, and the digit-prefixed-uuid-vs-index case) and 15 specs for CLI flag parsing (source/cli.spec.ts— flag/shorthand detection, id capture, flag/runtokens not swallowed as ids, mutual exclusion, and non-interactive rejection).Manual Testing
Used as a daily driver:
--continueand--resume(bare, by index, by id, andlast) exercised across real multi-day sessions, including the fresh-start path in a directory with no sessions and quit-then---continueround trips confirming the exit flush preserves the conversation tail.Checklist
--helptext and examples updated for both flags. New surface area is additive only — running with neither flag is byte-identical to before, and pre-render failures use plainconsole.error+ exit like the surrounding CLI validation code.