CLI Improvements: Pagination, Shell Completion, Config, and Debug#383
CLI Improvements: Pagination, Shell Completion, Config, and Debug#383
Conversation
- 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
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (18)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 19 minutes and 28 seconds.Comment |
| os.Exit(1) | ||
| } | ||
|
|
||
| fmt.Printf("[SUCCESS] %s set to %s\n", key, value) |
Summary
SetRetryCount(3)with automatic retry on 5xx server errors and 429 rate limitsListResponse[T]struct andgetWithPagination()method for paginated list requestscloud completion [bash|zsh|fish|powershell]commandcloud config show|set|unsetfor persistent configuration in~/.cloud/config.json--output table|json|yamlflag (default: table), deprecate--jsonalias--debugflag to enable REST API call tracing--limitand--offsetflags to list commands:instance listfunction listcontainer liststorage listssh-key listinstance-type listcli-reference.mdandREADME.mdwith new CLI featuresTest plan
go build ./cmd/cloud/- compiles successfullygo test ./cmd/cloud/...- all tests passgo build ./pkg/sdk/...- SDK compiles successfullygo test ./pkg/sdk/...- SDK tests pass