robinnet:cli
Differences
This shows you the differences between two versions of the page.
| robinnet:cli [2026/03/11 15:28] – created freedomotter | robinnet:cli [2026/03/11 15:45] (current) – freedomotter | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== cli.py ====== | ====== cli.py ====== | ||
| - | Command line interface for RobinNet node management. | + | The RobinNet |
| - | This tool allows operators to: | + | It provides commands for: |
| - | * initialize nodes | + | * initializing a node |
| - | * manage | + | * inspecting node information |
| - | * post messages | + | * adding and removing |
| - | * trigger sync operations | + | * testing peer connectivity |
| - | * inspect database state | + | * posting bulletins |
| + | * listing and viewing | ||
| + | * viewing message trace history | ||
| + | * syncing one peer or all peers | ||
| + | * expiring old messages | ||
| + | * generating test data | ||
| + | |||
| + | The CLI is designed to be the main operational interface before the future Cardinal UI. | ||
| ----- | ----- | ||
| - | ===== Example | + | ===== General Usage ===== |
| - | List messages: | + | RobinNet commands are run as a Python module. |
| + | |||
| + | Basic format: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli --db ./ | ||
| + | </ | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli --db ./ | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ===== Node Commands ===== | ||
| + | |||
| + | ==== init-node ==== | ||
| + | |||
| + | Initializes or updates the local node identity. | ||
| + | |||
| + | Example: | ||
| <code bash> | <code bash> | ||
| python -m robinnet.cli \ | python -m robinnet.cli \ | ||
| --db ./ | --db ./ | ||
| - | | + | |
| + | --name alpha \ | ||
| + | --operator " | ||
| + | --callsign N2XYZ \ | ||
| + | --location " | ||
| </ | </ | ||
| - | Add peer: | + | Options: |
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== node-info ==== | ||
| + | |||
| + | Displays the local node record. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | node-info | ||
| + | </ | ||
| + | |||
| + | JSON output: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | node-info \ | ||
| + | --json | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ===== Peer Commands ===== | ||
| + | |||
| + | ==== add-peer ==== | ||
| + | |||
| + | Adds or updates a peer node. | ||
| + | |||
| + | Example: | ||
| <code bash> | <code bash> | ||
| Line 32: | Line 105: | ||
| --url http:// | --url http:// | ||
| </ | </ | ||
| + | |||
| + | Options: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== list-peers ==== | ||
| + | |||
| + | Lists configured peers. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | list-peers | ||
| + | </ | ||
| + | |||
| + | Show enabled peers only: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | list-peers \ | ||
| + | --enabled-only | ||
| + | </ | ||
| + | |||
| + | JSON output: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | list-peers \ | ||
| + | --json | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== remove-peer ==== | ||
| + | |||
| + | Removes a peer by local peer id. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | remove-peer \ | ||
| + | --peer-id 1 | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== peer-test ==== | ||
| + | |||
| + | Tests connectivity and identity for one peer. | ||
| + | |||
| + | This command: | ||
| + | |||
| + | * checks the remote health endpoint | ||
| + | * fetches the remote node info | ||
| + | * updates '' | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | peer-test \ | ||
| + | --peer-id 1 | ||
| + | </ | ||
| + | |||
| + | Options: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | JSON output example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | peer-test \ | ||
| + | --peer-id 1 \ | ||
| + | --json | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ===== Message Commands ===== | ||
| + | |||
| + | ==== post-bulletin ==== | ||
| + | |||
| + | Creates a new local bulletin. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | post-bulletin \ | ||
| + | --title "Water Distribution" | ||
| + | --body "Town Hall from 10:00 to 16: | ||
| + | </ | ||
| + | |||
| + | Options: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | Example with more options: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | post-bulletin \ | ||
| + | --title " | ||
| + | --body " | ||
| + | --scope regional \ | ||
| + | --priority 5 \ | ||
| + | --rf-eligible | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== list-messages ==== | ||
| + | |||
| + | Lists locally stored messages. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | list-messages | ||
| + | </ | ||
| + | |||
| + | Show message bodies: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | list-messages \ | ||
| + | --show-body | ||
| + | </ | ||
| + | |||
| + | Filter by type: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | list-messages \ | ||
| + | --msg-type bulletin | ||
| + | </ | ||
| + | |||
| + | Filter by status: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | list-messages \ | ||
| + | --status active | ||
| + | </ | ||
| + | |||
| + | JSON output: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | list-messages \ | ||
| + | --json | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== show-message ==== | ||
| + | |||
| + | Displays one message by UUID. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | show-message \ | ||
| + | --msg-uuid 12345678-1234-1234-1234-123456789abc | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== show-trace ==== | ||
| + | |||
| + | Displays trace history for one message UUID. | ||
| + | |||
| + | This is useful for following import/ | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | show-trace \ | ||
| + | --msg-uuid 12345678-1234-1234-1234-123456789abc | ||
| + | </ | ||
| + | |||
| + | JSON output: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | show-trace \ | ||
| + | --msg-uuid 12345678-1234-1234-1234-123456789abc \ | ||
| + | --json | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== delete-message ==== | ||
| + | |||
| + | Deletes one message by UUID. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | delete-message \ | ||
| + | --msg-uuid 12345678-1234-1234-1234-123456789abc | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ===== Sync Commands ===== | ||
| + | |||
| + | ==== sync-peer ==== | ||
| + | |||
| + | Synchronizes one configured peer. | ||
| + | |||
| + | By default it performs both: | ||
| + | |||
| + | * pull from peer | ||
| + | * push to peer | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | sync-peer \ | ||
| + | --peer-id 1 | ||
| + | </ | ||
| + | |||
| + | Pull only: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | sync-peer \ | ||
| + | --peer-id 1 \ | ||
| + | --pull-only | ||
| + | </ | ||
| + | |||
| + | Push only: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | sync-peer \ | ||
| + | --peer-id 1 \ | ||
| + | --push-only | ||
| + | </ | ||
| + | |||
| + | Options: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== sync-all ==== | ||
| + | |||
| + | Synchronizes all enabled peers. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | sync-all | ||
| + | </ | ||
| + | |||
| + | Pull only: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | sync-all \ | ||
| + | --pull-only | ||
| + | </ | ||
| + | |||
| + | Push only: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | sync-all \ | ||
| + | --push-only | ||
| + | </ | ||
| + | |||
| + | JSON output: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | sync-all \ | ||
| + | --json | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ===== Maintenance Commands ===== | ||
| + | |||
| + | ==== expire-messages ==== | ||
| + | |||
| + | Marks expired messages as '' | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | expire-messages | ||
| + | </ | ||
| + | |||
| + | Show expired messages after the update: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | expire-messages \ | ||
| + | --show | ||
| + | </ | ||
| + | |||
| + | Show expired messages as JSON: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | expire-messages \ | ||
| + | --show \ | ||
| + | --json | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ==== generate-test-data ==== | ||
| + | |||
| + | Creates local test bulletins for development and sync testing. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | generate-test-data \ | ||
| + | --count 5 | ||
| + | </ | ||
| + | |||
| + | Custom prefixes: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | generate-test-data \ | ||
| + | --count 10 \ | ||
| + | --title-prefix "Test Bulletin" | ||
| + | --body-prefix " | ||
| + | </ | ||
| + | |||
| + | Include full message output: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli \ | ||
| + | --db ./ | ||
| + | generate-test-data \ | ||
| + | --count 3 \ | ||
| + | --include-messages \ | ||
| + | --json | ||
| + | </ | ||
| + | |||
| + | Options: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ===== Typical Workflow ===== | ||
| + | |||
| + | A basic operator workflow might be: | ||
| + | |||
| + | - initialize node | ||
| + | - add one or more peers | ||
| + | - test peer connectivity | ||
| + | - post a bulletin | ||
| + | - sync with peers | ||
| + | - inspect messages and trace | ||
| + | |||
| + | Example: | ||
| + | |||
| + | <code bash> | ||
| + | python -m robinnet.cli --db ./ | ||
| + | python -m robinnet.cli --db ./ | ||
| + | python -m robinnet.cli --db ./ | ||
| + | python -m robinnet.cli --db ./ | ||
| + | python -m robinnet.cli --db ./ | ||
| + | python -m robinnet.cli --db ./ | ||
| + | </ | ||
| + | |||
| + | ----- | ||
| + | |||
| + | ===== Notes ===== | ||
| + | |||
| + | The CLI is intended to remain fully functional even after Cardinal exists. | ||
| + | |||
| + | That means: | ||
| + | |||
| + | * Cardinal can become a friendly frontend | ||
| + | * the CLI remains the operator and sysop tool | ||
| + | * automation and scripting remain easy | ||
robinnet/cli.1773242920.txt.gz · Last modified: by freedomotter
