vpsgui
Official CLI and Python SDK for the VPSGUI agent REST API.
Install
pip install vpsgui
Requires Python 3.8+. This installs both the vpsgui command and the library.
The CLI
vpsgui login vps.example.com
login asks for the agent token with echo off, checks it against the agent, and only then writes
~/.vpsgui/config.json with mode 0600. Nothing is saved if the credentials do not work.
| Command | What it does |
|---|---|
vpsgui login [url] |
Save credentials for a host, after checking they work |
vpsgui whoami |
Show the active profile and confirm the agent still accepts it |
vpsgui logout |
Forget this machine's copy of the token |
vpsgui status |
CPU, memory, disk, and any failing checks |
vpsgui health |
Every health check. Exits non-zero on a red one |
vpsgui ps |
Docker containers |
vpsgui ls [path] |
List a directory on the host |
vpsgui exec <command> |
Run a shell command. Exits non-zero when the command does |
vpsgui profiles |
List saved hosts |
vpsgui use <profile> |
Switch the default host |
Several hosts are several profiles; --profile works on every command.
vpsgui login vps-2.example.com --profile staging
vpsgui exec --profile staging 'systemctl restart nginx'
In CI, set VPSGUI_API_URL and VPSGUI_AGENT_TOKEN instead of logging in - they take precedence
over any saved profile, so nothing touches the disk.
The npm package vpsgui installs a CLI by the same name that reads the same config file, so it
does not matter which one wins on your PATH.
The agent token is a root password
Every endpoint except health() requires the agent token, and that token grants root-equivalent
control of the host: shell execution, package installs, and filesystem read/write. Read it from
the environment, never commit it, and only talk to the agent over HTTPS - it travels in the
Authorization header.
The library
import os
from vpsgui import VpsguiClient
with VpsguiClient(
base_url="https://vps.example.com/api/v1",
token=os.environ["VPSGUI_AGENT_TOKEN"],
) as client:
telemetry = client.system.telemetry()
print(f"CPU {telemetry['cpuPercent']}% across {telemetry['cpuCores']} cores")
for container in client.docker.list_containers():
print(container["name"], container["state"], container["image"])
API
| Resource | Methods |
|---|---|
client.nodes |
get(), list(), topology(), health() |
client.system |
telemetry(), processes(), services(), service_action(name, action), packages(), install_package(name), users() |
client.docker |
list_containers(), list_images(), container_action(id, action), remove_image(id, force=False) |
client.files |
list(path), read(path), write(path, content), mkdir(path), delete(path, recursive=False), rename(src, dst) |
client.security |
firewall_rules(), apply_firewall_rule(...), ssh_keys(), audit_logs(), list_secrets(), save_secret(...), delete_secret(name), reveal_secret(name) |
client.network |
interfaces(), ip_info(ip=None) |
client.storage |
partitions() |
client.backups |
list(), create(source_path, label=None), delete(name), restore(name, destination) |
client.deployments |
list(), pull(path) |
client.catalog |
list() |
client.automation |
workflows() |
client.queue |
jobs() |
client.databases |
list() |
client.proxy |
rules() |
client.terminal |
exec(command) |
| top level | health(), info(), close() |
Errors
from vpsgui import VpsguiClient, VpsguiError
try:
client.system.telemetry()
except VpsguiError as e:
# status is 0 for transport failures (timeout, DNS, connection refused).
print(e.status, e.endpoint, e.message)
if e.is_auth_error:
print("Bad token, or locked out after repeated failures.")
None values are deliberate
Fields the agent cannot determine are None rather than guessed. Check before formatting:
smartHealth- needssmartctland raw device accesscpuPercenton a process - Windowstasklistreports nonecity/regionfromip_info()- only when the provider reports nothing (e.g. a bogon address)size/tables/keyson a database - would need per-engine credentialsdownloadsCount/ratingon a catalog item - the agent queries no registry
read() also returns truncated: True and editable: False for a file that exceeded the read cap.
Do not write that content back - it would truncate the file on disk.
License
MIT © NotGamerPratham
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vpsgui-1.2.0.tar.gz.
File metadata
- Download URL: vpsgui-1.2.0.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
708b617f7cc32d83f69a214d865aeadedc87bbb3ed0868ef0aedb851d79c1c99
|
|
| MD5 |
1e76ab54f98bb0450780c7dd5aaf940d
|
|
| BLAKE2b-256 |
34b6c6607ec986ead452bf7b11d45dd0adab968061301b639da920867d1db0bd
|
File details
Details for the file vpsgui-1.2.0-py3-none-any.whl.
File metadata
- Download URL: vpsgui-1.2.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f8ee08bbde8e30ac0864677c4f337610356dd2e78caf70e52d015f46bcc5998
|
|
| MD5 |
dd63882d9427da05627713ec116e9e3e
|
|
| BLAKE2b-256 |
342f22e5c48e3ec52304cf54f25acd5fc102ab786ba7e702c473346b9e0aa981
|