Skip to content

Feature set: time granularities, row filters, config file, CSV output, and better help #6

Description

@lorecanc

Proposal

I've been using opencode-usage daily and prepared a set of additive features that I'd like to contribute as separate PRs (all are ready, tested, and pass ruff + the existing test suite):

  1. #? feat/db-and-no-llm — wire the --db path override through the CLI (it was only consumed by the insights orchestrator via getattr, with no flag to set it) and add --no-llm for data-only insights reports.
  2. #? feat/time-granularities — group by minute/hour/week/month in addition to day, plus --weeks N / --months N time windows.
  3. #? feat/filters-and-output — row filters (--provider/--model/--agent, repeatable, plus --exclude-provider), --sort cost|calls, a monthly run-rate projection in the summary (also in JSON as run_rate_monthly), and --csv output.
  4. #? feat/config-and-commands — optional ~/.config/opencode-usage/config.toml (defaults for period/grouping/sort and [insights] preferred_models for the model picker), providers / models listing commands sourced from opencode models, and a help subcommand with exhaustive documentation.

Notes on cross-PR plumbing

  • The Filters dataclass is defined identically in PRs 2 and 3 (the granularity PR forwards the future filter parameter through by_time); git deduplicates the identical hunk at merge time.
  • Each PR keeps the existing tests green and adds its own tests; README is updated per PR.

Happy to rework anything to match your preferences (scope, naming, or splitting).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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