- Packet Command Line Interface
- Requirements
- Supported Platforms
- Installation
- Authentication
- Reference
- Example Syntax
- Support
Packet provides an API-driven bare metal platform that combines the automation experience of the cloud with the benefits of physical, bare metal servers.
The Packet CLI wraps the Packet Go SDK allowing interaction with Packet platform from a command-line interface.
- Packet authentication token.
- Packet CLI binaries.
The Packet CLI binaries are available for Linux, Windows, and Mac OS X for various architectures including ARM on Linux.
Extract the appropriate Packet CLI binaries for your platform to the desired location. If the directory is not already in your PATH
environment variable, then it will need to be added.
If you plan to run the Packet CLI in a shell on Linux and placed the binary in /home/YOUR-USER-NAME/packet-cli/, then type the following into your terminal:
export PATH=$PATH:/home/$USER/packet-cli
You can view the current value of $PATH by running:
echo $PATH
If you plan to run the Packet CLI in a shell on a Mac and placed the binary in /Users/YOUR-USER-NAME/packet-cli/, then type the following into your terminal.
export PATH=$PATH:/Users/$USER/packet-cli
You can view the current value of $PATH by running:
echo $PATH
If you plan to run the Packet CLI in PowerShell on Windows and placed the binary in c:\packet-cli, then type the following into PowerShell:
$env:Path += ";c:\packet-cli"
The path can be viewed by running:
echo $env:Path
The Packet authentication token can be stored in the $PACKET_TOKEN
environment variable or in JSON or YAML configuration files. The configuration file path can be overridden with the --config
flag.
Environment variable:
export PACKET_TOKEN=[PACKET_TOKEN]
YAML configuration file - $HOME/.packet-cli.yaml
:
---
token: PACKET_TOKEN
JSON configuration file - $HOME/.packet-cli.json
:
{
"token": "PACKET_TOKEN"
}
After installing Packet CLI, verify the installation by executing packet
or packet.exe
. You should see the default output:
$ packet
Command line interface for Packet Host
Usage:
packet [command]
Available Commands:
device Device operations
facilities Facility operations
help Help about any command
ip IP operations
operating-systems Operating system operations
organization Organization operations
plan Plan operations
project Project operations
ssh-key SSH key operations
user User operations
virtual-network Virtual network operations
volume Volume operations
Flags:
--config string Path to JSON or YAML configuration file
-h, --help help for packet
--version version for packet
Use "packet [command] --help" for more information about a command.
The full CLI documentation can be found here or Daby clicking the links below.
- Device operations
- Facility operations
- IP operations
- Operating system operations
- Organization operations
- Plan operations
- Project operations
- SSH key operations
- User operations
- Virtual network operations
- Volume operations
- VPN operations
packet device create --hostname [hostname] --plan [plan] --facility [facility_code] --operating-system [operating_system] --project-id [project_UUID]
packet volume create --size [size_in_GB] --plan [plan_UUID] --project-id [project_UUID] --facility [facility_code]
packet volume attach --id [volume_UUID] --device-id [device_UUID]
packet device get --id [device_UUID]
packet volume get --id [volume_UUID]
packet project get
packet project get -i [project_UUID]
Details on all available commands can be found by visiting the reference pages or typing packet [command] --help
for more information about the specific command.
For help with this package:
- Open up a GitHub issue here.
- Contact the Packet Community Slack or on Freenode IRC in the #packethost channel.
- Search the Packet Help Center.