How civo/cli works
Civo CLI is a terminal client for managing Civo account and cloud resources. The principal workflow is a user invoking a Cobra command, which selects a resource operation, obtains a region-aware API client, calls Civo’s API, and formats the response for terminal or machine-readable output. The command tree covers compute, networking, Kubernetes, databases, storage, and account resources. README capabilities and the file tree support those broad branches; sampled source confirms API-client use, output handling, database operations, and Kubernetes kubeconfig integration, but not every command’s internal wiring.
Main entry points: root.go Command entry · config.go Civo API client · database Databases and backups · instance Instances and snapshots
Components 21
CLI and settings
- Command entry
cmd/root.go - Credentials and region
config/config.go - Civo API client
config/config.go - Output formatting
utility/output_writer.go
Compute and network
- Instances and snapshots
cmd/instance - Networks and VPC
cmd/vpc - Firewalls and IPs
cmd/firewall - Volumes and images
cmd/volume
Kubernetes
- Clusters and node pools
cmd/kubernetes - Kubeconfig integration
utility/kubernetes.go
Data services
- Domains and records
cmd/domain - Databases and backups
cmd/database - Object stores
cmd/objectstore
Account resources
- API keys
cmd/apikey - Teams and permissions
cmd/teams - Regions and sizes
cmd/region - Quota
cmd/quota.go - Resource snapshots
cmd/resourcesnapshot - Other cloud resources
cmd/loadbalancer
Other components
- CLI user
- Civo API
Connections 38
- CLI user → Command entry: invokes
- Command entry → Credentials and region: loads settings
- Command entry → Instances and snapshots: dispatches
- Command entry → Networks and VPC: dispatches
- Command entry → Firewalls and IPs: dispatches
- Command entry → Volumes and images: dispatches
- Command entry → Clusters and node pools: dispatches
- Command entry → Domains and records: dispatches
- Command entry → Databases and backups: dispatches
- Command entry → Object stores: dispatches
- Command entry → API keys: dispatches
- Command entry → Teams and permissions: dispatches
- Command entry → Regions and sizes: dispatches
- Command entry → Quota: dispatches
- Command entry → Resource snapshots: dispatches
- Command entry → Other cloud resources: dispatches
- Credentials and region → Civo API client: configures
- Instances and snapshots → Civo API client: requests
- Networks and VPC → Civo API client: requests
- Firewalls and IPs → Civo API client: requests
- Volumes and images → Civo API client: requests
- Clusters and node pools → Civo API client: requests
- Domains and records → Civo API client: requests
- Databases and backups → Civo API client: requests
- Object stores → Civo API client: requests
- API keys → Civo API client: requests
- Teams and permissions → Civo API client: requests
- Regions and sizes → Civo API client: requests
- Quota → Civo API client: requests
- Resource snapshots → Civo API client: requests
- Other cloud resources → Civo API client: requests
- Civo API client → Civo API: calls
- Databases and backups → Civo API: creates database
- Databases and backups → Civo API: lists backups
- Clusters and node pools → Kubeconfig integration: updates config
- Instances and snapshots → Output formatting: formats results
- Databases and backups → Output formatting: formats results
- Quota → Output formatting: formats results