Skip to content

CLI ​

Everything ships in one binary. pico runs a node, acts as a client for both HTTP protocols, administers a cluster, and benchmarks it. Client commands print data to stdout and everything else to stderr, so output pipes cleanly.

Connecting ​

Client commands take their connection from global flags, each with an environment variable equivalent: where to talk, which wire protocol, and the credential.

bash
pico --endpoint http://node2.internal:4437 head /streams/orders
pico --protocol ds read /streams/orders
pico --http2 append /streams/orders
FlagVariablePurpose
--endpointPICO_ENDPOINTThe server base URL. Defaults to http://127.0.0.1:4437
--protocolPICO_PROTOCOLpico or ds, since the two differ on the wire. bench also takes kafka
--http2PICO_HTTP2Speaks HTTP/2 only, which multiplexes many concurrent appends over one connection
--profilePICO_PROFILEA saved profile to take the defaults from, see Profiles
--tokenPICO_TOKENThe bearer credential
--ca-certificatePICO_CA_CERTIFICATEA PEM file of CA certificates to trust for https endpoints, on top of the system's, see TLS

The token rarely belongs on the command line. pico auth login stores it instead, in the OS keyring or a private credentials.toml next to the config when no keyring is available (PICO_NO_KEYRING=1 forces the file, the right setting for CI), and every command attaches the stored credential automatically. An explicit flag or variable wins over storage. pico auth status shows where the credential lives, its id, and whether the endpoint accepts it, and pico auth logout removes it. Getting a token in the first place is covered in Authentication.

Profiles ​

Connection flags for a server you use often can be saved as a profile with pico config.

bash
pico --endpoint http://node2.internal:4437 --protocol ds config set prod
pico config use prod
pico ls

set stores the global flags under a name, get and ls inspect them, rm deletes one, use picks the default, and path prints the file location, which PICO_CONFIG overrides. Flags always win over the profile, so a saved default can be overridden per invocation. Stored credentials are filed under the profile name too, so pico auth login against two clusters keeps their tokens apart.

Stream commands ​

The verbs mirror the protocol. create is idempotent, append reads newline-delimited records from stdin, read catches up and returns, tail starts at the tail and -f keeps following.

bash
pico create /streams/orders --content-type text/plain --partitions 3
seq 1 1000 | pico append /streams/orders --partition 0 --batch 100
pico read /streams/orders --partition 0
pico tail /streams/orders --partition 0 -f
pico head /streams/orders
pico ls --prefix /streams/
pico trim /streams/orders --partition 0 --seq 500
pico close /streams/orders
pico delete /streams/orders

ls and trim exist on the Pico protocol only, and the Durable Streams protocol appends one record per request, so --batch only applies to pico. On a topic with several partitions, head, append, read, tail, and trim take --partition.

Topic settings ​

create takes a flag for every topic setting, describe prints them, and alter changes the ones that can change, with none removing a setting.

bash
pico create /streams/orders --partitions 3 --retention-ms 86400000
pico describe /streams/orders
pico alter /streams/orders --partitions 6 --retention-ms none --retention-bytes 1073741824
create flagalter flag
--content-type
--partitions--partitions, grow only
--ttl or --expires-at
--retention-ms, --retention-bytesThe same, or none
--closed

Admin commands ​

Admin commands talk to a node's admin listener, not the stream endpoint. The target comes from --admin-endpoint or PICO_ADMIN_ENDPOINT, defaulting to http://127.0.0.1:9090. The credential comes from --token or PICO_ADMIN_TOKEN, then PICO_TOKEN, then the stored one. --json switches any command from formatted lines to raw JSON.

bash
pico admin cluster
pico admin nodes
pico admin transfers
pico admin stream /streams/orders --partition 0
pico admin transfer /streams/orders --partition 0 --to-node 2 --wait
pico admin set-slots 2 --slots 4
CommandDoes
clusterPrints the node's identity, the applied index, stream and object counts, the GC backlog, how many transfers are pending, and whether it holds the lease
nodesLists every registered node with its epoch, address, slots, open and closed log counts, and whether it is fenced
transfersLists the partitions moving between nodes
streamShows one partition's owner, state, epoch, offsets, and stored bytes
transferStarts a move, and with --wait polls until the partition settles on the target
set-slotsChanges a node's placement weight

stream and transfer take --partition for topics with several partitions. nodes and transfers follow every page of the list.

Benchmarking ​

pico bench writes and reads a temporary stream against any endpoint and reports throughput and latency percentiles.

bash
pico bench --record-size 1024 --duration 15

It exercises the same client path as append and read, so the numbers reflect what an application would see, including protocol and redirect behavior. --help lists the load shape flags: in-flight requests, batch size, streams, partitions, connections, and a target rate.

--protocol kafka benchmarks the Kafka listener instead, through librdkafka. With a token it connects over SASL_PLAINTEXT, the token id as the username and the token as the password, so it needs a node with auth required and a token with the kafka audience, see Kafka authentication. It cannot speak SASL_SSL, so the Kafka listener of a node running TLS is out of its reach.

Serving ​

pico serve runs a node. Its flags configure the listeners, the metadata database, and the object store, and every one has a PICO_* environment variable. The flags are covered in Configuration and full deployment layouts in Deployment.

The node stops becauseIt printsExit code
SIGTERM or Ctrl-Cshutting down0
It was fenced, or its WAL was taken overthis node left the cluster, shutting down1

A stopped node's streams move to live nodes either way, see Failover. A supervisor should restart a node that exits with 1: it rejoins at a new epoch.