Expert guide for CC Plans Lister, a Go CLI tool that documents Clever Cloud API services including addon providers and application instance types with multi-format output support.
Expert guidance for working with CC Plans Lister, a comprehensive Go CLI application that fetches and documents Clever Cloud API services.
This skill provides expert knowledge for developing, maintaining, and extending the CC Plans Lister tool. It covers the Go codebase architecture, API integration patterns, multi-format output generation (Markdown, TXT, CSV, PDF), CLI design with Cobra, and Clever Cloud API authentication workflows.
When assisting with CC Plans Lister development tasks, follow these guidelines:
Before making changes, familiarize yourself with the modular architecture:
The application follows clean separation of concerns with interface-based design for extensibility.
The API client (`internal/api/client.go`) wraps the official Clever Cloud Go library:
- `/v2/products/addonproviders` - Addon providers and pricing plans
- `/v2/products/instances` - Application types and instance flavors
When extending API functionality:
All formatters implement the `Formatter` interface. When creating a new formatter:
- Summary tables for quick reference
- Detailed plans with pricing and specifications
- Logical grouping by provider/application type
Existing formatters follow these patterns:
The CLI interface uses Cobra framework conventions:
When extending CLI functionality:
Configuration is environment-based with validation:
When adding new configuration:
The project includes comprehensive unit tests:
Testing best practices:
Standard development commands:
```bash
make dev
make fmt # Format code
make vet # Check for issues
make test # Run tests
make build # Build binary
make build-all
make deps
go mod tidy
```
Always run `make dev` before submitting changes to ensure code quality.
Authentication flow:
1. Load `CLEVER_API_TOKEN` from environment
2. Validate token is non-empty
3. Create OAuth-authenticated client using official SDK
4. Make API requests with automatic authentication
When debugging authentication issues:
**Adding a new output format:**
1. Create new formatter in `internal/formatters/`
2. Implement `Formatter` interface
3. Add format to CLI validation
4. Create tests with fixture data
5. Update README with usage examples
**Adding new API endpoints:**
1. Add method to `internal/api/client.go`
2. Define types in `pkg/clevercloud/`
3. Implement sorting if needed
4. Update formatters to include new data
5. Add tests for new functionality
**Extending CLI options:**
1. Define flags in `cmd/cc-plans-lister/main.go`
2. Add validation in config layer
3. Pass options through to formatters or API client
4. Update help text and documentation
**PDF Font Handling:**
**API Rate Limiting:**
**Memory Usage:**
**Error Handling:**
**Generate Markdown documentation:**
```bash
export CLEVER_API_TOKEN="your_token_here"
./bin/cc-plans-lister --format=markdown --output=services.md
```
**Generate CSV for data analysis:**
```bash
./bin/cc-plans-lister --format=csv --output=services.csv
```
**Output PDF report:**
```bash
./bin/cc-plans-lister --format=pdf --output=services.pdf
```
**Development workflow:**
```bash
make dev # Format, vet, test, build
./bin/cc-plans-lister --format=markdown # Test output
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/cc-plans-lister-expert/raw