Introduction
Theubi CLI is a command-line tool for managing Ubicloud infrastructure resources. It provides a unified interface to create, manage, and monitor virtual machines, databases, Kubernetes clusters, and other cloud resources.
Architecture
The Ubicloud CLI uses a unique architecture where the Go wrapper (ubi) sends command arguments to the Ubicloud API, which then processes them on the server side using Ruby-based command handlers. This approach provides several benefits:
- Centralized command logic: Command validation and processing happens server-side
- Automatic updates: New commands and features are available without updating the client
- Secure execution: Sensitive operations like SSH connections are validated server-side
- Consistent behavior: All clients get the same command behavior
How It Works
- The
ubiCLI wrapper sends command arguments tohttps://api.ubicloud.com/cli - The API validates the command and authenticates using your
UBI_TOKEN - The server processes the command and returns the appropriate response
- For special commands (SSH, PostgreSQL tools), the server returns validated arguments
- The CLI wrapper executes the appropriate tool locally with server-validated parameters
Available Resources
The CLI provides commands for managing:Virtual Machines
Create and manage VMs with SSH access
PostgreSQL
Deploy and manage PostgreSQL databases
Kubernetes
Create and manage Kubernetes clusters
Load Balancers
Configure load balancers for your applications
Firewalls
Manage network firewall rules
Private Subnets
Create isolated network subnets
SSH Keys
Register and manage SSH public keys
AI Inference
Manage AI inference API keys
GitHub Integration
Integrate with GitHub Actions
Command Structure
Ubicloud CLI commands follow a consistent pattern:Resource Types
vm- Virtual machinespg- PostgreSQL databaseskc- Kubernetes clusterslb- Load balancersfw- Firewallsps- Private subnetssk- SSH keysai- AI inferencegh- GitHub integration
Identifier Formats
Resources can be identified by:- Name with location:
location/resource-name(e.g.,eu-central-h1/my-vm) - ID:
resource-id(e.g.,vm-abc123)
Common Actions
list- List all resources of a typecreate- Create a new resourceshow- Display detailed informationdestroy- Delete a resourcerename- Change resource name
Getting Help
Get help for any command:Debug Mode
Enable debug output to see detailed request/response information:- Arguments sent to the API
- Commands being executed locally
- Validation steps
Environment Variables
See Authentication for details on required environment variables.Next Steps
Install the CLI
Get started by installing the ubi CLI
Authentication
Set up your access token
Virtual Machines
Create your first VM
PostgreSQL
Deploy a database