Command-line tool
openvicloud is the command-line client of OpenViCloud. It can log you in, show your account (which the CLI calls a tenant), list the clusters, templates and sizes you can pick, create and manage VMs and SSH keys, and open an SSH session to a VM. Networks, volumes, snapshots, firewall rules and load balancers, and paying invoices, are done on the portal.
Install with one command
Section titled “Install with one command”On macOS or Linux, run:
curl -fsSL https://openvicloud.com/install.sh | shThe script picks the file for your operating system and processor, downloads it with SHA256SUMS from the CLI’s latest release on GitHub, and installs nothing if the file does not match its line in SHA256SUMS. It puts openvicloud in /usr/local/bin when it can write there, otherwise in ~/.local/bin, and never asks for sudo. Then it runs openvicloud version, and if the folder it installed into is not on your PATH, it prints the line to add to your shell profile.
A file downloaded with curl carries no quarantine flag, so macOS runs it without the xattr step of the manual install.
On Windows, or to install by hand, follow the steps below.
Download
Section titled “Download”The CLI is published on GitHub: every file below comes from the latest release of OpenViCloud/titan-cli, where its source code is too. Pick the file for your operating system and processor.
| OS | Architecture | Download |
|---|---|---|
| macOS | Apple silicon | openvicloud-darwin-arm64 |
| macOS | Intel | openvicloud-darwin-amd64 |
| Linux | x86_64 | openvicloud-linux-amd64 |
| Linux | arm64 | openvicloud-linux-arm64 |
| Windows | x86_64 | openvicloud-windows-amd64.exe |
| Windows | arm64 | openvicloud-windows-arm64.exe |
Also download SHA256SUMS into the same folder as the binary, to check the download in the next step.
Check the download
Section titled “Check the download”Checksums let you confirm the file downloaded completely and matches the one published with it.
macOS, in the folder where you downloaded both files:
shasum -a 256 -c SHA256SUMS --ignore-missingLinux, in the same folder:
sha256sum -c SHA256SUMS --ignore-missingWindows, in PowerShell:
Get-FileHash .\openvicloud-windows-amd64.exe -Algorithm SHA256(use the file name you downloaded). PowerShell prints the hash in uppercase; SHA256SUMS lists it in lowercase. Compare the two letter by letter, ignoring case.
On macOS or Linux, a correct download prints a line ending in OK, for example openvicloud-darwin-arm64: OK. The --ignore-missing flag skips the lines for files you did not download, instead of failing on them.
Check the signature (optional)
Section titled “Check the signature (optional)”SHA256SUMS is signed with the OpenViCloud release key, fingerprint BB74 B8EC F2BA A232 1296 E3BA 6200 9A5A 7C77 9F46. With GnuPG installed, download the signature and the public key into the same folder and check:
curl -fsSLO https://github.com/OpenViCloud/titan-cli/releases/latest/download/SHA256SUMS.sigcurl -fsSLO https://raw.githubusercontent.com/OpenViCloud/titan-cli/main/openvicloud-release.ascgpg --import openvicloud-release.ascgpg --verify SHA256SUMS.sig SHA256SUMSA correct file prints Good signature from "OpenViCloud Release <[email protected]>". GnuPG may add a warning that the key is not certified by a trusted signature: compare the fingerprint it prints with the one above.
Install
Section titled “Install”macOS and Linux
- Make the file executable and rename it:
(use the file name you downloaded) The binary has no Apple code signature. On macOS, a file downloaded with a browser carries a quarantine flag, and macOS stops the file as soon as it starts: the terminal only prints
Terminal window chmod +x openvicloud-darwin-arm64mv openvicloud-darwin-arm64 openvicloudkilled. Remove the flag before moving the file:Terminal window xattr -d com.apple.quarantine openvicloud - Move it to a directory on your
PATH, for example:Terminal window sudo mv openvicloud /usr/local/bin/
Windows
- Rename the downloaded file to
openvicloud.exe. - Move it to a folder that is on your
PATH.
Log in
Section titled “Log in”openvicloud auth loginThe CLI prints a page to open and a code to check, tries to open your browser to that page, then waits:
To log in, open this page and check that it shows the code <CODE>: https://auth.openvicloud.com/<login page and code>Waiting for you to confirm in the browser...Sign in to OpenViCloud on that page and confirm the code. The CLI then prints:
Logged in to <api> as <username>If you decline the code in the browser, the CLI reports that the login was refused and nothing was saved. If you take too long and the code expires, it tells you to run openvicloud auth login again.
You must have accepted the current terms of service in the portal before commands that talk to your account (such as tenant get and vm ssh) will run. If you have not, the command stops with:
you have not accepted the current terms of service: accept them at <portal>, then run the command againIf you log in before accepting them, auth login still succeeds, and the CLI adds a reminder:
Before you use the CLI, accept the current terms of service at <portal>See sign up and get approved for the terms-of-service step.
Once logged in, your login lasts as long as you run a command that uses your account (such as tenant get or vm ssh) at least once every 30 days; the CLI renews it when needed, without asking you to log in again. The session is stored in a file at ~/.config/openvicloud/session.json (on Windows, under your user profile folder), or under $XDG_CONFIG_HOME/openvicloud/ instead if you have that variable set. On macOS and Linux, that folder and file are set so only you can read them.
Other account commands:
openvicloud auth status— shows who you are logged in as and which API and login server you are using.openvicloud auth logout— revokes the session and deletes it from your computer. If the server cannot confirm the revoke, the file is still deleted, and the command ends with an error saying the session may still be valid on the server until it expires.
Use an API token instead of logging in
Section titled “Use an API token instead of logging in”For CI jobs and scripts, which cannot open a browser, create an API token on the portal and set it in the environment:
export OPENVICLOUD_TOKEN=ovc_...openvicloud vm listWhile OPENVICLOUD_TOKEN is set, every command — vm ssh included — uses the token and ignores the saved login session (which stays on disk). If the API refuses the token, the command says the token in OPENVICLOUD_TOKEN was refused (deleted, expired, or mistyped) instead of asking you to log in. The terms-of-service check still applies.
Commands available today
Section titled “Commands available today”openvicloud auth login/logout/statusopenvicloud tenant get— shows your tenant: ID, name, status, max VMs, max networks, and when it was created.openvicloud cluster list/template list [--cluster <cluster>]/size list— what you can pick when you create a VM.size listshows each size’s vCPUs, memory and price per hour in VND.openvicloud vm list/get/create/rename/add-ssh-key/start/stop/delete— see create and manage VMs and add an SSH key to a VM.openvicloud ssh-key add/list/delete— see SSH keys.openvicloud vm ssh <vm name or id>— opens an SSH session to a VM.openvicloud version— shows the CLI version and the API and login server it talks to.openvicloud helpandopenvicloud completion— built-in help and shell autocompletion scripts.
Every command accepts the -o, --output table (the default) or -o, --output json flag. Commands that print a result (lists, get, tenant get, auth status, version, and the ID a create returns) print it in that format; with json it is the object the API returned, prices with every digit. Commands that only send a request (start, stop, delete, rename) print a line saying the request was sent, which is not part of the output; with --wait, start and stop then print the VM in that format.
Everything else — networks, volumes, snapshots, firewall rules, load balancers, and paying invoices — is done on the portal.
Create and manage VMs
Section titled “Create and manage VMs”Find what to pick, then create the VM:
openvicloud cluster listopenvicloud template list --cluster <cluster>openvicloud size listopenvicloud vm create web-1 --cluster <cluster> --network <network> --template Ubuntu-22.04-Standard --size <size> --ssh-key laptop--cluster, --network, --template and --size are required. The network must already exist (create it on the portal). Network, template, size and SSH key can be given by name or by ID. --ssh-key can be repeated to add several keys; without one you cannot log in over SSH. --disk-size <GB> sets the disk size. If a name does not match, the CLI says which one and creates nothing.
--user-data <file> sends the file’s exact content as cloud-init user data, up to 32768 bytes UTF-8 — the same limit the server checks. A missing file, one over the limit, or one that is not valid UTF-8 is an error before anything is sent, and nothing is created. Without this flag, no user data is sent:
openvicloud vm create web-1 --cluster <cluster> --network <network> --template Ubuntu-22.04-Standard --size <size> --ssh-key laptop --user-data cloud-init.yaml--console-password-stdin reads a console password (12 to 72 characters) from standard input, to log in as ubuntu on the VM’s console. The CLI never takes the password on the command line, where other users of the machine and the shell history would see it. Everything on standard input is the password, less one line end at its end; empty input is refused and nothing is created:
openvicloud vm create web-1 --cluster <cluster> --network <network> --template Ubuntu-22.04-Standard --size <size> --console-password-stdin < console-password.txtThe create prints the new VM’s ID. The VM is then created in the background; add --wait to wait until it is Running or Ready and print it:
openvicloud vm create web-1 --cluster <cluster> \ --network <network> --template Ubuntu-22.04-Standard \ --size <size> --ssh-key laptop --waitFirst the CLI prints a line, then it waits and prints the VM. A field with no value, such as the public IPv6 address of a VM whose network has none, shows -:
Creating VM web-1, waiting until it is Running or Ready...ID: <VM ID>Name: web-1Cluster: <cluster ID>Status: RunningIPv4: <IPv4 address>Public IPv6: <public IPv6 address>Network: <network ID>Size: <size ID>Template: <template ID>Disk GB: <disk size>Created: <time created>If the network drops while the create is being sent, the CLI sends it again, up to three sends in all. Each send carries the same request key, so you still get one VM.
Other VM commands take the VM’s name or ID:
openvicloud vm list— your VMs (not deleted ones): name, ID, cluster, status, IPv4 address.openvicloud vm get <vm>— one VM in detail, including the reason if its creation failed.openvicloud vm stop <vm>/vm start <vm>— stop a VM, or start a stopped one (startalso resumes a Frozen VM). A stopped VM is not billed for compute. The CLI cannot set or show the stop timeout yet; use the portal.stopshuts the VM down as the portal’s Stop does, waiting up to its stop timeout.openvicloud vm rename <vm> <new name>openvicloud vm delete <vm>— asks you to typeybefore it deletes the VM and its disk;--yesskips the question.
create, start, stop and delete take --wait, and --timeout (default 10m) to change how long it waits. The CLI checks the VM every 5 seconds until its request is done:
createandstartsucceed when the VM is Running or Ready,stopwhen it is Stopped,deletewhen the VM is deleted.- If the request ends another way — the creation failed, or the VM is in another state — the command prints why and ends with exit code 1.
- If the time runs out, the command says which state the VM is still in and ends with exit code 1;
openvicloud vm get <vm>shows how it goes on. - For
stop --wait, give a--timeoutlonger than the VM’s stop timeout, for example--timeout 35mfor a stop timeout of 30 minutes.
Without --wait, the command returns as soon as the request is accepted. See VM states for what each state means.
Add an SSH key to a VM
Section titled “Add an SSH key to a VM”openvicloud vm add-ssh-key web-1 --ssh-key laptopAdds one or more of your SSH keys to a VM that is already running. --ssh-key can be repeated to add several keys, 1 to 10; the same key named twice counts once. Unlike create, start, stop and delete, this command waits by default until the key addition is Added or Failed before it prints anything, since that is when there is something worth printing — whether the VM needs a stop and a start before the key takes effect, or why it failed. --no-wait prints the addition’s ID at once instead; --timeout (same default as the other waiting commands) changes how long it waits.
SSH keys
Section titled “SSH keys”openvicloud ssh-key add laptop --public-key-file ~/.ssh/id_ed25519.pubopenvicloud ssh-key listopenvicloud ssh-key delete laptopadd reads the public key from the file and prints the new key’s ID. list shows each key’s name, ID, type and fingerprint. delete asks you to type y first (--yes skips the question); VMs that already have the key keep it. See SSH keys for which key types are accepted and the limits.
SSH into a VM
Section titled “SSH into a VM”openvicloud vm ssh <vm name or id>This uses the ssh program already on your system, so it must be installed and on your PATH — otherwise the CLI reports ssh is not installed or not on PATH. The VM must:
- have one of your SSH keys selected when it was created, and
- be in the Running or Ready state.
The VM does not need a public address: OpenViCloud relays the session, so this works on any network.
By default the CLI logs in as the ubuntu user, which is who your picked SSH key is added for. Use --user <name> to log in as someone else.
Anything after -- is passed to ssh, for example to choose a key or run a single command instead of opening a shell:
openvicloud vm ssh web-1 -- -i ~/.ssh/id_ed25519openvicloud vm ssh web-1 -- uptimeThe second command prints what uptime prints on the VM, for example:
10:42:17 up 3 min, 0 users, load average: 0.12, 0.05, 0.01The command’s exit code is ssh’s own exit code.
Notes:
- Your account can have at most 5 SSH or console sessions open at the same time (shared across everyone on the account; see the VM console). A session that sits idle for 30 minutes is closed.
- Right after a VM starts,
vm sshmay fail for a few minutes withVM_AGENT_NOT_READYorVM_SSH_NOT_READY(see error codes) while the VM finishes booting. If that happens, wait a short while and try again. - If the name or ID does not match one of your VMs, the CLI prints
no VM named "<name>" in your tenant: see your VMs on the portal. - If the session is refused for another reason (for example the VM is not Running or Ready), the CLI prints an error. Check the VM’s state on the portal and try again once it is Running or Ready.
Understanding errors
Section titled “Understanding errors”When a command fails, the CLI explains common error codes in its own words — for example, that your account is not a member of a tenant, that your tenant is suspended, or that it is still waiting for approval. If your session is no longer accepted, the CLI tells you to run openvicloud auth login again; if you use OPENVICLOUD_TOKEN, it says the token was refused.
For the full list of error codes and what they mean, see error codes.
