Skip to main content

Introduction

The ubi 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

  1. The ubi CLI wrapper sends command arguments to https://api.ubicloud.com/cli
  2. The API validates the command and authenticates using your UBI_TOKEN
  3. The server processes the command and returns the appropriate response
  4. For special commands (SSH, PostgreSQL tools), the server returns validated arguments
  5. 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:
ubi <resource> <identifier> <action> [options] [arguments]

Resource Types

  • vm - Virtual machines
  • pg - PostgreSQL databases
  • kc - Kubernetes clusters
  • lb - Load balancers
  • fw - Firewalls
  • ps - Private subnets
  • sk - SSH keys
  • ai - AI inference
  • gh - 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 type
  • create - Create a new resource
  • show - Display detailed information
  • destroy - Delete a resource
  • rename - Change resource name

Getting Help

Get help for any command:
# General help
ubi help

# Command-specific help
ubi help vm
ubi help vm create

# Show all subcommands recursively
ubi help -r vm

# Show only usage syntax
ubi help -u vm

Debug Mode

Enable debug output to see detailed request/response information:
export UBI_DEBUG=1
ubi vm list
This will show:
  • 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

Build docs developers (and LLMs) love