Skip to content

feat(opencode): add --since / --until date filters for daily report #867

@daheli

Description

@daheli

Problem

@ccusage/opencode daily currently does not support date range filtering.

ccusage daily already supports:

  • --since <YYYYMMDD>
  • --until <YYYYMMDD>

But @ccusage/opencode daily --help only shows --json and --compact, so users must pipe JSON to jq for date filtering.

Why this matters

  • Inconsistent UX between ccusage and @ccusage/opencode
  • Harder scripting for common tasks like "last 14 days excluding today/yesterday"
  • Extra dependency on jq for a very common use case

Proposal

Add these options to @ccusage/opencode daily:

  • -s, --since <since> (YYYYMMDD)
  • -u, --until <until> (YYYYMMDD)

Optional (nice to have):

  • support ISO date input (YYYY-MM-DD) as well, with clear validation errors

Expected behavior

npx @ccusage/opencode@latest daily --since 20260211 --until 20260223

Returns only rows within the inclusive range.

Notes

Current workaround:

npx @ccusage/opencode@latest daily --json | jq '...'\n```\n\nbut built-in filtering would be much more ergonomic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions