Skip to content

CLI Improvements: Pagination, Shell Completion, Config, and Debug#383

Open
poyrazK wants to merge 7 commits intomainfrom
release/cli-improvements
Open

CLI Improvements: Pagination, Shell Completion, Config, and Debug#383
poyrazK wants to merge 7 commits intomainfrom
release/cli-improvements

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented May 2, 2026

Summary

  • SDK Retry Logic: Add SetRetryCount(3) with automatic retry on 5xx server errors and 429 rate limits
  • SDK Pagination: Add ListResponse[T] struct and getWithPagination() method for paginated list requests
  • Shell Completion: Add cloud completion [bash|zsh|fish|powershell] command
  • Config Command: Add cloud config show|set|unset for persistent configuration in ~/.cloud/config.json
  • Output Formats: Add --output table|json|yaml flag (default: table), deprecate --json alias
  • Debug Mode: Add --debug flag to enable REST API call tracing
  • Pagination Flags: Add --limit and --offset flags to list commands:
    • instance list
    • function list
    • container list
    • storage list
    • ssh-key list
    • instance-type list
  • Documentation: Updated cli-reference.md and README.md with new CLI features

Test plan

  • go build ./cmd/cloud/ - compiles successfully
  • go test ./cmd/cloud/... - all tests pass
  • go build ./pkg/sdk/... - SDK compiles successfully
  • go test ./pkg/sdk/... - SDK tests pass

poyrazK added 7 commits May 2, 2026 22:13
- Add SetRetryCount(3) with retry on 5xx and 429 errors
- Add ListResponse[T] struct with Data, TotalCount, HasMore fields
- Add getWithPagination() method for paginated requests
- Add ListXxxWithPagination() methods for instances, functions, containers, buckets, SSH keys, instance types
- Enable Cobra shell completion generation
- Add cloud completion [bash|zsh|fish|powershell] command
- Add cloud config show|set|unset command for persistent configuration
- Add --output, --debug global flags
- Store config in ~/.cloud/config.json with api_key, api_url, output, tenant, debug
- Add --limit and --offset flags to instance list, function list
- Display pagination metadata: "Showing X of Y total (more available)"
- Add YAML output support via --output yaml flag
- Enhance printOutput() to handle table/json/yaml formats
- Add --limit and --offset flags to container list and storage list
- Update container_cli_test.go to use Response wrapper format
- Add --limit and --offset flags to both commands
- Display pagination metadata when results are paginated
- Add global flags documentation (--output, --api-url, --debug)
- Add cloud config command section
- Add pagination section with usage examples
- Add shell completion section
- Add container commands section
- Add CLI Enhancements to Recent Improvements in README
- Add ListDeploymentsWithPagination method
- Add ListBucketsWithPagination method
- Fix test response format to use Response wrapper
Copilot AI review requested due to automatic review settings May 2, 2026 19:14
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 28 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eaf8a583-0352-45d0-8830-d251d49684c9

📥 Commits

Reviewing files that changed from the base of the PR and between c65c38a and 1b36b4e.

📒 Files selected for processing (18)
  • README.md
  • cmd/cloud/common.go
  • cmd/cloud/config.go
  • cmd/cloud/container.go
  • cmd/cloud/container_cli_test.go
  • cmd/cloud/function.go
  • cmd/cloud/instance.go
  • cmd/cloud/instance_type.go
  • cmd/cloud/main.go
  • cmd/cloud/ssh_key.go
  • cmd/cloud/storage.go
  • docs/cli-reference.md
  • pkg/sdk/client.go
  • pkg/sdk/compute.go
  • pkg/sdk/container.go
  • pkg/sdk/container_test.go
  • pkg/sdk/function.go
  • pkg/sdk/storage.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/cli-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 19 minutes and 28 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread cmd/cloud/config.go
os.Exit(1)
}

fmt.Printf("[SUCCESS] %s set to %s\n", key, value)
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

3 participants