Skip to main content
Version: development

Device Commands

Manage and interact with Pantavisor devices through Pantahub.


pvr device ps

List devices you manage, with a quick overview table.

pvr device ps

Output columns: ID, nick, rev, status, state, seen, IP, message.

Flags: none


pvr device logs

Fetch and stream device logs from Pantahub.

pvr device logs <DEVICE_ID>/pantavisor.log@INFO
pvr device logs <DEVICE_ID>/pantavisor.log@INFO#linux
pvr device logs --from=2024-01-01 --to=2024-01-07
pvr device logs --from=P10D --to=P5D # ISO 8601 duration
pvr device logs --template=json
pvr device logs --no-tail
pvr device logs --platform=linux,windows
pvr device logs --level=DEBUG,INFO
pvr device logs --device=ID1,ID2 # multiple devices
pvr device logs --source=/pantavisor.log,/updater

Flags:

FlagEnvDescription
--no-tail, -nPVR_LOGS_NO_TAILDo not tail; stop at --to or now
--from, -fPVR_LOGS_FROM_DATEStart datetime (RFC 3339 or ISO 8601 duration)
--to, -tPVR_LOGS_TO_DATEEnd datetime (RFC 3339 or ISO 8601 duration)
--rev, -rPVR_LOGS_REVFilter by revision. Default: -1 (disabled)
--template, -sPVR_LOGS_TEMPLATEOutput format: short (default), json, or Go template
--platform, -pPVR_LOGS_PLATFORMComma-separated platforms
--device, -dPVR_LOGS_DEVICEComma-separated device IDs
--source, -srcPVR_LOGS_SOURCEComma-separated log sources
--level, -lPVR_LOGS_LEVELComma-separated log levels

Filter syntax (positional):

<deviceid>[/source][@level][#platform]

Multiple values can be comma-separated within each segment:

pvr device logs ID1,ID2/pantavisor.log,updater@INFO,DEBUG#linux,windows

Go template support:

The --template flag accepts Go template strings with the full LogsEntry struct:

FieldDescription
.IDLog entry ID
.DeviceDevice ID
.OwnerOwner PRN
.TimeCreatedTimestamp
.LogPlatPlatform name
.LogSourceSource name
.LogLevelLog level
.LogTextLog message

Available template functions: all sprig functions, sprintf, basename, timeformat.


pvr device scan

Scan the local network for Pantavisor devices announcing themselves via mDNS.

pvr device scan

Flags: none


pvr device create

Create a new device on Pantahub. After creation, PVR uploads the local state, logs in the device, and creates a trail.

pvr device create my-device
pvr device create user/my-device

Flags: none


pvr device get

Get device details from Pantahub by nick or ID.

pvr device get <DEVICE_ID>
pvr device get my-device
pvr device get user/my-device

Output is the full device JSON (id, nick, owner, PRN, timestamps, etc.).

Flags: none


pvr device set

Set user-meta or device-meta fields on a device.

pvr device set <DEVICE_ID> key1=value1 key2=value2

If logged in as a USER, updates user-meta. If logged in as a DEVICE, updates device-meta.

Flags: none


pvr device delete

Delete a device from Pantahub.

pvr device delete <DEVICE_ENDPOINT>
pvr device delete --yes <DEVICE_ENDPOINT>

Flags:

FlagDescription
--yes, -yConfirm deletion (skips prompt)

pvr device status

Show the current or specified revision's status for a device.

pvr device status <DEVICE_ID>
pvr device status <DEVICE_ID> --rev=4

Without --rev, shows the step for the current running revision (from device-meta pantavisor.revision).

Flags:

FlagEnvDescription
--rev, -rPVR_STATUS_REVShow status for a specific revision

pvr device steps

List revisions (steps) in a device's trail.

pvr device steps <DEVICE_ID>
pvr device steps <DEVICE_ID> --rev=4 # show a specific step

Without --rev, lists all steps.

Flags:

FlagEnvDescription
--rev, -rPVR_STEPS_REVShow a specific step revision

pvr device statediff

Diff the state between two revisions of a device trail.

pvr device statediff <DEVICE_ID> <REV1> <REV2>
pvr device statediff <DEVICE_ID> 3 5 --format=jsondiff

Flags:

FlagDescription
--format, -fOutput format: unified (default) or jsondiff

pvr device tty

Interact with a Pantavisor device via USB serial console. Uses pure Go — no external tools like picocom required.

pvr device tty # interactive shell (default /dev/ttyUSB0)
pvr device tty -d /dev/ttyACM0 # specify port
pvr device tty run uname -r # execute a command
pvr device tty ps # list containers
pvr device tty log # tail device logs (default: pantavisor, 30 lines)
pvr device tty log pvr-sdk 10 # specific platform + line count
pvr device tty grep error # search logs
pvr device tty probe # scan for available USB serial ports

Subcommands:

SubcommandDescription
shell (default)Interactive serial console. Exit: Ctrl+A then Ctrl+X
run CMDExecute one command and print output
psList containers (runs lxc-ls + pvcontrol ls)
log [PLAT [N]]Tail device logs. Default: pantavisor, 30 lines
grep PATTERNSearch device logs for a pattern
probeScan /dev/ttyUSB* and /dev/ttyACM* for active devices

Flags:

FlagDescription
--device, -dSerial port path. Default: /dev/ttyUSB0
--verbose, -vShow verbose probe output

Linux-only.


pvr device tokens

Manage device authentication tokens.

pvr device tokens list (ls)

List device tokens with ID, nick, disabled status, and user-meta.

pvr device tokens list

pvr device tokens create

Create a new device token with optional key=value metadata.

pvr device tokens create key1=value1 key2=value2

pvr device tokens disable

Disable a device token by ID.

pvr device tokens disable <TOKEN_ID>

Flags: none (all subcommands)