opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: add --resume flag to interactively select session

Open yanmxa opened this issue 3 days ago • 1 comments

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.ts to add resume option and handling logic.
  • Uses Locale.todayTimeOrDateTime for friendly timestamps.
  • Filters out sub-sessions (sessions with parentID).

Testing

  • Verified opencode run --help shows the new flag.
  • Verified typecheck passes.

Closes #2404

yanmxa avatar Jan 11 '26 01:01 yanmxa