5. Global Options
5.1 Persistent Flags
These flags are available on every PanCTL command:
| Flag | Purpose |
|---|---|
--profile <name> |
Use a specific profile for this command only |
--format, -o <format> |
Set the output format (see below) |
--no-color |
Disable colored table output |
--token <value> |
Use a pre-issued API token for this command |
--token-stdin |
Read a pre-issued API token from standard input |
--version, -V |
Print the version and exit |
5.2 Environment Variables
| Variable | Effect |
|---|---|
PANCTL_PROFILE |
Selects the active profile for one invocation without changing the saved default |
PANCTL_API_SERVER |
Appliance address (used as a fallback in login mode, required in token mode) |
PANCTL_USERNAME |
Default username for auth login |
PANCTL_PASSWORD |
Default password for auth login (prefer --password-stdin; environment variables can leak via process listings) |
PANCTL_API_TOKEN |
Pre-issued token for the whole session (requires PANCTL_API_SERVER) |
PANCTL_API_INSECURE |
Set to 1/true/yes/on to skip TLS verification in token mode |
5.3 Output Formats
Use --format (or the shorter -o) to control how results are printed:
| Format | Description |
|---|---|
table |
Aligned, bolded-header columns. Default when output goes to a terminal. |
plain |
Aligned columns without color. Default when output is piped or redirected. |
raw |
The API’s response body, unmodified. |
json |
The response body, pretty-printed with 2-space indentation. |
jsonpath=<expression> |
Extracts specific fields using kubectl-style JSONPath, ideal for scripting. |
JSONPath examples:
panctl volumes list --format 'jsonpath={.volumes[*].pathname}'
panctl volumes list --format \
'jsonpath={range .volumes[*]}{.id}{"\t"}{.pathname}{"\n"}{end}'
panctl nodes list --format \
'jsonpath={.nodes[?(@.role=="vosd" || @.role=="vhost" && @.storageset_id==0)].dataserial}'Supported JSONPath features include field access, bracket-quoted keys (for hyphenated names, e.g. {.['storage-admin']}), array indices including [-1], wildcards, filter expressions (==, !=, <, <=, >, >=, joined with &&/||), and {range ...}{end} loops. It does not support recursive descent (..) or listing an object’s keys; for that, pipe --format json into jq 'keys'.
A
yamlformat is planned but not yet available in the current release.
5.4 Command Aliases
Most command groups have one or more short aliases (spelled out exactly, no partial-name matching):
| Group | Aliases |
|---|---|
auth |
au, a |
profiles |
profile, pr, p |
realm |
rlm |
roles |
role, ro, r |
volumes |
volume, vol, v |
nodes |
node, no, n |
storagesets |
storageset, ss, s |
tenants |
tenant, tn, tx, t |
users |
user, us, u |
service-accounts |
sa |
s3 |
(none) |
events |
ev, e |
alerts |
al |
subnets |
subnet, sub, sn |
audit |
aud, ad |
5.5 Exit Codes
| Code | Meaning |
|---|---|
0 |
Success |
1 |
General failure (API error, validation error) |
2 |
Unknown output format or malformed JSONPath expression |
3 |
A pre-issued API token was rejected |