Skip to content

feat: add environments list command#10

Merged
davebarnwell merged 4 commits intomainfrom
feature/add-environments-list-command
Mar 7, 2026
Merged

feat: add environments list command#10
davebarnwell merged 4 commits intomainfrom
feature/add-environments-list-command

Conversation

@davebarnwell
Copy link
Copy Markdown
Owner

@davebarnwell davebarnwell commented Mar 7, 2026

Summary

This PR expands the Rollbar CLI in two related areas that were missing from the existing surface.

First, it adds rollbar-cli environments list so users can discover valid Rollbar environment names before applying --environment filters elsewhere in the CLI. The implementation adds environment support to the Rollbar client, follows environment pagination until Rollbar returns an empty page, preserves fetched raw pages for raw-json output, and exposes the results in text, JSON, NDJSON, and aggregated raw JSON forms.

Second, it adds deploy support across all four Rollbar deploy endpoints. The CLI now supports rollbar-cli deploys list, rollbar-cli deploys get, rollbar-cli deploys create, and rollbar-cli deploys update, with the command flags narrowed to match the documented API contract. That includes paged deploy listing, deploy lookup by ID, deploy creation with the documented deploy metadata fields, and deploy status updates through the update endpoint.

The PR also adds dedicated UI renderers and tests for the new resources, updates client normalization and request coverage, wires the new commands into the root command tree, and refreshes the README and bundled Rollbar skill documentation so agent workflows and manual usage examples stay aligned with the shipped CLI behavior.

Validation

Validated with go test ./....

@davebarnwell davebarnwell marked this pull request as ready for review March 7, 2026 16:48
Copilot AI review requested due to automatic review settings March 7, 2026 16:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an environments list top-level CLI command to enumerate Rollbar environments (useful for discovering valid --environment filter values), with support in the Rollbar client, UI rendering, tests, and docs.

Changes:

  • Introduces rollbar-cli environments list with text/JSON/NDJSON/raw-json output modes.
  • Adds Rollbar client support for listing environments across pages and normalizing the API response into a stable Environment shape.
  • Adds a text table renderer + tests, plus README and skill documentation updates.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/ui/environments_table.go New text renderer for environments with field selection and headers.
internal/ui/environments_table_test.go Tests for plain rendering and empty-state messaging.
internal/rollbar/client.go Adds Environment types and ListEnvironments() implementation with normalization + pagination.
internal/rollbar/client_test.go Tests ListEnvironments() pagination and result normalization (including fallback field names).
cmd/environments.go New environments command group with list subcommand and output modes.
cmd/environments_cmd_test.go CLI tests for JSON pagination and raw-json page aggregation behavior.
cmd/root.go Wires the new environments command into the root command.
README.md Documents the new environments functionality and examples.
.ai/skills/rollbar-cli/SKILL.md Updates bundled skill docs to include the new command and workflow guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@davebarnwell davebarnwell merged commit c0ee8fb into main Mar 7, 2026
1 check passed
@davebarnwell davebarnwell deleted the feature/add-environments-list-command branch March 7, 2026 17:31
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