Skip to main content

Overview

The Polystack command-line interface gives you full control over every platform service directly from your terminal. With a single authenticated session you can provision instances, manage volumes, configure networks, and automate infrastructure workflows — without opening a browser. The CLI is compatible with all major operating systems and integrates cleanly into CI/CD pipelines and shell scripts.
Prerequisites
  • An active Polystack account with project access
  • Python 3.8 or later installed on your workstation
  • Network access to your OpenStack API endpoint

Installation

Install the Polystack CLI using the package manager for your operating system.
Install on Ubuntu / Debian
Install into a virtual environment to avoid conflicts with system Python packages: python3 -m venv ~/.polystack-cli && source ~/.polystack-cli/bin/activate && pip install python-openstackclient
Confirm the installation completed successfully:
Verify installation
The command prints the installed version, e.g., openstack 6.x.x.

Authentication

The CLI authenticates using an RC (credentials) file that sets environment variables for your session. Your administrator provides this file, or you can create it manually.
1

Obtain your RC file

Your administrator provides the RC (credentials) file for your project. This file contains the authentication endpoint, project name, and your username.Alternatively, create the file manually with the following content:
openrc.sh
Each project has its own RC file. Ask your administrator for the correct OS_AUTH_URL and OS_PROJECT_NAME values for your environment.
2

Source the credentials file

Open a terminal and source the file to load your credentials into the current shell session:
Load credentials
Enter your Polystack account password when prompted.

Verify authentication

Confirm the CLI can authenticate successfully:
Verify token
A valid response displays a token ID, expiry, and your project details.
Authentication is working. Your session is valid for 1 hour by default.
The RC file exports the following environment variables to configure the CLI client. You can also set these manually or store them in a clouds.yaml file for multi-cloud management.

Command Structure

Every CLI command follows the same pattern: resource type, action, and optional flags.
Most commands accept either the resource name or UUID as the final argument. Use UUIDs in scripts to avoid ambiguity when multiple resources share the same name.

Output Formats

The CLI supports multiple output formats controlled by the --format flag.

Tips and Tricks

Add aliases to your shell profile (~/.bashrc or ~/.zshrc) to speed up repetitive tasks:
Recommended aliases (~/.bashrc)
Reload your shell after adding aliases:
Reload shell config
The CLI ships with a completion script that enables tab-completion for commands, resource names, and flags.
Enable bash completion
Enable zsh completion
After reloading your shell, press Tab after any partial command to see available completions.
Pass --debug to any command to print the full HTTP request and response, including headers and token details. This is useful for diagnosing authentication errors or unexpected API responses.
Debug a failing command
Debug output includes your authentication token. Avoid sharing or storing this output in logs or tickets.
Instead of sourcing separate RC files, define all your environments in a single clouds.yaml file stored at ~/.config/openstack/clouds.yaml:
~/.config/openstack/clouds.yaml
Switch between environments using --os-cloud:
Use a named cloud profile
Set OS_CLOUD=polystack-prod in your shell to make a profile the default for all commands in that session.

Service CLI References

Each service has a dedicated CLI reference with complete command syntax, options, and examples.

Compute CLI

Instances, flavors, keypairs, server groups, console, and live migration commands.

Block Storage CLI

Volumes, snapshots, backups, volume types, and cross-project transfers.

Networking CLI

Networks, subnets, routers, floating IPs, security groups, and ports.

Images CLI

Upload, download, share, and manage virtual machine images.

Orchestration CLI

Heat stacks, resources, events, outputs, and template validation.

Identity CLI

Projects, users, roles, groups, and application credentials.

Load Balancer CLI

Load balancers, listeners, pools, members, and health monitors.

DNS CLI

Zones, record sets, PTR records, and zone transfers.

Key Manager CLI

Secrets, containers, orders, and access control lists.

Object Storage CLI

Containers, objects, large object uploads, and temporary URLs.

Kubernetes CLI

Cluster templates, clusters, and node group management.