Skip to content

feat: add --project and --exclude filters for project-level filtering - #52

Merged
AgentSeal merged 1 commit into
getagentseal:mainfrom
mallek:feature/project-filter
Apr 16, 2026
Merged

AgentSeal merged 1 commit into
getagentseal:mainfrom
mallek:feature/project-filter

Conversation

@mallek

@mallek mallek commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #12 (item 1 — per-project drill-down).

Summary

Adds two new repeatable CLI flags to all commands (report, today, month, status, export):

  • --project <name> — include only projects matching name (case-insensitive substring match)
  • --exclude <name> — exclude projects matching name (case-insensitive substring match)

Both flags are repeatable to match multiple projects:

codeburn report --exclude myapp --exclude tests
codeburn month --project api --project web

Filters can be combined with the existing --provider flag.

Motivation

When tracking multiple projects, it's useful to isolate costs to a specific project or hide noisy projects from aggregate totals. The --provider flag exists for tool-level filtering, but there was no way to filter by project.

Changes

  • src/parser.ts — new filterProjectsByName() function supporting include/exclude arrays
  • src/cli.ts — --project and --exclude options on all commands, repeatable via Commander collect pattern
  • src/dashboard.tsx — thread filters through to interactive dashboard and reload callbacks
  • README.md — documented project filtering with examples

Test plan

  • status --format json totals match: --project X + --exclude X ≈ unfiltered total
  • Multiple values: --exclude a --exclude b excludes both
  • Multiple values: --project a --project b includes both
  • --help shows new flags on all commands
  • Clean build with tsup

🤖 Generated with Claude Code

Adds two new repeatable flags to all commands (report, today, month, status, export):
- --project <name>: include only projects matching name (substring, case-insensitive)
- --exclude <name>: exclude projects matching name (substring, case-insensitive)

Both flags can be specified multiple times to match multiple projects.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@mallek
mallek force-pushed the feature/project-filter branch from 84e562c to 67c504a Compare April 16, 2026 21:54
AgentSeal pushed a commit that referenced this pull request Apr 16, 2026
feat: add --project and --exclude filters for project-level filtering
@AgentSeal
AgentSeal merged commit 67c504a into getagentseal:main Apr 16, 2026
2 checks passed
@AgentSeal

Copy link
Copy Markdown
Collaborator

Merged, thanks for the contribution!

Added two follow-up commits on top before merging:

  • Unit tests for filterProjectsByName covering include OR, exclude AND-negation, case-insensitivity, path vs name matching, empty-string edge case, and input immutability.
  • Small fix so status --format menubar applies the filter to the per-provider today breakdown too (the main period blocks already did, that one loop was missed).

Landed in main as 87210da. Will be in the next release.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants