RadiatorDB CLI
Read and write RadiatorDB documents from the command line
The radiatordb command-line tool reads and writes RadiatorDB documents directly through PostgreSQL. Use it for maintenance tasks, manual inspection, and small document edits.
Use RadiatorDB REST API when external applications need to read or write documents through Radiator Management API.
Configure the database URL
Pass the PostgreSQL URL for a RadiatorDB node with --url:
radiatordb --url postgresql://user:password@localhost/radiatordb collections
You can also set RADIATORDB_URL to avoid repeating --url for each command:
export RADIATORDB_URL=postgresql://user:password@localhost/radiatordb
radiatordb collections
When you use multiple RadiatorDB nodes, provide a comma-separated list:
export RADIATORDB_URL=postgresql://node1/radiatordb,postgresql://node2/radiatordb
List collections and keys
List collections that contain active documents:
radiatordb collections
List document keys in a collection:
radiatordb keys mycollection
Use --json when you need machine-readable output:
radiatordb keys mycollection --json
Read a document
Read one document by collection and key:
radiatordb get mycollection mydoc
The command prints the document as formatted JSON. For multipart keys, separate key parts with ~:
radiatordb get users mikem~example.com
Use --data to print only the document payload:
radiatordb get mycollection mydoc --data
Document keys use the same multipart-key format as RadiatorDB REST API. Use ~ to separate multipart key parts. Escape a literal ~ inside a key part as ~~:
radiatordb get users 'team~~alpha~alice'
Edit a document
Use get --data and put together to edit a document payload with a local editor. The --data flag prints only the payload from the document's data field, without metadata such as the key, revision, or timestamps:
radiatordb get mycollection mydoc --data > payload.json
edit payload.json
radiatordb put mycollection mydoc < payload.json
The put command reads JSON from standard input and stores it as the document data.
For example, this input writes a JSON object as the document payload:
{
"username": "alice",
"enabled": true,
"roles": ["admin", "operator"]
}
Write it with:
radiatordb put users alice < payload.json
You can also pipe the payload directly:
echo '{"username":"alice","enabled":true}' | radiatordb put users alice
The key comes from the command argument. For multipart keys, separate key parts with ~:
echo '{"accounting":"started"}' | radiatordb put accounting helsinki~alice~session-1
Review archived revisions
List archived revisions for a document:
radiatordb revisions mycollection mydoc
Read a specific archived revision with --revision:
radiatordb get mycollection mydoc --revision 00000000-0000-0000-0000-000000000000
Export and import backups
Export a streaming JSON Lines backup to a file:
radiatordb export backup.jsonl
Export a gzip-compressed backup with --gzip:
radiatordb export --gzip backup.jsonl.gz
The export includes active documents and archived revisions by default. Use --no-revisions to export only active documents:
radiatordb export --no-revisions backup.jsonl
Write the backup to standard output with -:
radiatordb export - > backup.jsonl
Import a backup from a file:
radiatordb import backup.jsonl
The import command accepts both raw JSON Lines backups and gzip-compressed backups by auto detecting the file format.
The import replaces existing data on all configured RadiatorDB nodes by default. The command prompts for confirmation. Use --yes for non-interactive restores.
Use --no-revisions to skip revision lines without validating or restoring them:
radiatordb import --yes --no-revisions backup.jsonl
Use --strategy to merge backup documents into existing data instead of resetting the backend:
radiatordb import --yes --strategy skip backup.jsonl
Allowed strategies are reset, override, skip, and newest. reset is the default and is the only strategy that can import and validate revision records. Merge strategies skip revision lines unless you request revision import, which is rejected for those strategies. For strategy behavior, use cases, and caveats, see RadiatorDB Backup.
Read the backup from standard input with -:
radiatordb import --yes - < backup.jsonl
Wait for replication sync
Wait until all configured RadiatorDB nodes have synchronized their subscriptions:
radiatordb wait-sync
Use this before maintenance tasks that require every configured node to have caught up with replicated changes.
Destructive operations
The CLI also includes destructive maintenance commands. Use them only when you understand the effect on the configured RadiatorDB nodes.
radiatordb disbandremoves replication subscriptions between all configured nodes.radiatordb destroyremoves replication subscriptions and drops all configured databases.
About Radiator software development security
Architecture Overview
Backend Load Balancing
Basic Installation
Built-in Environment Variables
Byte Size Units
Certificate Revocation Lists
Comparison Operators
Configuration Editor
Configuration Import and Export
Containers
Cron and interval timers
Data Types
Duration Units
Environment Variables
Execution Context
Execution Pipelines
Filters
Getting a Radiator License
Health check /live and /ready
High Availability and Load Balancing
High availability identifiers
HTTP Basic Authentication
Introduction
Linux systemd support
Local AAA Backends
Log storage and formatting
Management API privilege levels
Namespaces
Password Hashing
Password Rehashing During Login
Probabilistic Sampling
Prometheus scraping
PROXY Protocol Support
Radiator server health and boot up logic
Radiator sizing
Radiator software releases
RadiatorDB
RadiatorDB Backup
RadiatorDB CLI
RadiatorDB Installation
RadiatorDB REST API
Rate Limiting
Rate Limiting Algorithms
Reverse Dynamic Authorization
Service Level Objective
TACACS+ Authentication, Authorization, and Accounting
Template Rendering CLI
Timestamp Format
Timestamps
Tools radiator-client
TOTP/HOTP Authentication
What is Radiator?
YubiKey Authentication
YubiKey Context Variables
About Radiator software development security
Architecture Overview
Backend Load Balancing
Basic Installation
Built-in Environment Variables
Byte Size Units
Certificate Revocation Lists
Comparison Operators
Configuration Editor
Configuration Import and Export
Containers
Cron and interval timers
Data Types
Duration Units
Environment Variables
Execution Context
Execution Pipelines
Filters
Getting a Radiator License
Health check /live and /ready
High Availability and Load Balancing
High availability identifiers
HTTP Basic Authentication
Introduction
Linux systemd support
Local AAA Backends
Log storage and formatting
Management API privilege levels
Namespaces
Password Hashing
Password Rehashing During Login
Probabilistic Sampling
Prometheus scraping
PROXY Protocol Support
Radiator server health and boot up logic
Radiator sizing
Radiator software releases
RadiatorDB
RadiatorDB Backup
RadiatorDB CLI
RadiatorDB Installation
RadiatorDB REST API
Rate Limiting
Rate Limiting Algorithms
Reverse Dynamic Authorization
Service Level Objective
TACACS+ Authentication, Authorization, and Accounting
Template Rendering CLI
Timestamp Format
Timestamps
Tools radiator-client
TOTP/HOTP Authentication
What is Radiator?
YubiKey Authentication
YubiKey Context Variables