Command-line interface for packet.ai GPU cloud
npm install packet-gpu-cliCommand-line interface for packet.ai GPU cloud.
``bash`
npm install -g packet-gpu-cli
`bashLogin to your packet.ai account
packet login
Commands
$3
| Command | Description |
|---------|-------------|
|
packet login | Authenticate with your API key |
| packet logout | Remove stored credentials |
| packet whoami | Show current account and balance |$3
| Command | Description |
|---------|-------------|
|
packet gpus | List available GPU types and pricing |
| packet launch --gpu | Launch a new GPU instance |
| packet ps | List your running instances |
| packet ssh | SSH into an instance |
| packet logs | View instance status and info |
| packet terminate | Terminate an instance |$3
| Command | Description |
|---------|-------------|
|
packet setup list | List available setup presets |
| packet setup | Run a setup preset on an existing instance |
| packet launch --setup | Launch with auto-setup |$3
Launch a new GPU instance.
Options:
-
-g, --gpu - GPU type (e.g., rtx-pro-6000, h100)
- -n, --name - Instance name
- -s, --setup - Auto-setup preset (see below)
- --gpus - Number of GPUs (default: 1)
- -w, --wait - Wait for instance to be ready$3
Auto-setup apps on GPU instances. Available presets:
| Preset | Description | Port |
|--------|-------------|------|
|
vscode | VS Code in Browser (code-server) | 8080 |
| jupyter | Jupyter Lab with data science packages | 8888 |
| jupyter-torch | Jupyter Lab with PyTorch and CUDA | 8888 |
| workspace | Persistent workspace linking | - |
| full-dev | VS Code + Jupyter + Persistence | 8080, 8888 |Launch with auto-setup:
`bash
packet launch --gpu rtx-pro-6000 --setup vscode
packet launch --gpu h100 --setup full-dev --name "my-dev-box"
`Setup an existing instance:
`bash
packet setup vscode 12345
packet setup jupyter-torch 12345
`List presets:
`bash
packet setup list
`$3
SSH into a running instance. Automatically uses the correct credentials.
Options:
-
-c, --command - Run a command instead of interactive shell
- --copy - Print the SSH command without connecting$3
View instance status and connection info.
$3
Terminate a running instance.
Options:
-
-f, --force - Skip confirmation promptConfiguration
Credentials are stored securely in your system's config directory:
- macOS:
~/Library/Preferences/packet-cli-nodejs/
- Linux: ~/.config/packet-cli-nodejs/
- Windows: %APPDATA%/packet-cli-nodejs/Requirements
- Node.js 18.0.0 or higher
- An account at packet.ai
-
sshpass for packet setup on existing instances (install with brew install sshpass or apt install sshpass)Examples
$3
`bash
packet launch --gpu rtx-pro-6000 --setup vscode --name "dev-server"
`$3
`bash
packet launch --gpu h100 --setup full-dev
Includes VS Code (port 8080), Jupyter (port 8888), and persistent workspace
`$3
`bash
Get your instance ID
packet psInstall Jupyter + PyTorch
packet setup jupyter-torch 12345
`$3
`bash
In GitHub Actions or similar
packet login --key $PACKET_API_KEY
INSTANCE=$(packet launch --gpu h100 --wait | grep "Instance ID" | awk '{print $3}')
packet ssh $INSTANCE -c "cd /workspace && python train.py"
packet terminate $INSTANCE -f
``- Website: packet.ai
- Documentation: packet.ai/cli
- Email: support@packet.ai
MIT