[PR #7546] feat(opencode): add project usage cli command #12436

Open
opened 2026-02-16 18:17:20 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7546

State: open
Merged: No


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

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7546 **State:** open **Merged:** No --- ### 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
yindo added the pull-request label 2026-02-16 18:17:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12436