Skip to content

CLI Reference & Standards

This page is the single catalog for every active CLI tool across the PLANOVI ecosystem โ€” both server-side tools installed on the production VPS (191.218.165.149) and local/technician CLIs living alongside their domain repositories.

All PLANOVI CLIs share one zero-dependency UI kit hosted in PA-IDEAS/planovi-docs/brand-kit/cli/ (planovi_cli_ui.py, planovi_cli_ui.sh, planovi_cli_ui.mjs). See Brand & Design Playbook ยง5.6 for full styling tokens.


1. VPS Server CLIs (191.218.165.149 / PA-IDEAS/planovi-vps)

Global Commands (/usr/local/bin โ€” in PATH)

CommandRuntimeWho Can RunPurpose
planovi-adduserBash (scripts/planovi-adduser.sh)root / planovi-adminInteractive SSH user provisioning wizard for 4 roles: Admin, Developer, Auditor, SFTP-Jail (key-only SSH, locks password).
sudo planovi-dev-docker <subcmd>Bash (scripts/planovi-dev-docker.sh)planovi-dev (NOPASSWD)Restricted Docker wrapper allowing only logs, restart, ps, and compose (logs|restart|ps). Deliberately self-contained (zero external source).

Operational & Maintenance Scripts (/opt/vps-stack/scripts/)

ScriptExecution ModePurpose
update-allowed-ip.sh <IPv4>Manual (root)Updates /opt/vps-stack/proxy/allowed_ips.conf, refreshes UFW (80, 443, 22), and reloads vps-proxy without downtime.
backup.shCron (0 2 * * *)Runs pg_dump on supabase-db (PROD) to /var/backups/vps-stack/ (14-day retention) with Google Chat alert.
backup_databases.shCron (0 2 * * *)Runs pg_dumpall on both supabase-db (PROD) and supabase-db-dev (DEV) to /opt/vps-stack/backups/{prod,dev}/ (30-day retention).
check-health.shCron (*/5 * * * *)Monitors root disk usage (> 85%) and stopped/unhealthy Docker containers; posts Google Chat alerts.
health-ping.shCron (* * * * *)Minute-level host heartbeat ping.
health-check-dev.shCron (*/5 * * * *)DEV stack health check.
docker-prune.shCron (0 3 * * 0)Weekly docker system prune -f (preserves tagged planovi-flutter:* and planovi-firmware-builder:latest images).
migrate-storage-files.pyLegacy (one-off)Historical Supabase Cloud storage sync script (inactive).

Host System CLIs vs. In-Container CLIs

  • Installed directly on Ubuntu host: docker, docker compose, git, python3, curl, wget, rsync, openssl, ufw, fail2ban-client, htop, tmux, screen.
  • Run inside Docker containers (not installed on host):
    • PostgreSQL: docker exec -it supabase-db psql -U postgres (or supabase-db-dev)
    • Nginx config check/reload: docker exec vps-proxy nginx -t && docker exec vps-proxy nginx -s reload
    • Docs-sync manual trigger: docker exec vps-deployer curl -s http://docs-sync:9100/health

2. IoT Hardware & Provisioning CLIs (PA-IDEAS/planovi-converter)

Technician & Production Line CLIs (Zero-Git Bundle + tools/)

These tools are mirrored byte-for-byte in cloud/provisioner_bundle/ and served as a zero-git ZIP bundle directly from cloud.planovi.app / dev-cloud.planovi.app for macOS, Linux, and Windows technicians. All support --lang pl|en (or PLANOVI_CLI_LANG) and NO_COLOR.

Tool (tools/...)RuntimePurpose
provision_device.pyPython 3.10+ (stdlib + planovi_cli_ui.py)End-to-end RP2350 USB provisioner: fetches mTLS identity from Cloud API, burns OTP rows via provision_otp.py, downloads & SHA-256-verifies factory UF2, flashes over USB (picotool), runs post-flash SD/RTC QA, and confirms flash to Cloud API.
provision_otp.pyPython 3.10+Low-level RP2350 OTP memory reader/writer invoked by provision_device.py or standalone for hardware verification.
service_update_usb.pyPython 3.10+ (cryptography + planovi_cli_ui.py)Offline-only signed A/B firmware service updater over USB (picotool): validates ECDSA P-256 signatures, writes inactive slot, and verifies trial boot (dry-run by default without --execute).
usb_console.pyPython 3.10+ (pyserial + planovi_cli_ui.py)Auto-detects RP2350 USB CDC (VID 0x2E8A), streams live logs with auto-reconnect, forwards interactive commands (HELP/STATUS), and provides interactive USB Doctor diagnostics & @cmd/@res RPC.

Engineering & Firmware Build CLIs (planovi-converter/tools/)

ToolRuntimePurpose
manage_credential_vault.pyPython 3.10+ (cryptography + sqlalchemy + planovi_cli_ui.py)AES-256-GCM converter credential vault CLI (generate-key, migrate-events [--dry-run], rotate-key --to-version <N> [--dry-run], verify-integrity; supports --lang pl|en and --json). Run on VPS via docker exec converters-api-dev python3 tools/manage_credential_vault.py ....
firmware_release_meta.pyPython 3.10+ (stdlib + planovi_cli_ui.py)RP2350 firmware source-tree SHA-256 build gate, Git commit/module extractor, and firmware_history.json backfill CLI (check, extract-build-meta, sync [--dry-run]; supports --lang pl|en and --json). Invoked automatically by vps-deployer and build_firmware_docker.sh.
build_firmware_docker.shBash + DockerReproducible ARM Cortex-M33 (RP2350) firmware build inside planovi-firmware-builder.
make_factory_uf2.pyPythonPackages factory BOOTSEL-installable UF2 image.
sign_firmware.pyPythonSigns firmware artifacts with ECDSA P-256 OTA signing key.
scan_repository_secrets.pyPythonScans converter repository for accidentally committed keys or credentials.
run_cloud_e2e.pyPythonEnd-to-end cloud API & telemetry ingestion test harness.

3. Documentation & Branding CLIs (PA-IDEAS/planovi-docs)

ToolSubcommands / UsagePurpose
node tools/docs-sync/cli.mjsextract, drift [--update-snapshot], diagrams [sync|pull|local] [--force], compile-blueprints, snapshot --repo <id> --version <vX.Y>, ai-update --changed-repo <repo>, check-secrets, run-syncAutonomous documentation pipeline used locally and inside the isolated docs-sync VPS container (uses brand-kit/cli/planovi_cli_ui.mjs).
./scripts/sync-brand.sh[assets/brand] [--no-assets] [--cli <dir>] [--cli-lang py|sh|mjs|all]Syncs canonical BRANDING_GUIDE.md, assets/brand/*, and optionally planovi_cli_ui.* from PA-IDEAS/planovi-docs/brand-kit/ into any repository.

4. Standard for Adding Any New CLI (3 Steps)

  1. Pull the canonical zero-dependency UI module:
    Terminal window
    # Example for a Python CLI repo:
    ./scripts/sync-brand.sh assets/brand --cli tools --cli-lang py
    # Example for a Bash CLI repo (no image assets needed):
    ./scripts/sync-brand.sh --no-assets --cli scripts --cli-lang sh
  2. Follow the 5 mandatory CLI rules (BRANDING_GUIDE.md ยง5.6):
    • Render the official planovi banner (#FFFFFF + #32CA42 dot on i) and [+]/[*]/[!]/[-] prefixes via planovi_cli_ui.{py,sh,mjs}.
    • Never hardcode raw ANSI escapes โ€” let planovi_cli_ui auto-disable color on NO_COLOR, TERM=dumb, or non-TTY pipes/cron logs.
    • Support standard env vars PLANOVI_CLI_LANG=pl|en (--lang) and PLANOVI_ENV=dev|prod.
    • Support --json (pure JSON on stdout, human logs/banner on stderr) for machine-consumable tools, and --dry-run for mutating operations.
    • Keep sudo NOPASSWD VPS wrappers self-contained (never source external writable paths).
  3. Register the tool here: Add a row to the appropriate table in src/content/docs/reference/cli-reference.md in your PR.