# mainskeeper CLI — PROPOSED product contract, not shipped software. Fictional demonstration data.
# screen: help · host: duplex-pi-probe · 80 columns · NO_COLOR · exit 0
# clock: Wed 30 Sep 2026 15:22 PDT · Fixture · incident state, now 15:22
# stderr lines (counting the prompt line as 1): none
duplex-pi-probe $ mainskeeper --help
mainskeeper — MainsKeeper collector CLI                                    0.4.2
Reads UPS and connectivity state on this machine and reports it. Monitoring
only.

Usage
  mainskeeper <command> [options]

Set up
  enroll [--headless] [--reenroll] [--site NAME] [--roles ups,connectivity]
      Connect this machine to your MainsKeeper account [sudo]
  sources discover              Find UPSs on USB and local NUT (changes nothing)
  sources list                  Sources on this collector and the one in use per
                                UPS
  sources show <source>         One source: capabilities and secret status
  sources add --nut HOST[:PORT] --ups NAME
      Add a UPS on a remote NUT server [sudo]
  sources add --snmp HOST [--version 3]
      Add a UPS network card (SNMP v3 by default) [sudo]
  sources auth <source>         Set a source’s secret (hidden prompt, stored
                                here) [sudo]
  sources test <source>         Test read access with the stored secret [sudo]
  sources use <source>          Use this source for its UPS [sudo]
  sources remove <source>       Remove a source; history stays with the UPS
                                [sudo]

Observe
  status [--json] [--watch]     What this collector sees now
  queue [--json]                Local history buffer: pending, uploads, gaps
  logs [--since DURATION] [--follow]
      mainskeeperd log [group]

Settings
  roles show                    Monitoring roles: desired (dashboard) and
                                applied
  roles set ups=on|off connectivity=on|off
      Roles are managed in the dashboard (prints the link)
  config show [--effective]     Settings with owner; --effective adds the source
  config set <local-key> <value>
      Set a local-owned key (storage, retention, logging) [sudo]
  config validate               Check collector.toml and secret store
                                permissions

Troubleshoot
  doctor                        Diagnose service, access, sources and cloud
  service status                The mainskeeperd system service (read-only)
  version                       Versions of mainskeeper and mainskeeperd
  help <command>                Options, elevation and exit codes for one
                                command

Elevation
  [sudo] macOS, Fedora, Raspberry Pi OS: prefix with sudo · Windows: Run in an
  elevated terminal (Administrator PowerShell) — no sudo
  [group] member of the mainskeeper group, or elevated · everything else: no
  elevation

Global options
  --json          One JSON document on stdout; no colour, no spinners
  --no-color      Plain output (also NO_COLOR=1, or when not a TTY)
  -q, --quiet     Print errors only (stderr)
  -h, --help      This list; with a command, help for that command

MainsKeeper observes and reports. It never shuts down, restarts, switches or
tests equipment.
ESP32 probes have no CLI: they are set up on the device’s local setup page — its
setup access point, or http://<device>.local during provisioning.
More: mainskeeper help <command> · Dashboard: https://mainskeeper.example.net
