pr-af icon indicating copy to clipboard operation
pr-af copied to clipboard

pr-af --help starts the node instead of printing usage

Open AbirAbbas opened this issue 3 weeks ago • 0 comments

What happened

The Go node has no command-line flag handling: cmd/pr-af/main.go never reads its arguments, so pr-af --help or pr-af -h starts the node. It binds PORT (default 8007) and registers with AGENTFIELD_SERVER (default http://localhost:8080), which on a machine running a local control plane registers a node someone only meant to ask for help.

Replication

With no control plane listening: PORT=18907 AGENTFIELD_SERVER=http://127.0.0.1:9 pr-af --help prints serve: initialize node … register node: … connection refused and exits 1, instead of printing usage.

The fix

Handle --help / -h (and reject unknown flags) before starting the node, printing the settings it reads from the environment.

Acceptance

pr-af --help prints usage and exits 0 without binding a port or contacting a control plane; running with no arguments starts the node as today.

AbirAbbas avatar Nov 13 '26 00:11 AbirAbbas