opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(opencode): add project usage cli command

Open allen-n opened this issue 1 month 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

Hey! Your PR title Allen/project usage doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

github-actions[bot] avatar Jan 10 '26 01:01 github-actions[bot]

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

github-actions[bot] avatar Jan 10 '26 01:01 github-actions[bot]