Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?

Feature addition

What this PR does / why we need it:

Adds two discovery commands to help users find their organization and project names without opening the web UI.

Changes:

  • API Client (recce_cloud/api/client.py): Added list_organizations() and list_projects(org_id) methods

    • GET /api/v2/organizations - returns user's accessible orgs
    • GET /api/v2/organizations/{org_id}/projects - returns org's projects
  • CLI Commands (recce_cloud/cli.py):

    • recce-cloud list-orgs - displays orgs in table or JSON format
    • recce-cloud list-projects --org <name> - displays projects in table or JSON format
    • Both require RECCE_API_TOKEN environment variable
    • Both support --json flag for machine-readable output
  • Tests: 19 new tests (7 API + 12 CLI) covering success/error paths, output formats, and auth failures

Usage:

# List organizations
$ recce-cloud list-orgs
Organizations
┏━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ ID ┃ Name  ┃ Display Name    ┃
┡━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ 1  │ myorg │ My Organization │
└────┴───────┴─────────────────┘

# List projects with JSON output
$ recce-cloud list-projects --org myorg --json
[
  {"id": 10, "name": "dbt-project", "display_name": "DBT Project"}
]

Which issue(s) this PR fixes:

DRC-2270

Special notes for your reviewer:

Implementation mirrors the existing list-organizations and list-projects commands in the main recce CLI (recce/cli.py) but adapted for the lightweight recce-cloud package which uses RecceCloudClient instead of RecceCloud.

Does this PR introduce a user-facing change?:

Yes. Two new commands enable CLI-based discovery of organizations and projects:

  • recce-cloud list-orgs - list accessible organizations
  • recce-cloud list-projects --org <name> - list projects in an organization

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: even-wei <7878777+even-wei@users.noreply.github.com>
Copilot AI changed the title [WIP] Add list-orgs and list-projects commands to CLI Add list-orgs and list-projects discovery commands to recce-cloud CLI Dec 12, 2025
Copilot AI requested a review from even-wei December 12, 2025 09:59
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