2. Getting Started
This chapter covers Prerequisites and Installation, Checking Your Version, and Interactive Sessions.
2.1 Prerequisites and Installation
- A reachable VDURA appliance (PanAPI endpoint), typically on port
8000. - A tenant-qualified administrator username and password or a pre-issued API token (see Section 3).
- The
panctlbinary for your platform, placed anywhere on yourPATH. To download it, click Download PanCTL on the Vantage Get Help page. The page offers builds for Linux and macOS, on amd64 and arm64, with a checksum for each file.
There is nothing to configure before first use; no config file is required to exist, and PanCTL will create one for you on first login.
2.2 Checking Your Version
panctl --version
# or
panctl -VThis prints the version and exits immediately; it does not contact the appliance.
2.3 Interactive Sessions
Running panctl with no arguments on a terminal opens an interactive session. Every other invocation works as it always has.
$ panctl
[lab] platform/admin> volumes list
[lab] platform/admin> /format json
[lab] platform/admin> volumes get vol-1
[lab] platform/admin> /exit
A session opens only when no command was named and both standard input and standard output are terminals. panctl --profile lab opens a session on the profile lab because the flag takes the name as its value. If terminal detection gets it wrong, as it can in a terminal multiplexer, an IDE terminal, or ssh without a pseudo-terminal, panctl shell forces a session.
The prompt and banner. The default prompt is [<profile>] <username>>. It carries both the profile and the authenticated user because profiles can share usernames and one username can serve several appliances. The server, profile, user, and PanCTL version are written once to standard error when the session opens, so a captured session holds command results alone. (expired) appears in the prompt only after a request has actually been answered with 401, so its absence does not mean the session is valid. Set PANCTL_PROMPT to change the format. The fields are {profile}, {username}, {server}, and {marker}, and an unknown field is refused when the session opens.
Commands. Anything you type without a leading / is an ordinary PanCTL command, with the same flags, output, and exit handling as one-shot mode. Quoting is shell-like (single quotes are literal, double quotes group, and a backslash escapes), but there is no expansion, globbing, piping, or redirection, so | and > reach the command as ordinary text. A failing command reports itself and returns you to the prompt. Commands that ask for confirmation work as usual; see 5.10.
| Session command | Effect |
|---|---|
/profile <name> |
Use another profile for the following commands. Nothing is written to disk; profiles use, typed without the slash, is still the persistent form. |
/format <value> |
Set the output format, using exactly the values --format accepts. A command’s own --format wins for that command. |
/help |
List the session commands |
/clear |
Clear the screen |
/exit, /quit |
Leave the session |
No session tenant. A session carries no tenant of its own because --tenant is not uniform across the command tree, and a sticky one would be honored by some commands and quietly ignored by others. Name the tenant on each command with --tenant, as in one-shot mode.
Keys and history. Tab completes commands and values from the same source the shell completion uses (see Chapter 9). The Up and Down keys recall earlier lines, which are kept in ~/.panctl/history (created readable by you alone). Ctrl-C once cancels the running command and returns you to the prompt, and pressing it twice within a second leaves the session, as do Ctrl-D and /exit. auth login typed inside a session reads its password through the session, and interrupting it abandons that login only.
Exit status. A session exits 0 on any clean exit, whatever the commands inside it did, because the code describes the session and not the last command. Use one-shot mode when you need a command’s own exit code.