Skip to content
CLI reference

CLI reference

gt7-collector --ps5=<ip> [flags]

Flags are defined in cmd/gt7-collector/main.go (parseFlags) and validated before any socket or file is opened. Positional arguments are rejected.

FlagDefaultMeaning
--ps5RequiredLiteral PS5 IP address (hostnames are rejected).
--rtpslocalhost:50051RTPS target: bare host:port, grpc://host:port, unix:///abs/path.sock, or http(s)://host/path. Must not be empty. none disables RTPS publishing and requires --ws-listen (with none, --rtps-token is rejected and INGEST_TOKEN is ignored). See Transports.
--rtps-tokenEmpty (falls back to INGEST_TOKEN)Optional ingest bearer token. Prefer the environment variable to keep it out of ps.
--recv-port33740Local UDP receive port; 1..65535.
--send-port33739Console UDP heartbeat destination port; 1..65535.
--heartbeat1sHeartbeat interval in Go duration syntax; must be positive.
--rawdump-dirEmpty (disabled)Directory for the optional raw dump.
--raw-buffer1024Raw packet buffer depth; must be positive.
--pub-buffer1024Outbound frame buffer depth; must be positive. The oldest frame is dropped when full.
--log-levelinfodebug, info, warn, or error. Logs are JSON (zap production config).
--versionfalsePrint version information and exit.
--ws-listenEmpty (disabled)Browser WebSocket listener host:port. Host must be an IP literal or localhost (bound as 127.0.0.1); other hostnames are rejected. Empty host, 0.0.0.0, :: or any non-loopback IP is a non-loopback bind.
--ws-originNoneAllowed browser origin scheme://host[:port] (http/https, no path, no wildcard, not null). Repeat the flag for more origins; values are never split on commas. At least one is required with --ws-listen.
--ws-max-clients4Concurrent WebSocket clients; 1..64.
--ws-client-buffer64Per-client sample queue depth (oldest dropped when full); 1..4096.
--ws-write-timeout2sPer-message write deadline; 100ms..60s.
--ws-source-timeout2sNo-frame interval before source_stale; 100ms..60s.
--ws-allow-insecure-lanfalsePermit plaintext ws:// on a non-loopback --ws-listen.
--ws-tls-cert, --ws-tls-keyEmptyServe wss:// with this certificate and key; set both or neither. Files are loaded at startup (a load failure exits 1).

Every --ws-* flag other than --ws-listen requires --ws-listen. A non-loopback --ws-listen requires GT7_WS_TOKEN and either TLS or --ws-allow-insecure-lan.

--help prints the flag list and exits 0.

Environment

VariableMeaning
INGEST_TOKENBearer token used when --rtps-token is empty. A non-empty flag overrides it. With neither set, no authentication header is sent. Ignored with --rtps=none.
GT7_WS_TOKENBrowser stream access token (32..256 characters of A-Z a-z 0-9 . _ ~ -, e.g. openssl rand -hex 32). Required for a non-loopback --ws-listen; enforced on loopback when set. There is no flag. Ignored without --ws-listen.

Tokens (INGEST_TOKEN, --rtps-token and GT7_WS_TOKEN) are redacted, raw or quoted, from configuration and runtime error messages, and are never logged.

Exit codes

CodeMeaning
0Clean shutdown on SIGINT/SIGTERM, --help, or --version.
1Startup or runtime failure (for example, the UDP port cannot be bound, an invalid target, or the raw sink cannot open, the --ws-listen port cannot be bound, or the TLS files cannot be loaded).
2Flag or configuration error, or logger construction failure.

Examples

# gRPC (plaintext) to a local RTPS
gt7-collector --ps5=192.168.1.50

# Unix socket, with raw capture and debug logs
gt7-collector --ps5=192.168.1.50 --rtps=unix:///run/gt-collector/ingest.sock \
  --rawdump-dir=./rawdump --log-level=debug

# HTTPS with a token from the environment
INGEST_TOKEN=... gt7-collector --ps5=192.168.1.50 \
  --rtps=https://rtps.example.com/v1/ingest

The collector command has no replay flag; replay captures through the library or the RTPS --replay-file.