GUI, CLI, and benchmarks · Engineering

The CLI as a small admin surface

One binary for daemon commands, file operations, auth, replication, and restores — and the places it deliberately stops.

NonoDB’s CLI is intentionally small. It is an administrative client, not a shell language, an ORM, or a deployment platform.

That constraint is useful: the same binary can ping a daemon, inspect a backup, restore a database, create an auth token, and promote a replica, without a plugin ecosystem.

Two kinds of commands

Daemon-facing commands use the Unix socket (NONODB_SOCK, default /run/nonodb.sock) and, for TCP setups, a bearer token (NONODB_TOKEN). On Windows they use plaintext HTTP over TCP.

File commands (backup, inspect, restore, verify, compact, branch) operate directly on an LMDB data directory. They do not use the socket or a token.

The auth commands edit the auth registry file directly and do not contact the daemon.

That split matters for incident response: if the daemon will not start, file commands still work.

Selecting a database or instance

Every daemon-facing command accepts --db <name> or NONODB_DB:

Terminal window
nonodb-cli --db app1 count orders '{}'

When several daemons run on one host:

Terminal window
nonodb-cli instances
nonodb-cli --instance 11727 server
nonodb-cli --socket /tmp/nonodb.sock replication status

--instance accepts a PID or replication node id from the per-user instance registry.

Everyday commands

Terminal window
nonodb-cli ping
nonodb-cli ready
nonodb-cli capabilities
nonodb-cli server
nonodb-cli databases list
nonodb-cli databases create app1
nonodb-cli collections
nonodb-cli count orders '{}'
nonodb-cli find orders '{"status":"paid"}' --limit 10
nonodb-cli sql app1 'SELECT status, count(*) FROM orders GROUP BY status'
nonodb-cli indexes orders
nonodb-cli map
nonodb-cli resize 4GiB

capabilities prints the versioned public feature document, including limits. It includes no credentials or tenant data.

server prints actual listener addresses, resolved ports, TLS state, and the advertised replication URL.

Events and jobs

Terminal window
nonodb-cli events orders on status total
nonodb-cli events orders off
nonodb-cli subscribe orders paid --filter '{"status":"paid"}' --lease 600
nonodb-cli subscription-ping orders paid 600
nonodb-cli webhooks list
nonodb-cli webhooks deliveries dead
nonodb-cli webhooks retry 01J...

The CLI creates webhook rules and retries deliveries. It does not run handler code; webhooks and jobs are evaluated by daemon workers or external worker processes.

Backups and restores

Terminal window
nonodb-cli --db app1 backup /var/lib/nonodb /var/backups/nonodb/app1
nonodb-cli backup-all /var/lib/nonodb /var/backups/nonodb/20261127
nonodb-cli inspect /var/backups/nonodb/app1
nonodb-cli verify-backup /var/backups/nonodb/app1
nonodb-cli --db app1 verify /var/lib/nonodb
nonodb-cli --db app1 restore /var/backups/nonodb/app1 /var/lib/nonodb --force --verify

backup is online and writes a compacted copy. restore requires the daemon to be stopped. verify is a deep check of a live database directory.

For PITR:

Terminal window
nonodb-cli --db app1 restore --to 2026-01-01T12:00:00Z \
/var/backups/nonodb/snapshots /var/lib/nonodb \
--wal /var/lib/nonodb/app1/wal \
--force --verify

Branches and compaction

Terminal window
nonodb-cli --db app1 branch app1-ci --data /var/lib/nonodb --verify
nonodb-cli compact /var/lib/nonodb/default

A branch is an independent database, useful for CI. Compaction rewrites the live file after stopping the daemon; it refuses to run against a live environment.

Auth and replication

Terminal window
nonodb-cli auth init
nonodb-cli auth principal add prometheus metrics:read
nonodb-cli auth token create prometheus
nonodb-cli auth token revoke <id>
nonodb-cli replication status
nonodb-cli replication promote <epoch>
nonodb-cli replication demote <epoch> replica https://new-primary:7878

Auth commands edit the registry. The daemon watches the file and swaps a valid change atomically; an invalid edit keeps the last known good registry.

Raw execution

Terminal window
nonodb-cli --db app1 exec '{"op":"find","coll":"orders","filter":{},"limit":1}'

exec sends one request and prints JSON. It is useful for automation and for operations not wrapped by a subcommand.

What the CLI does not do

  • It does not support TLS or mTLS. Use an official client for encrypted connections; the CLI is for local administration.
  • It is not a schema migration tool.
  • It does not run arbitrary shell commands on the daemon.
  • It does not manage a cluster from one place beyond the replication commands.
  • It does not replace the GUI for visual inspection or the API for application integration.
  • It does not make backups automatically unless a backup job is configured.

A practical operating set

  • ping and ready in health checks.
  • capabilities before upgrading clients.
  • server when a port or socket is unclear.
  • backup + verify-backup on a schedule.
  • restore --verify in a drill.
  • instances when several daemons share a host.
  • replication status before and after a failover.
  • quota and map for capacity.

The CLI is deliberately boring. That is a feature when the daemon is not starting and you need a tool that only needs the data directory.

The CLI reference documents every command, flag, environment variable, and procedure.

All engineering notes →Read the docs