opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(opencode): add project usage cli command

Open allen-n opened this issue 4 days ago • 2 comments

What does this PR do?

Adds a projects CLI command that lists all known projects with session counts, last-activity timestamps, and worktree status. Output now wraps full paths (no truncation), aligns with existing CLI patterns (UI.println, Locale.todayTimeOrDateTime), supports sorting/limit/active-only flags, and keeps the table frame intact across terminal widths (clamped to 80–120, defaults to 100 when unknown).

How did you verify your code works?

  • Unit test: bun test --cwd packages/opencode test/cli/projects.test.ts (verifies wrapping, no ellipsis, locale time, aligned frame)
  • Manual run on my machine: bun run --cwd packages/opencode src/index.ts projects --sort activity to see live output in the terminal.

Fixes #7545

allen-n avatar Jan 10 '26 01:01 allen-n