Rune CLI
One program, rune, for everything you do to a cluster by hand: run Rune QL, define topics and views, manage users and namespaces, read counters, back up the catalog. It logs in like any client: a user, a password file, TLS.
Install
One program, rune. Pick your system below; then rune --version prints the installed version and rune with no arguments lists every command. Archives and a SHA256SUMS file are on the tap's releases.
macOS
macOS 13.3 or later, Apple Silicon or Intel.
Always type the full name arcanumruna/tap/rune: Homebrew has an unrelated program called rune; uninstall it first if you have it, since both install a rune command. Upgrade with brew update && brew upgrade arcanumruna/tap/rune.
without Homebrew
Linux
x86-64 or arm64 with glibc 2.34 or newer: Ubuntu 22.04 and later, Debian 12 and later, Fedora, RHEL, Rocky and Alma 9 and later, Amazon Linux 2023, Arch and openSUSE Tumbleweed. One build runs on all of them, so there is no per-distribution package. Not Alpine (musl) or Debian 11. It needs libuuid, present on standard installs; on a minimal image, apt install libuuid1 or dnf install libuuid.
without Homebrew
To upgrade without Homebrew, run the same commands again: they fetch the latest release.
Windows
Windows 10 or 11, x64. The examples on this page are bash: on Windows, run them in Git Bash, which comes with Git for Windows. rune itself also runs in PowerShell and cmd.
No Scoop yet: install it, and Git, which Scoop needs for buckets, in PowerShell as yourself, not as administrator. Upgrade with scoop update rune.
without Scoop, in PowerShell
No administrator needed: it installs for you only. Open a new terminal, then rune --version. To upgrade, run it again: it fetches the latest release.
Windows Firewall drops incoming traffic it did not ask for, the way a home router does. The CLI gets its answers back on the connection it opened (see --gateway-response-port under Connect), so there is nothing to set.
Connect and log in
Each command connects, logs in, does its work and disconnects, like psql -c. Log in once with rune login and later commands need no options and no password. Rune QL is Rune's SQL-like language; rune console is its prompt and rune ql runs it from scripts.
or save the login
| rune login | Asks for the password, or reads --password-file, checks it with the broker and saves a profile: the broker, the user and the TLS and network options you gave. The password is never saved, only a key derived from it. It prints rune: logged in as admin@localhost:40200 (profile default); the key is kept in …. |
| where it is kept | The key goes in the macOS Keychain, the Windows Credential Manager or the Linux Secret Service. Without a Secret Service, as on a server with no desktop, it goes in a file only you can read, and rune login says where. The profile, which holds no secret, is in ~/Library/Application Support/rune/profiles on macOS, ~/.config/rune/profiles on Linux and %APPDATA%\rune\profiles on Windows. |
--profile nameRUNE_PROFILE | Keeps several logins side by side, one per cluster for example: rune login --profile staging …, then rune ql --profile staging -e '…'. Letters, digits, ., _ and -.Default default |
| what wins | Options on the command line, then RUNE_* variables, then the profile. Another --broker, another --user or a password file is a different login: the saved key is not used for that command. A login needs TLS, so --insecure-plaintext is refused by rune login and never uses a saved one. |
| rune logout | Removes the profile and its key; --profile name for another one. It prints rune: logged out (profile default), or rune: not logged in (profile default): nothing to remove. |
| not logged in | A command that needs a broker, given none and with no saved login, stops with rune: not logged in: run rune login --broker <host:port> --user <name>. So does --profile name for a profile that does not exist. |
in a script, with the password in a file
Every command that talks to a broker takes the same options: which broker, who you are, the password file, and which certificate to trust. Each option also has an environment variable, so you can set it once per shell. That saves typing; only rune login remembers anything between commands.
or the broker and your namespace in one address
who and where
--broker host:portRUNE_BROKER | The broker to call first: the host name and the client port of any node (40200 in the self-host setup). From there the CLI finds the leader by itself and follows its redirects. A full Aeron channel such as aeron:udp?endpoint=host:40200 also works. Without it, the CLI only reaches a broker on the same machine through shared memory.Default aeron:ipc: a broker on the same machine |
--url rune://host:port/nsRUNE_URL | The broker and your namespace in one value. It stands for --broker host:port and puts the namespace in front of your user name, so --user ws1 logs in as ns/ws1. The rules are below.Default unset |
--user nameRUNE_USER | Who you log in as. A user of a namespace is written ns/name (or just name with --url). Leave it out only for a development broker without authentication.Default unset: no user is sent |
--password-file pathRUNE_PASSWORD_FILE | A file holding your password on one line; the line break at the end is ignored. Make it readable only by you (chmod 600). There is no --password and no RUNE_PASSWORD: a password on a command line lands in your shell history and in the process list, so the CLI refuses the option and ignores the variable with a warning. Without a file, only rune console asks for the password on the terminal.Default unset |
encryption
--tls-ca fileRUNE_TLS_CA_FILE | Which certificate to trust, as a PEM file. Leave it out for a certificate bought from a public authority: the ones your operating system trusts are used. For a self-signed certificate, like the self-host one, give that certificate's file.Default unset: the certificates your operating system trusts |
--tls-host nameRUNE_TLS_HOST | The name the broker's certificate must carry. Set it when you connect by an IP address, or by a name the certificate does not list.Default the host in --broker |
| --insecure-plaintext | Connect without encryption, only to a development broker started with RUNE_AUTH=disabled. It never sends a password: together with a user, a password file or security bootstrap it is refused before anything connects, and it cannot be combined with --tls-ca or --tls-host. When a broker has authentication off, every command prints a WARNING line saying so.Default off |
networks
--gateway-response-port portRUNE_GATEWAY_RESPONSE_PORT | How the broker's answers reach you. auto: they come back on the connection the CLI opened, through the broker's gateway response port (its client port + 1000: 41200 in the self-host setup), so a home router, a cloud NAT or Windows Firewall lets them through. If that port has not answered after half the connect timeout (2.5 s), the CLI falls back to 0 for that broker.0: the broker sends its answers to your machine as new incoming traffic (see --cli-egress), which routers drop. A port number: that port, with no fallback, for a broker that binds another one.Default auto (also -1) |
--cli-egress channelRUNE_EGRESS | The address on your machine where the broker sends its answers. Set it, as aeron:udp?endpoint=myhost:40500, when the broker must reach you under another name, for example from inside a container or across a VPN. When the CLI cannot work an address out, it says so and asks for this option.Default the address your machine uses to reach the broker, with a free port the system picks, which is right on almost every network |
rarely needed
| --cli-stream-in n --cli-stream-out n | Channel numbers inside the connection, like extensions on a phone line. --cli-stream-in must match the broker's RUNE_CLIENT_STREAM_ID; change them only if the broker's was changed.Default 1 (--cli-stream-in), 2 (--cli-stream-out) |
| --cli-data-dir dir | A scratch folder for the networking library inside the CLI. A folder you name is used as it is and left in place.Default a fresh temporary folder, removed when the command ends (also --cli-data-dir "") |
| --cli-aeron-dir dir | Use an Aeron media driver already running with that folder instead of the CLI's own. Only for machines that run a shared driver.Default unset: the CLI starts its own driver |
the rules for --url
| form | Exactly rune://host:port/ns: rune:// in lowercase; a host name, an IPv4 address or an IPv6 address in brackets ([::1]); a port from 1 to 65535; a namespace name (lowercase letters, digits and -; not default, which you reach with --broker). No user@, ?query, #fragment or trailing /. A mistake exits with code 2 and a message naming it. |
| user | ws1 becomes ns/ws1; ns/ws1 stays; other/ws1 is refused. No user: none is sent. |
| --url and --broker | Never both on one command line. Of the two variables, RUNE_URL applies when RUNE_BROKER is not set; with both set the CLI refuses to guess. An option always beats the other one's variable: --broker beats RUNE_URL, --url beats RUNE_BROKER. |
| position | --url, --user and --broker may also come before the command: rune --url rune://… ql -e '…'. |
| offline commands | catalog diff, catalog replay and security gen-cluster-key ignore RUNE_URL; --url on them is an error. |
Commands
| login · logout | Save a login so later commands need no options and no password; remove it. |
| console | An interactive Rune QL prompt, or a .rql script run as one unit. |
| ql | One statement or a script, then exit. For shell scripts and CI. |
| stats | A topic's or a view's counters, partition by partition. |
| schema | Print a topic's schema; generate a C++ header for its records. |
| namespace | Tenants: create them, set their limits, see their usage, suspend, resume, delete. |
| catalog | The history of every definition: list, export, compare, replay, serve. |
| security | Make a cluster key; create the first admin by hand. |
| version | rune version or rune --version prints rune X.Y.Z, the installed version. |
rune console
A prompt for Rune QL. A statement ends at ;, so it may span lines. Everything runs over one session: a failing statement prints its error and the session goes on. exit, quit or Ctrl-D (on Windows Ctrl-Z, then Enter) leaves.
a script, all or nothing
| -f file | Run a script instead of the prompt; -f - reads it from standard input. Every statement is checked first, so nothing runs unless the whole script is valid. Then they run in order, and the first failure stops the run, naming the statement. The exit code is the broker's error code (25 TopicExists, 30 SchemaIncompatible, 31 SchemaConflict, …), 1 for a local error, 2 for a mistake on the command line.Default unset: the interactive prompt |
| --dry-run | Check each statement and print what it would do. No broker needed.Default off |
| --request-id hex | Makes a script safe to run twice. Give 32 hex digits (not all zero); a second run with the same id gets the first run's answers instead of TopicExists. With -f, statement N uses the id plus N − 1. Without it, creating a topic that exists is an error.Default unset |
| --expected-version N | For alter topic changes to columns: apply the change only if the topic's schema is still at version N, so two people cannot overwrite each other's change. Not checked for alter topic … set, which changes settings. A stale N is SchemaConflict (31). From 0 to 65535.Default 0 = no check |
| --verbose | Print every redirect to the leader and every retry on standard error.Default off |
| password | With a user and no password file, the console asks for the password on the terminal and will not start without one. With no user (a development broker) it needs no terminal, so generate-ql | rune console works and the session stays alive between slow lines. |
| first login | An admin created with a one-time password is told WARNING: password change required — run ALTER USER admin SET PASSWORD '…';. Until then only that statement is allowed. |
| ends the session | Only SessionRevoked (46): an admin revoked your session or changed your password with TERMINATE SESSIONS. |
rune ql
One Rune QL statement with -e, or a script with -f, then exit. Any broker will do: a schema change sent to a follower is redirected to the leader (at most 3 hops).
| -e "statement" | One statement. A statement holding a password or a verifier is refused here, so it never shows in the process list or your shell history: put it in a file.Default none: give -e or -f |
| -f file | A script; -f - reads standard input. Nothing is sent unless every statement parses; then they run in order and stop at the first error, statement N: ….Default none: give -e or -f |
| --dry-run · --request-id · --expected-version · --verbose | The same as for console. |
| output | A select prints a header line, one line per row and (N rows); a point read that finds nothing prints (no row). Columns are padded to the widest cell, bytes values print as x'…' hex and an empty aggregate as NULL. |
| exit code | 0 done, 1 any failure, 2 a mistake on the command line. For the broker's own error code use rune console -f. |
rune stats
The counters of a topic or a view, read from each partition's leader. Needs DESCRIBE on it.
| --partition N | Only that partition.Default all |
| --json | One line of JSON with the same names; constraints as {constraintId, label, rejections}.Default off |
| exit code | 0; 1 for an unknown name or a partition that could not be read (stats of partition N: not authorized); 2 a mistake on the command line. |
what each counter means
| rejectionsKeyExists · rejectionsKeyNotFound · rejectionsConstraint | Writes the broker refused: an insert of a key that exists, an update of a key that does not, a broken view rule. |
| constraint view.rule N | Refusals per rule, such as constraint account_stats.max_characters 1 or character_name.unique 3. |
| verdictLag · verdictWatermark · verdictMarkersWritten | How far behind the newest record the checks are (0 = caught up), the offset below which every check is final, and how many results it wrote. |
| rejectedNotCompacted | Refused records still on disk, waiting for compaction. |
| autoIncrementCounter · autoIncrementReservedThrough · autoIncrementIdsBurned | The next id; the highest id reserved; ids taken but never stored (a refused batch, a reservation lost in a failover). |
| txnVotesYes · txnVotesNo · txnVotesNo… | Transaction checks passed and failed, and why they failed: ConstraintViolation, KeyExists, KeyNotFound, TxnTooLarge. |
| txnVoteLatencyNsMax · txnVoteLatencyNsTotal · foldPausedOnTxnLockNs | The longest and total time a transaction check took, and time other writers waited on rows a transaction had locked, in nanoseconds. |
| txnMarkerWithoutVote | An alarm: always 0. Anything else is a bug to report. |
| uniqueConflicts | On a unique view: extra records that claim a key someone already owns. |
| scanRows · scanPages | Rows and pages served by scans of the view. |
| transientRecordsEvicted · transientSourceResets | On a view over a transient topic: records dropped before the view read them, and times its source was reset. |
A counter that does not apply is not printed: a topic without checks has no rejections, one without autoincrement no ids. A partition with none prints (no counters).
rune schema
Read a typed topic's schema, and turn it into a C++ header.
| get topic | Prints the schema. An untyped topic says topic 'x' is untyped: it has no schema. |
| generate topic --out dir | Writes dir/topic.gen.h: a type that reads records of every schema version up to the current one. A field name ending in _ is refused; that ending is reserved for the generated code.Default none: --out is required |
| generate --from-file blob --out dir | The same from a saved descriptor, without a broker. The blob is the descriptorBlob an app gets from the SDK's getTopicSchemaAndWait, written to a file. Add --lease when the blob is a lease topic's stored schema; it adds withLease() and LeasesRow.Default none: --out is required |
| list [--verbose] | Lists only topics created by the same process, so from the command line it prints (no topics applied in this session). To list a namespace's topics, use catalog list. |
rune namespace
A namespace is a tenant: its topics, views, users and groups are its own, named ns/name. default always exists. Creating, limiting, suspending and deleting needs ADMIN on the cluster; a namespace admin sees only its own namespace.
| create name [--limit N …] | A name of lowercase letters, digits and -, up to 63 characters. Limits you do not name take the broker's defaults (RUNE_NS_DEFAULT_<LIMIT>, normally unlimited). |
| limits name [--set limit=N …] | Without --set, prints the limits. With it, changes the named ones and keeps the others. Lowering a limit deletes nothing: objects over it stay, and the next create is refused. Lowering a retention maximum is the exception: old data goes at the next retention pass. |
| usage name | Each limit next to its current use on the broker you asked; a limit with nothing to count prints -. Rates, disk and connections are per broker. |
| suspend name --read-only | Reads go on; writes, schema changes, transactions and offset commits are refused with NamespaceSuspended (51). Open transactions are aborted, sessions stay. |
| suspend name --reject-all | Everything is refused and every session of the namespace is closed. A login with the right password gets NamespaceSuspended (51). |
| resume name | Back to active. Suspending a namespace twice in the same mode, or resuming an active one, is a harmless no-op. The cluster admin is never suspended. |
| delete name [--yes] | Deletes the namespace with every topic, view, user and group in it. On a terminal it asks [y/N]; elsewhere (a script, CI) it refuses without --yes. The name is free at once; the data is removed in steps that survive a crash. default cannot be deleted.Default without --yes: ask on a terminal, refuse elsewhere |
every limit · 0 = unlimited · rates, disk and connections are per broker
| max-topics · max-views · max-schemas · max-groups · max-users | How many topics, views, typed topics (schemas), consumer groups and users the namespace may have.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| max-partitions-per-topic · max-partitions-total | Partitions in one topic, and in all of them together.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| max-versions-per-schema | How many times one topic's schema may change.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| max-disk-bytes | Disk used by the partitions this broker leads. Past it, writes are refused; copying data between brokers never is.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| max-retention-ms · max-retention-bytes | The longest a topic may keep data, by age and by size. A topic asking for more is refused; existing ones are cut to this.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| max-message-bytes · max-batch-bytes | The largest single record and the largest batch of records a producer may send.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| produce-bytes-per-sec · produce-records-per-sec · fetch-bytes-per-sec · request-ops-per-sec · query-cycles-per-sec | Rates. Over one, requests are answered Throttled (53) with a time to wait, and the client library waits and retries by itself. On a cluster of N brokers, set the total divided by N.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| burst-seconds | Lets a quiet namespace save up to this many seconds of each rate and spend it in a burst. From 0 to 3600.Default 0 = no saving |
| max-connections · max-connections-per-user · max-sessions-per-user | Open connections in the namespace, per user, and logged-in sessions per user.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| max-open-txns · max-txn-time-ms | Transactions open at once, and the longest one may stay open (at most 30 days, 2 592 000 000).Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| max-view-memory-bytes | Memory the namespace's views may use. Past it, views pause and their reads answer ViewPaused (54) until memory falls or the limit rises.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 = unlimited |
| max-leases | Live leases at once. The one limit not unlimited by default.Default 16 777 216 |
| min-replication-factor · max-replication-factor | The fewest and most copies (replicas) a new topic may ask for.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 |
| lowest-acks · lowest-min-insync | The weakest write confirmation allowed: lowest-acks 2 or more forces every write to wait for all in-sync copies (0 and 1 allow any). lowest-min-insync is the fewest in-sync copies a topic may require.Default the broker's RUNE_NS_DEFAULT_<LIMIT>, normally 0 |
| feature-bits | Which features the namespace may use, added together: compaction 1, transactions 2, QL 4, views 8, SQL 16, Redis 32, anonymous read 64, passwords 128. QL, SQL and Redis are stored only, not enforced yet.Default 0 = all of them |
A refused create answers NamespaceLimitExceeded (52) with what was counted, for example namespace limit exceeded: topics (100 of 100).
rune catalog
The catalog is the cluster's history of every definition: topics, views, schemas, users, grants. Reading it needs DESCRIBE on the cluster. These commands work on the whole catalog; to see the changes to one topic or view, use show history topic NAME in the console.
| list --json --namespace ns | One namespace's live topics (name, partitions, schema version, retention) and views (name, kind, source topics), as one JSON object. At most 2 000 entries; "truncated": true says when there were more. |
| export [--up-to offset] | Writes the catalog as an .rcat file on standard output; --up-to stops at an offset.Default unset: the whole catalog |
| diff --from a --to b | Compares two catalogs, each a file or a live broker. Exit 0 the same, 3 different (printed), 1 error, 2 usage. |
| replay --from a --into host:port [--up-to offset] [--cluster-id id] | Issues every definition of a file or another cluster against --into, recording where each came from. --cluster-id names the source.Default the --from value |
| serve [--listen host:port] [--refresh-wait ms] [--cli-data-dir dir] | Answers GET /internal/v1/namespaces/<ns>/catalog with the body of list --json and GET /healthz with ok. --refresh-wait bounds each read of the catalog (at most 15 000). Ctrl-C or SIGTERM stops it.Default 127.0.0.1:55990 (address), 5 000 ms (--refresh-wait) |
rune security
The two steps before anyone can log in. Users, roles and grants afterwards are Rune QL statements.
| gen-cluster-key --out path | Writes a new cluster key, 64 hex characters, readable only by you (mode 0600). Every broker of the cluster needs the same key. An existing file is never overwritten.Default none: --out is required |
| bootstrap --admin name | Creates the first security admin of a new cluster, once. Not needed when the broker sets RUNE_ADMIN_PASSWORD_FILE (Self-host). Without --password-file it makes a 24-character one-time password and prints it once. Either way the admin must change the password at the first login. A second bootstrap is refused: the cluster already has an admin.Default none: --admin is required |
| --cluster-key-file path | Proves you hold the cluster key.Default RUNE_CLUSTER_KEY_FILE |
| --password-file path | Sets the admin's password from a file instead of a printed one-time password. It too must be changed at the first login.Default unset: a printed one-time password |
Exit codes and common errors
| 0 | done |
| 1 | it failed; the message says why |
| 2 | a mistake on the command line: an unknown option, a missing value, an option given twice |
| 3 | catalog diff: the two sides differ |
| other | console -f and schema get: the broker's error code |
when something goes wrong
| AuthenticationFailed (44) | Wrong user or password, or a user of a namespace written without ns/. |
| NotAuthorized (45) | Logged in, but without the grant this needs. An admin runs GRANT … TO USER you. |
| PasswordChangeRequired (47) | A one-time password: run ALTER USER you SET PASSWORD '…'; from a file first. |
| HandshakeFailed (29) | TLS failed: the certificate is not trusted (a self-signed one needs --tls-ca) or carries another name (add --tls-host). |
| connects, then times out | Answers do not reach you. Behind a router, a NAT or Windows Firewall, add --gateway-response-port; inside a container or VPN, set --cli-egress. |
| TopicExists (25) | The topic is already there. Re-running a setup script? Give it a --request-id. |
| SchemaConflict (31) | Someone changed the topic since the version you passed in --expected-version. Look again with show topic. |
| NamespaceLimitExceeded (52) · Throttled (53) | A namespace limit. See rune namespace usage. |
Environment variables
Each one stands in for an option; an option on the command line wins.
| RUNE_BROKER · RUNE_URL | --broker · --url |
| RUNE_USER · RUNE_PASSWORD_FILE | --user · --password-file |
| RUNE_TLS_CA_FILE · RUNE_TLS_HOST | --tls-ca · --tls-host |
| RUNE_GATEWAY_RESPONSE_PORT · RUNE_EGRESS | --gateway-response-port · --cli-egress |
| RUNE_PROFILE | --profile |
| RUNE_CLUSTER_KEY_FILE | security bootstrap --cluster-key-file |
| RUNE_PASSWORD | Ignored, with a warning. Use a password file. |