ovhcloud-cli/doc/ovhcloud.md
scraly b42af9ca11 feat: services renaming/improving
Signed-off-by: scraly <scraly@gmail.com>
2025-09-29 13:56:02 +02:00

8.2 KiB
Raw Permalink Blame History

OVHcloud CLI (ovhcloud) Documentation


Overview

ovhcloud is a single, unified commandline interface for managing the full range of OVHcloud products and account resources directly from your terminal. Whether you need to automate provisioning, perform quick lookups, or integrate OVHcloud operations into CI/CD pipelines, ovhcloud offers finegrained commands and consistent output formats (table, JSON, YAML, or custom gval expressions).


Quick Start

# Display the toplevel help
ovhcloud --help

# Log in and create API credentials (interactive)
ovhcloud login

# List your VPS instances as JSON
ohvcloud vps list --json

Check out the authentication page for further information about the authentication means.

Generate Shell Completion

# Bash
eval "$(./ovhcloud completion bash)"
# Zsh
eval "$(./ovhcloud completion zsh)"
# Fish
./ovhcloud completion fish | source
# PowerShell
./ovhcloud completion powershell | Out-String | Invoke-Expression

Add the appropriate line to your shells startup file (~/.bashrc, ~/.zshrc, etc.) to enable persistent autocompletion.


Global Usage

ovhcloud [command] [flags]

Global Flags

Flag Description
--debug Activate debug mode (logs all HTTPrequest details).
--ignore-errors Ignore errors of API calls made when listing items.
--format <expr> Format output with a gval expression.
--filter <expr> Filter lists output with a gval expression.
-h, --help Display help for ovhcloud or a specific command.
--interactive Produce interactive (promptbased) output.
--json Output data in JSON format.
--yaml Output data in YAML format.

Filtering examples

  • Strict string equality: --filter 'name=="something"'
  • String regexp comparison: --filter 'name=~"something"'
  • Number comparison: --filter 'bootId > 1'

Formatting example

  • Extract only one field: --format 'ip'
  • Extract an object: --format '{name: ip}'

Command Reference

Below is the full list of primary subcommands available at the time of writing. Each can be explored in depth with ovhcloud <command> --help.

Tip  Use --json, --yaml, or --format with a gval expression to integrate ovhcloud into scripts and automation pipelines.


Examples

Task Command
Log in and save credentials ovhcloud login
List VPS instances (tabular) ovhcloud vps list
Fetch details of a single VPS in JSON ovhcloud vps get <service_id> --json
Reinstall a baremetal interactively ovhcloud baremetal reinstall <id> --editor

Troubleshooting

  • Verbose output — Use --debug to inspect raw API calls and responses.
  • Authentication issues — Run ovhcloud login again to regenerate valid API keys.
  • Rate limits — OVHcloud APIs impose rate limits; plan retries or exponential backoff in scripts.

Further Reading