opencode
opencode copied to clipboard
feat(opencode): add project usage cli command
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 activityto see live output in the terminal.
Fixes #7545