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
Hey! Your PR title Allen/project usage doesn't follow conventional commit format.
Please update it to start with one of:
-
feat:orfeat(scope):new feature -
fix:orfix(scope):bug fix -
docs:ordocs(scope):documentation changes -
chore:orchore(scope):maintenance tasks -
refactor:orrefactor(scope):code refactoring -
test:ortest(scope):adding or updating tests
Where scope is the package name (e.g., app, desktop, opencode).
See CONTRIBUTING.md for details.
The following comment was made by an LLM, it may be inaccurate:
No duplicate PRs found