CLI Reference

Complete reference for the flo command-line interface.

Global Options

FlagDescription
-e, --endpoint <host:port>Server endpoint; else FLO_ENDPOINT, else 127.0.0.1:9000
-p, --port <port>Server port on 127.0.0.1, when --endpoint isn't given; else FLO_PORT
-n, --namespace <name>Namespace for operations; else FLO_NAMESPACE, else default. Given, it always wins, -n default included
-o, --output <fmt>Output format: table, json, raw
-v, --verboseVerbose output
-V, --versionThe release, such as flo 0.2.0, or flo dev for a development build. flo version --verbose adds the protocol version, op table hash and build. A server serves only clients built from its table; a mismatch exits 5 naming both tables.

-e, -p, -n, -o and -v mean the same thing on every command; no command reuses those letters for a flag of its own.

Errors and exit codes

A refused command prints Error: <message> [<status>], or [<status>/<reason>] when the server names a reason, e.g. [bad_request/out_of_range], and exits:

CodeMeaning
0ok
1not found or absent
2usage error
3refused (bad_request, conflict, unauthorized, internal_error, and unavailable from a halted shard, which retrying doesn't help)
4retryable (overloaded, rate_limited, unavailable)
5transport failure, timeout, version mismatch, a cut-off answer, or the CLI out of memory
6pending (outcome_pending): the write committed but its shard halted before applying it; the message says whether it applies when the shard resumes. Don't resend it unchanged
78the data directory can't be used: written in another format, or not a Flo data directory. Restarting doesn't help; the packaged systemd unit stops on it

Namespaces

:::note Namespaces aren't a security boundary. A namespace separates names, not access. Clients aren't authenticated yet, so anything that can reach the client port can read and write every namespace. Keep the port on a private interface. :::

A namespace is created by flo ns create <name>, or by the first write that brings data into it (a delete, a dequeue or an ack never creates one). Either way the name is 1–63 bytes of lowercase letters, digits, _ and -, starts with a letter or digit, and does not end in -; names starting with _ are the system's. A request naming any other namespace is refused with the reason. A node holds at most 4096 namespaces, default among them.

Shard 0 owns the namespaces: it gives each one its id and records it in its log, and every other shard learns of it from there. flo ns create answers once the namespace is on disk, so it is usable on every shard by then; if it can't be written within 5 seconds it answers unavailable and creates nothing you can use yet. A first write to a new namespace creates it. On the shard that owns namespaces (the only one on a cluster member) the create and the write go into one log, so the write doesn't wait. On a node of several shards, a first write whose key lands on another shard waits for the create to reach disk first: about one commit, a few hundred microseconds, once per namespace.

flo ns create <name>
flo ns ls
flo ns info <name>

A read, list or scan in a namespace that was never created is refused no_namespace, not answered empty or not found: the CLI prints namespace not found and exits 1. A write to it creates it instead. A node that is behind the leader asks the leader before it answers so, and a name it has just found missing it answers so for 100 ms without asking again. While it asks, the read is held and later requests on the same connection go ahead of it, as with a blocking read: reads and writes on one connection aren't ordered while a read is held, so a write sent after the read may be one it sees. On one node, a read through a shard other than the namespaces' owner waits a moment the same way while that shard checks with the owner.

A blocking wait (queue dequeue --block, a blocking stream or group read) in a namespace that was never created is refused no_namespace at once, rather than left waiting: the write that would create the namespace couldn't wake it. Create the namespace, or write to it, first.

flo ns info prints when the namespace was created, and exits 1 if there is none. flo ns ls lists every name in name order.

Deleting a namespace isn't supported yet: flo ns delete is refused and removes nothing. It no longer takes --force, which had no effect. A namespace's data lives on every shard, and its name can't yet be retired so that a later create doesn't inherit it.

Server

flo server start

Start a Flo server.

flo server start [options]
FlagDescriptionDefault
-c, --config <path>Config file pathflo.toml
-p, --port <port>Client protocol port; 0 binds a free one, printed in the ready line and by server status9000
--bind <addr>Address to listen on0.0.0.0
-d, --data-dir <path>Data directory~/.flo/data
--durability <mode>sync or async_flush—
-s, --shards <n>Number of shard threads, at most 256; a cluster member runs 1 (the default resolves to it)CPU count, less one on 4 or more cores
--max-txn-ops <n>Most ops one KV transaction may hold, 1 to 25664
--max-txn-bytes <n>Most key and value bytes one KV transaction may hold, 1 to 1048576262144
-l, --log-level <level>debug, info, warn or error—
--log-format <format>text or json—
--clusterStart as the first member of a cluster; leads alone until others join—
-j, --join <host:port,...>Join members that exist, by their peer port (listen_port + 500)—
--node-id <id>Unique node identifierderived from hostname:port
--raft-port <port>Peer port, with --cluster or --joinlisten_port + 500
--metrics-port <port>Metrics HTTP portlisten_port + 1
--dashboard-port <port>Dashboard HTTP portlisten_port + 2
--no-metricsDon't start the metrics server—
--no-dashboardDon't start the dashboard—

There is no partition count to set: keys route over a fixed 4096 slots on every node and cluster, and --partitions is refused, saying so (exit 2).

flo server secret

Print a new secret for the peer port, from 32 random bytes. Give every member the same one: in [cluster] secret, in a file named by [cluster] secret_file (mode 600), or in FLO_CLUSTER_SECRET. A cluster starts only with a secret in this form.

flo server secret > /etc/flo/cluster.secret
chmod 600 /etc/flo/cluster.secret
chown flo:flo /etc/flo/cluster.secret   # the user the server runs as

The server refuses a secret_file that its group or others can read or write.

flo server inspect

Show a stopped node's cluster log: its hard state, last index and term, what is committed, the latest member list, the cluster's id and generation, and whether its lost-log guard is on. Every member of one cluster shows the same id. Writes nothing. Refuses while a server holds the data directory, and refuses a directory that does not exist.

flo server inspect --data-dir /var/lib/flo
FlagDescriptionDefault
-c, --config <path>Config file naming the data directoryflo.toml
-d, --data-dir <path>Data directoryfrom the config

flo server force-members

Make a stopped node the cluster's only voter, for when a majority has lost its data. Without --yes it prints what it would change and stops. With --yes it writes a member list naming only this node, in the same cluster at its next generation, and retires its cluster secret; restart it with a new one. See Clustering.

flo server force-members --data-dir /var/lib/flo --yes
FlagDescriptionDefault
-c, --config <path>Config file naming the data directory and the secretflo.toml
-d, --data-dir <path>Data directoryfrom the config
--yesMake the change—

flo server repair skip

Skip the entry a stopped single node's shard halted at, so the shard comes up past it. The skipped write never runs, on this build or any later one; its client was told so. Without --yes it prints the entry it would skip and stops. It refuses a running server's data directory, a cluster member's (a member's shard is repaired by the cluster), an index the shard isn't halted at, and a config entry or a term's no-op, which a halted shard still applies.

flo server repair skip --data-dir /var/lib/flo --shard 3 --index 18234
flo server repair skip --data-dir /var/lib/flo --shard 3 --index 18234 --reason "malformed invoke" --yes
FlagDescriptionDefault
-c, --config <path>Config file naming the data directoryflo.toml
-d, --data-dir <path>Data directoryfrom the config
--shard <n>The halted shard (/status names it)required
--index <i>The entry it halted at (halt_index in /status)required
--reason <text>Why, recorded with the repair—
--yesAppend the repair—

flo server wipe

Empty a stopped node's data directory: for one written by an older Flo, which a server refuses (there is no migration), or to start over. It deletes everything in the directory but keeps the directory, so it works on a mount point. Keys, streams, queues, runs and the cluster membership are gone for good. Without --yes it lists what it would delete and stops.

It needs the directory named: --data-dir, or -c with a config that sets data_dir. It never falls back to a default directory. It refuses a running server's directory, one with another file system mounted inside it, and one that holds no Flo data: no FORMAT that parses, no SYSTEM that loads, no shard directory holding a log. It names any entries Flo never writes before it deletes them. It never follows a symlink: a link in the directory is removed, not what it points at. It keeps lost+found and dotfiles. A wipe cut short leaves the shard directories, which a server refuses, naming wipe; run wipe again to finish.

flo server wipe --data-dir /var/lib/flo
flo server wipe --data-dir /var/lib/flo --keep-as before-upgrade --yes
FlagDescriptionDefault
-c, --config <path>Config file that sets data_dir—
-d, --data-dir <path>Data directoryfrom -c
--keep-as <name>Move the contents into <data-dir>/.flo-kept-<name> instead of deleting them; the next start leaves that directory alone—
--yesDelete (or move) the contents—

flo server salvage

Bring back a shard that is offline on a single node because its data won't read (/status names the shard and the reason). On the stopped node it drops every entry after --truncate-after, and the shard comes up with the entries through it. What it drops is gone for good, committed writes included: their clients were told they succeeded, and salvage prints how many there are.

It reads the shard as far as it reads and refuses a cut at or past the damage, naming the highest entry it can keep. It also refuses when the cut would drop a repair that skips an entry it keeps, since that entry would run again, unless --undo-repairs says to. It keeps entry 1 at least. A data directory that belonged to a cluster is refused: a member's damaged shard is recovered by rejoining instead. Without --yes it prints what it would drop and stops.

flo server salvage --data-dir /var/lib/flo --shard 3 --truncate-after 18233
flo server salvage --data-dir /var/lib/flo --shard 3 --truncate-after 18233 --yes
FlagDescriptionDefault
-c, --config <path>Config file naming the data directoryflo.toml
-d, --data-dir <path>Data directoryfrom the config
--shard <n>The offline shard—
--truncate-after <index>The last entry to keep—
--undo-repairsCut even where it drops a repair of an entry it keeps—
--yesDrop the entries—

flo server status

Show whether the server process is running and the port it bound, from its PID file, and what the data directory holds: its format (or why a server would refuse it) and its shard count.

flo server status [--config <path>] [--data-dir <path>]

It finds the data directory as server start does: --data-dir, else the config file's data_dir, else ~/.flo/data.

flo server stop

Stop the server whose PID file is in the data directory.

flo server stop [--config <path>] [--data-dir <path>] [--force]
FlagDescription
-c, --config <path>Config file naming the data directory
-d, --data-dir <path>Data directory holding the PID file (overrides the config)
-f, --forceStop at once (SIGKILL)

flo server metrics

Fetch the server's metrics.

flo server metrics [--metrics-endpoint <host:port>] [--format text|json]

text prints the Prometheus exposition as served; json prints {"metrics": "<exposition>"}. --metrics-endpoint defaults to localhost:9001. -e/--endpoint and -p/--port, which name the client port, are refused here.

KV

The KV commands are generated from the KV op table: each flag is a field of the op's request, named after it (ttl_ms is --ttl-ms), and each command sends one request. Their output follows the answer's fields:

  • most print one name: value line per field (version: 3), leaving out a field the answer doesn't carry; an answer with no fields prints OK;
  • get, incr and json get print the value alone;
  • scan and history print rows;
  • -o json prints the whole answer as one JSON object, for every command; an integer past 2^53 (a transaction id, a routing hash) is a string, so jq and JavaScript don't round it.

A flag whose name ends in -ms takes milliseconds, or a number and a unit (500ms, 30s, 5m, 1h, 1d). A value outside a flag's range, or not one of its choices, exits 2 naming the flag. A key that isn't there exits 1 with not found.

flo kv set

Set a key's value.

flo kv set <key> <value> [options]
FlagDescription
--ttl-ms <ms>Time to live; omitted for none
--condition <when>always (the default), if_absent (only if the key doesn't exist) or if_present (only if it does)
--cas-version <version>Only if this is the key's version; 0 means the key doesn't exist
-t, --txn <id>Buffer the write in a transaction

It prints version: <n>, or OK inside a transaction, where the write has no version until it commits. A failed condition or version exits 3 with [conflict/condition_failed] or [conflict/cas_mismatch].

flo kv get

Read a key's value, and print it alone.

flo kv get <key> [options]
FlagDescription
-w, --wait-ms <ms>How long to wait, at most 5m; 0 (the default) doesn't wait
--wait-for <what>exists (the default: answers at once if the key exists, else when it's written) or change (the key's next version). On timeout, a change wait prints the unchanged value; a key still absent exits 1
-t, --txn <id>Read inside a transaction, seeing its buffered writes; it can't wait

-o json prints {"version":<n>,"value":"<value>"}.

flo kv mget

Get many keys in one call. Keys may live on different shards; the server gathers them.

flo kv mget <key1> <key2> ... [options]

At most 256 keys per call, from any shards. A missing key prints (nil); it isn't an error. When the answers don't fit one response, the CLI asks again from where the server stopped.

flo kv delete

Delete a key. Deleting a key that doesn't exist succeeds.

flo kv delete <key> [options]
FlagDescription
--cas-version <version>Only if this is the key's version (race-free lock release)
-t, --txn <id>Buffer inside a transaction

It prints existed: true or existed: false, or OK inside a transaction, where whether the key existed isn't known until commit.

flo kv scan

List key names starting with a prefix, a page at a time. Values aren't returned; use get or mget.

flo kv scan [prefix] [options]
FlagDescription
-l, --limit <n>Most names on the page: 1 to 1024, default 1024
--cursor <hex>Where the last page stopped; omit to start

It prints one name per line, then cursor: <hex> when there are more; pass that to --cursor for the next page. With -o raw the cursor line goes to stderr, so stdout is names alone for a while read loop:

flo kv scan user: --limit 100
flo kv scan user: --limit 100 --cursor 0300757365723a3432

flo kv history

Show a key's versions, newest first.

flo kv history <key> [options]
FlagDescription
-l, --limit <n>Most versions to show: 1 to 65, default 10
--before-version <v>Only versions older than v

Each row is the version, the time it was written (at_ms, Unix milliseconds), whether it is a delete, and the value, under a header; -o raw leaves the header out. When one answer can't hold them all, the command asks again until it has shown --limit versions; if older ones remain it prints more: true last (on stderr with -o raw). -o json prints {"versions": [...], "more": bool}.

flo kv incr

Add to an i64 counter, starting from 0. It prints the new value.

flo kv incr <key> [--delta <n>]
FlagDescription
-d, --delta <n>What to add, may be negative (default 1)
-t, --txn <id>Buffer inside a transaction; prints OK, since the value isn't known until commit

A key whose value isn't an 8-byte counter is refused with wrong_type (exit 3).

flo kv expire

Set an existing key's TTL without rewriting its value, or clear it.

flo kv expire <key> --ttl-ms 30s   # expires 30s from now
flo kv expire <key> --ttl-ms 0     # clears the TTL
FlagDescription
--ttl-ms <ms>Required; 0 clears the TTL
--cas-version <version>Only if this is the key's version (race-free lease renewal)
-t, --txn <id>Buffer inside a transaction

It prints OK. A missing key exits 1.

flo kv exists

Existence check, with no value transferred. It prints exists: true and version: <n>, exiting 0, or exists: false and version: 0, exiting 1. Inside a transaction a key with only a buffered write prints version: 0: it has no version until commit.

flo kv exists <key> [-t <txn-id>]

flo kv json get / set / del

Read and write inside a JSON document, using a small JSONPath subset ($, .field, [index]). --path defaults to $, the whole document.

flo kv json set <key> <document> [--path <path>]
flo kv json get <key> [--path <path>]
flo kv json del <key> [--path <path>]
  • json get prints the JSON at the path.
  • json set prints version: <n>. At $ it writes the whole document, creating the key; at any other path the key must already hold a JSON object or array.
  • json del prints version: <n>, or OK at $, which deletes the key.

A path with nothing at it exits 1; a key whose value isn't JSON is refused with wrong_type (exit 3). None run inside a transaction.

flo kv txn begin / commit / rollback

Per-shard transactions buffer writes on one shard and commit them atomically as one Raft entry. A transaction is pinned to the {tag} of the key it begins with (the text between the first { and the next }), or the whole key if it has none.

flo kv txn begin <key>                # → txn: <id>, pinned: <hash>
flo kv txn commit <txn-id>            # → commit_index: <index>, ops: <n>
flo kv txn rollback <txn-id>          # drops the buffered writes

Add --txn <id> to set, get, delete, incr, expire or exists to run it inside the transaction:

TXN=$(flo kv txn begin '{user:42}:name' | sed -n 's/^txn: //p')
flo kv set  '{user:42}:name' "Jane" --txn "$TXN"
flo kv incr '{user:42}:visits'      --txn "$TXN"
flo kv txn commit "$TXN"

The transaction id names its slot, so commit and rollback need nothing else. Every key in a transaction must share the {tag} it was begun with; a key that routes elsewhere is refused with [bad_request/keys_not_colocated] (exit 3). scan, mget, history and the JSON commands don't run inside transactions.

Server caps: 64 ops and 256 KiB of keys and values per transaction, unless the operator sets them higher or lower (at most 256 ops and 1 MiB), 1024 open transactions per shard (past that, txn begin is refused with too_many_transactions). Transactions outlive connections: they are owned by their id, not by the TCP connection. One that goes 30 seconds without a request is dropped, and later use is refused with no_such_transaction.

Streams

flo stream create

Create a stream.

flo stream create <name> [options]
FlagDescription
--partitions <n>Number of partitions (default 1)
--retention, -r <hours>Keep records this many hours (0 = no age bound)
--retention-count <n>Keep at most this many records (0 = no count bound)

flo stream alter

Change a stream's retention. A bound left out, or given as 0, keeps its current value. It works on any stream, including one its first append made.

flo stream alter <name> [--retention <hours>] [--retention-count <n>]

flo stream append

Append a record to a stream.

flo stream append <stream> <data>

flo stream read

Read records from a stream.

flo stream read <stream> [options]
FlagDescription
--start, -s <id>Read records after this StreamID (exclusive; 0-0 is the beginning, $ the latest)
--end <id>Last StreamID to read (inclusive)
--limit, -l <n>Maximum records (default 10); a larger append comes back whole
--block, -b <ms>Wait for new records (at most 300000 ms, 5 minutes; 0 does not wait; a longer wait is refused)
--follow, -fKeep reading new records, like tail -f
--partition, -P <n>Partition to read
--partition-key, -k <key>Read the partition this key routes to

flo stream info

Show stream metadata.

flo stream info <stream>

flo stream delete

Delete a stream and all its data (records, metadata, and name registry). Aliased as flo stream rm.

flo stream delete <name> [--force]
FlagDescription
--force, -fDelete even if the stream is not empty

Deleting a missing stream is a no-op (idempotent). A non-empty stream is refused unless --force is given. Deleting a stream also deletes that stream's consumer groups (a same-named group on another stream is unaffected). To drop only records while keeping the stream, use flo stream trim.

flo stream group

Manage consumer groups. A group is scoped to a single stream: every subcommand takes the <stream> it operates on, and wildcard reads (events.*) are refused.

flo stream group create  <stream> --group <name> [--ack-timeout <ms>] [--max-deliver <n>]
flo stream group read    <stream> --group <name> --consumer <id> [--limit <n>] [--block <ms>]
flo stream group ack     <stream> --group <name> --consumer <id> --ids <delivery,...>
flo stream group nack    <stream> --group <name> --consumer <id> --ids <delivery,...> [--delay <ms>] [--dlq] [--error <text>] [--abandon]
flo stream group touch   <stream> --group <name> --consumer <id> --ids <delivery,...>
flo stream group pending <stream> --group <name> [--consumer <id>]
flo stream group info    <stream> --group <name>
flo stream group list    <stream>
flo stream group members <stream> <group>
flo stream group delete  <stream> --group <name>
flo stream group steal   <stream> --group <name> --consumer <id> --min-idle <ms> [--lease <ms>] --ids <delivery,...>
flo stream group dlq list    <stream> --group <name> [--limit <n>] [--after <cursor>]
flo stream group dlq requeue <stream> --group <name> (--ids <id,...> | --all [--max <n>])
flo stream group dlq delete  <stream> --group <name> (--ids <id,...> | --all [--max <n>]) [--dry-run]
  • read prints each record with its delivery, term.index.id.deliveries, which ack, nack, touch and steal take in --ids. A read takes at most 100 records.
  • steal takes records another consumer has left idle at least --min-idle, idle being the time since its holder last touched it (its read, a steal, or any touch, even one that leaves the lease as it stands). --lease must be within 5 s to 12 h. dlq requeue resets a dead letter's failures to 0, keeping its deliveries and last error; dlq commands take record ids (ms-seq), as dlq list prints them. See Dead letters.
  • --ack-timeout is the lease, 5000 to 43200000 ms (default 30000). --max-deliver is the attempts, 1 to 255 (default 5): a record nacked or expired that many times is dead.
  • nack --error is kept on the record, up to 1024 bytes. nack --abandon hands records back unstarted: ready at once, no attempt spent, never dead-lettered; it takes no --delay, --dlq or --error.
  • A report to a group that isn't there is refused not_found; a read past the group's caps with nothing ready is refused overloaded with reason group_held_full (exit 4).
  • ack, nack and touch say which records they didn't apply to, and why, and then exit non-zero.
  • join, leave and claim are gone: members are the consumers holding records, and a read takes expired and nacked records first.

Queues

A dequeue leases its messages until they're acked (completed), nacked (failed) or their lease runs out; see Queues. Each message's delivery prints as term.index.seq.deliveries, which ack, nack and touch take.

flo queue enqueue

Add a message to a queue.

flo queue enqueue <queue> <data> [options]
FlagDescription
--priority <n>Message priority, 0–255; lower is taken first, and unset is 0. Past 255 is refused
--delay <ms>Ready after this long, not now (at most 86400000, a day)

flo queue dequeue

Take a queue's next ready messages, leased.

flo queue dequeue <queue> [options]
FlagDescription
--count <n>Most messages to take, 1–100 (default: 1)
--block <ms>Wait for messages (at most 300000 ms, 5 minutes; 0 does not wait; a longer wait is refused)
--lease <ms>How long they're held without a touch, 5000–43200000 (default: 30000)
--consumer <id>Who takes them; ack, nack and touch must name the same
--ackComplete them as they're taken: payloads only, nothing comes back

Each line is a delivery and its payload. -o json prints the delivery's term, index and lease expiry and each message; -o raw prints payloads only and is refused without --ack. A count or lease out of range is refused, naming the range.

flo queue ack

Complete messages of one dequeue: they leave the queue.

flo queue ack <queue> <delivery>... [--consumer <id>]

Prints OK: <n> for those it completed, and each one it didn't with its reason (gone, delivered_again, other_holder, expired, released, not_held), exiting non-zero. For an ack, gone means done already.

flo queue nack

Fail messages of one dequeue: ready again, or dead once their attempts are spent.

flo queue nack <queue> <delivery>... [options]
FlagDescription
--delay <ms>Ready again after this long (default: at once)
--dlqDead now, whatever attempts are left
--error <text>Why they failed, kept on the message
--consumer <id>The consumer that dequeued them

flo queue touch

Keep messages of one dequeue: with half their lease or less left, it runs a full lease from now. Prints when the lease now runs out.

flo queue touch <queue> <delivery>... [--consumer <id>]

flo queue peek

The next ready messages, in dequeue order, without taking them.

flo queue peek <queue> [--limit <n>]

flo queue dlq

A queue's dead letters: list, requeue or delete them.

flo queue dlq list <queue> [--limit <n>] [--after <cursor>]
flo queue dlq requeue <queue> (--ids <seq,...> | --all [--max <n>])
flo queue dlq delete <queue> (--ids <seq,...> | --all [--max <n>]) [--dry-run]

dlq list pages a queue's dead letters, oldest dead first, each with its deliveries, failures, when it died, its last error and up to 4 KiB of its payload; a page that stops short prints the --after cursor for the next. dlq requeue makes dead letters ready again at once, at their priority, with their failures reset (their deliveries and last error kept). dlq delete removes them for good; --dry-run says how many it would delete, and with --all it looks at the first batch only, saying "and more remain" when others are past it. With --all, each works a batch of up to 100 at a time, oldest first, up to --max. A message that isn't dead, or isn't there, is named with why, and the command exits 3. A queue that was never written to is refused not found.

flo queue purge

Remove every message from a queue, ready, leased and dead, and print how many went. A consumer holding a purged message finds it gone when it acks.

flo queue purge <queue>

Time-Series

flo ts write

Write a point, several fields of one point, or a batch of InfluxDB line protocol.

flo ts write <measurement> --value <n> [--tags k=v,...] [--timestamp <ms>]
flo ts write <measurement> --fields k=v,... [--tags k=v,...] [--timestamp <ms>]
flo ts write --batch [--file <path>] [--precision ns|us|ms|s]

Examples:

flo ts write cpu --tags host=web-01 --value 82.5
flo ts write cpu --tags host=web-01 --fields user=72.5,system=7.4
echo 'cpu,host=web-01 user=72.5 1708700400000' | flo ts write --batch
  • --timestamp is milliseconds since the epoch and must be > 0. Without it, a --value write is stamped by the server; --fields and a --batch line without a timestamp are stamped once by the CLI's clock, so all their fields share one timestamp.
  • Values must be finite numbers; whole numbers past 2^53 are refused, because a float can't store them exactly.
  • --fields sends one write per field and is not atomic. If one is refused, the error says how many were written.
  • --batch reads line protocol from --file or stdin, with --precision ns|us|ms|s (default ms). Each line names its own measurement, tags and time, so --batch refuses a measurement, --tags, --value, --fields and --timestamp. A bad line is reported by line number, naming the token at fault, and none of its fields are written. The other lines are still written, and the command exits non-zero if any line failed. Backslash escapes, repeated tag keys or fields, and anything after the timestamp are refused.

flo ts floql

Run a FloQL query.

flo ts floql "<query>"

Examples:

flo ts floql 'cpu_usage{host=web-01}[1h] | window(5m) | avg()'
flo ts floql 'temperature[24h] | window(1h) | max() | topk(3)'

Actions

flo action register

Register an action type.

flo action register <name> [options]
FlagDescription
--owner <name>Owner or team name
--timeout <ms>Execution timeout (default 30000)
--retries, -r <n>Maximum retry attempts (default 0)

flo action invoke

Invoke an action.

flo action invoke <name> <input> [--labels <json>]
FlagDescription
--labels, -l <json>Required worker labels, a JSON object, e.g. '{"gpu":true}'; anything else is refused

Invoke priority, delay and idempotency keys aren't supported yet (tracked in #181).

flo action status

Check action execution status.

flo action status <run-id>

Workflows

flo workflow create

Create a workflow from a YAML definition.

flo workflow create -f <file.yaml>

flo workflow start

Start a workflow execution.

flo workflow start <name> [data]
flo workflow start <name> [data] --run-id <id>

The server gives each run an id that names the shard it runs on, so status, history, signal and cancel go straight there. With --run-id you choose the id instead (not of the form wfr-<hex>-<hex>, which is the server's): those commands then ask every shard which holds it, so a generated id is the faster path. A start refuses, as conflict, an id a run of any workflow already has in the namespace; a start retried with the same --idempotency-key answers the run it started. Two starts sent at once with one id can both run; those commands then refuse the id as conflict, so give concurrent starts ids of their own.

FlagDescription
--run-id <id>Choose the run's id. Ids of the form wfr-<hex>-<hex> are the server's and are refused

flo workflow status

Check workflow execution status.

flo workflow status <execution-id>

flo workflow signal

Send a signal to a running workflow.

flo workflow signal <execution-id> <signal-name> [data]

Processing

flo processing submit

Submit a stream processing job.

flo processing submit -f <job.yaml>

flo processing status

Check job status.

flo processing status <job-id>

flo processing stop

Stop a running job.

flo processing stop <job-id>

flo processing remove

Remove a stopped, cancelled or failed job, freeing its slot. A running job is refused: stop or cancel it first.

flo processing remove <job-id>

Cluster

flo cluster status

Show this node's id, role (leader, follower, replica, electing, joining, diverged, guarded: catching up, guarded: confirming the term, removed), the leader it knows (none while electing or joining), the term and the member count. -o json gives the same as one object.

flo cluster status
flo cluster status -o json

flo cluster members

Every member with its role (voter, replica, or joining for one added that has not caught up yet), address, last contact and lag, and the ids removed. Contact and lag are the leader's to report; elsewhere they show -. -o json gives the same as one object.

flo cluster promote <id>...

Make a caught-up replica a voter, one at a time, each answered once it commits. Refused for a member that has not caught up.

flo cluster remove <id> [--yes]

Remove a member, answered once the change commits; the id cannot rejoin. Refused when it would leave no voter; --yes is required when it would leave an even number of voters, or two. The leader may remove itself.