Skip to content

Add collection browsing and metadata discovery commands#29

Merged
andreagrandi merged 1 commit into
masterfrom
collection-commands
May 21, 2026
Merged

Add collection browsing and metadata discovery commands#29
andreagrandi merged 1 commit into
masterfrom
collection-commands

Conversation

@andreagrandi

Copy link
Copy Markdown
Owner

Summary

Adds read-only collection commands so users and agents can browse Metabase collections and discover their contents. Closes #13.

Commands

  • collection list — list all collections
  • collection get <id> — collection details (accepts root, case-insensitive)
  • collection items <id> — cards, dashboards, and nested collections inside a collection, with --models filtering

Notes

  • Collection.ID is typed as any because the Metabase API genuinely returns the root collection with the string id "root" alongside numeric ids (confirmed via smoke testing). JSON output stays natural — numbers as numbers, "root" as a string.
  • Collection lookups use the typed mberr.RequestError / ResourceCollection path, so a 404 is classified as API_ERROR with a collection-specific suggestion.
  • Both --format json and --format table are supported.

Testing

  • 7 client-level tests + 2 CLI integration tests covering listing, item discovery, --models filtering, the root collection, and 404 handling.
  • Full test suite passes (make test); make fmt and make vet clean.
  • Smoke tested against a real Metabase instance: list, get <id>, get root, items <id> (table + JSON), items root --models dashboard, and a 404.

Changelog

Entry added under ## [Unreleased] (#13).

Add read-only collection commands so users and agents can browse
Metabase collections and discover their contents:

- collection list: list all collections
- collection get <id>: collection details (accepts "root")
- collection items <id>: cards, dashboards, and nested collections
  inside a collection, with --models filtering

Collection.ID is typed as any because the Metabase API returns the
root collection with the string id "root" alongside numeric ids.

Closes #13
@andreagrandi andreagrandi merged commit 892d089 into master May 21, 2026
7 checks passed
@andreagrandi andreagrandi deleted the collection-commands branch May 21, 2026 19:58
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.

Add collection browsing and metadata discovery commands

1 participant