The pypnm command is the primary CLI entrypoint for PyPNM.
Current command structure:
pypnm servefor starting the FastAPI servicepypnm config-menufor launching the interactive system configuration menu
pypnm --helpExpected top-level shape:
usage: pypnm [-h] [-v] {serve,config-menu} ...
Starts the FastAPI service (pypnm.api.main:app) through Uvicorn.
Common options:
--host(default127.0.0.1)--host-all(bind to0.0.0.0)--port(default8000)--ssl,--cert,--key--log-level {critical,error,warning,info,debug,trace}--workers--limit-max-requests--no-access-log--reload--reload-dir(repeatable)--reload-include(repeatable)--reload-exclude(repeatable)--run-background--background-log-file--background-pidfile--mute-tags--mute-tags-hard
Examples:
pypnm serve
pypnm serve --host-all --port 8080
pypnm serve --reload
pypnm serve --workers 4 --limit-max-requests 2000
pypnm serve --run-background
pypnm serve --run-background --background-log-file /var/log/pypnm.log --background-pidfile /var/run/pypnm.pid
pypnm serve --ssl --cert ./certs/cert.pem --key ./certs/key.pem
pypnm serve --mute-tags "PNM Operations - Multi-Downstream OFDM RxMER"
pypnm serve --mute-tags "Orchestrator,Operational" --mute-tags-hardNotes:
--host-allis a convenience alias for binding on all IPv4 interfaces assigned to the host.- Use
--host <ip-or-name>when you want to bind to one specific interface or address. - When
--reloadis enabled,--workersis forced to1. --run-backgrounddetaches the service, writes a pidfile, and redirects stdout/stderr to a log file.--run-backgroundcannot be used with--reload.--limit-max-requestspasses Uvicorn's worker recycle threshold through to the serve runtime.- For production memory safety, prefer multiple workers with a non-zero
--limit-max-requestsinstead of--reload. - See PyPNM Worker Sizing for CPU and memory-based defaults by hardware profile.
--mute-tagshides matching-tag routes from OpenAPI/docs.--mute-tags-hardadditionally enforces403for matching routes.
Launches the interactive system configuration menu (same behavior as the legacy helper script).
Example:
pypnm config-menupypnm --versionOld:
pypnm --reload
pypnm --host 0.0.0.0 --port 8000New:
pypnm serve --reload
pypnm serve --host-all --port 8000