packet-gpu-cli
Command-line interface for packet.ai GPU cloud.
Installation
npm install -g packet-gpu-cli
Quick Start
packet login
packet gpus
packet launch --gpu rtx-pro-6000 --setup vscode
packet launch --gpu h100 --wait
packet ps
packet ssh <instance-id>
packet logs <instance-id>
packet terminate <instance-id>
Commands
Authentication
packet login | Authenticate with your API key |
packet logout | Remove stored credentials |
packet whoami | Show current account and balance |
GPU Management
packet gpus | List available GPU types and pricing |
packet launch --gpu <type> | Launch a new GPU instance |
packet ps | List your running instances |
packet ssh <id> | SSH into an instance |
packet logs <id> | View instance status and info |
packet terminate <id> | Terminate an instance |
Auto-Setup
packet setup list | List available setup presets |
packet setup <preset> <id> | Run a setup preset on an existing instance |
packet launch --setup <preset> | Launch with auto-setup |
packet launch
Launch a new GPU instance.
Options:
-g, --gpu <type> - GPU type (e.g., rtx-pro-6000, h100)
-n, --name <name> - Instance name
-s, --setup <preset> - Auto-setup preset (see below)
--gpus <count> - Number of GPUs (default: 1)
-w, --wait - Wait for instance to be ready
packet setup
Auto-setup apps on GPU instances. Available presets:
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:
packet launch --gpu rtx-pro-6000 --setup vscode
packet launch --gpu h100 --setup full-dev --name "my-dev-box"
Setup an existing instance:
packet setup vscode 12345
packet setup jupyter-torch 12345
List presets:
packet setup list
packet ssh <instance-id>
SSH into a running instance. Automatically uses the correct credentials.
Options:
-c, --command <cmd> - Run a command instead of interactive shell
--copy - Print the SSH command without connecting
packet logs <instance-id>
View instance status and connection info.
packet terminate <instance-id>
Terminate a running instance.
Options:
-f, --force - Skip confirmation prompt
Configuration
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
Launch with VS Code pre-installed
packet launch --gpu rtx-pro-6000 --setup vscode --name "dev-server"
Launch with full dev environment
packet launch --gpu h100 --setup full-dev
Setup Jupyter on an existing instance
packet ps
packet setup jupyter-torch 12345
CI/CD pipeline
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
Support
License
MIT