opencode
opencode copied to clipboard
feat: add --resume flag to interactively select session
Summary
Adds a --resume (-r) flag to the run command. When used, it fetches available sessions and presents an interactive list (using @clack/prompts) for the user to select one to resume.
This mimics the behavior of claude code --resume.
Changes
- Modified
packages/opencode/src/cli/cmd/run.tsto addresumeoption and handling logic. - Uses
Locale.todayTimeOrDateTimefor friendly timestamps. - Filters out sub-sessions (sessions with
parentID).
Testing
- Verified
opencode run --helpshows the new flag. - Verified typecheck passes.
Closes #2404