PVR CLI

Overview

The pvr command-line tool is your primary interface for managing Pantavisor repositories and devices. It enables repository management, application deployment, device interaction, and system configuration.

Installation

Linux/macOS

# Download and extract
tar xvzf pvr-033.linux.amd64.tar.gz
mkdir -p ~/bin
cp pvr ~/bin/pvr
chmod +x ~/bin/pvr
export PATH=$PATH:~/bin

Windows

  • Unzip the binary
  • Place in accessible directory (e.g., C:\Users\YOURUSER)
  • Add to PATH environment variable

Verify Installation

pvr --help

Development Version

# Get latest development build (may contain bugs)
pvr global-config DistributionTag=develop
pvr self-upgrade

Essential Commands

Repository Management

Initialize Repository

# Create a new Pantavisor repository
pvr init

Clone Device

# Clone an existing device configuration
pvr clone http://192.168.1.122:12368/cgi-bin/pvr my-checkout
pvr clone http://DEVICE_IP:12368/cgi-bin/pvr my-device

Stage and Commit Changes

# Stage all changes
pvr add .

# Commit with message
pvr commit -m "Updated configuration"

# Stage and commit in one step
pvr add . && pvr commit -m "Added new application"

Application Management

Add Applications

# Add container from Docker Hub
pvr app add --from nginx:stable-alpine webserver
pvr app add --from nginx:latest web-server
pvr app add --from postgres:13 database

# Add application with specific configuration
pvr app add --from redis:alpine cache-server

List Applications

# Show all applications in repository
pvr app ls

Update Applications

# Update existing application
pvr app update nginx-app

# Update with new image version
pvr app update app-name --from new-image:tag

Remove Applications

# Remove application from repository
pvr app rm app-name

Device Operations

Network Discovery

# Scan for Pantavisor devices on network
pvr device scan

Device Management

# Create a new device
pvr device create mydevice1

# Get device information
pvr device get DEVICE_ID

# Retrieve device logs
pvr device logs

Deployment

Basic Deployment

# Deploy repository to device
pvr deploy trails/0 /path/to/repo

# Deploy current directory
pvr deploy trails/0 .

Advanced Deployment

# Deploy with specific configurations
pvr deploy trails/0 /path/to/repo/.pvr#os /tmp/export.tgz#bsp

# Deploy to specific device
pvr deploy trails/0 . --device DEVICE_ID

Signature Management

List Signatures

# Show signatures
pvr sig ls

# Show signatures with full JOSE serialization
pvr sig ls --with-sig

Add Signatures

# Add signature to component
pvr sig add --part component-name
pvr sig add --part nginx

# Show signature with payload
pvr sig --with-payload ls --with-sig _sigs/awconnect.json

Configuration

Global Configuration

# Set global configuration options
pvr global-config KEY=VALUE

# Set development distribution
pvr global-config DistributionTag=develop

Repository Configuration

Configuration files are stored in the .pvr/ directory within your repository.

Common Usage Patterns

Complete Application Workflow

# 1. Initialize or clone repository
pvr init
# OR
pvr clone http://DEVICE_IP:12368/cgi-bin/pvr my-project

# 2. Navigate to repository
cd my-project

# 3. Add application
pvr app add --from nginx:latest web-server

# 4. Stage and commit
pvr add .
pvr commit -m "Added nginx web server"

# 5. Deploy to device
pvr deploy trails/0 .

Device Configuration Workflow

# 1. Scan for devices
pvr device scan

# 2. Clone device for editing
pvr clone http://192.168.1.100:12368/cgi-bin/pvr my-device

# 3. Make configuration changes
cd my-device
# Edit files or add applications

# 4. Commit changes
pvr add .
pvr commit -m "Updated device configuration"

# 5. Deploy back to device
pvr deploy trails/0 .

Tips and Best Practices

Network Discovery

  • Use pvr device scan to find Pantavisor devices on your network
  • Devices typically expose their management interface on port 12368

Version Control

  • Always commit changes with descriptive messages
  • Use pvr add . to stage all changes before committing
  • Repository history is maintained like Git

Application Management

  • Applications are pulled from Docker Hub by default
  • Use specific tags (e.g., nginx:1.21-alpine) instead of latest for production
  • Test applications locally before deploying to production devices

Deployment Strategy

  • Test deployments on development devices first
  • Use signature management for production deployments
  • Monitor device logs after deployment

Official Documentation

For complete command reference and advanced usage: