Skip to content
Playground Docs

Configuration

FieldTypeDefaultDescription
DataDirstringRequired. Directory for the Pebble database and local WAL segments. Created if absent.
ObjectStoreobject.StorenilS3 or compatible store. nil = local-only, single-node mode.
AncestorStoreobject.StorenilSource store for a branch node. SSTs referenced by AncestorSSTFiles are fetched from here instead of being re-uploaded.
BranchPoint*BranchPointnilIf set, bootstraps the node from a fork of another database. Applied once on first boot; ignored thereafter. See Branches.
RestorePoint*RestorePointnilBootstrap from a specific S3 version (requires S3 versioning). See Point-in-time restore.
SegmentMaxSizeint6450 MBWAL segment rotation threshold in bytes.
SegmentMaxAgetime.Duration10 sWAL segment rotation age threshold. When WALSyncUpload is false this also controls how often async uploads run.
WALSyncUpload*booltrueControls WAL segment upload behaviour. true (default): each sealed segment is uploaded to S3 synchronously before the write returns — safe when local storage is ephemeral. false: uploads happen asynchronously every SegmentMaxAge; write latency is lower but up to SegmentMaxAge of acknowledged writes can be lost on simultaneous node + S3 failure. Set to false when local storage is durable (e.g. a PVC) and low latency matters. Note: in cluster mode this flag only affects the initial follower WAL. The leader always opens its WAL with async uploads (becomeLeader hardcodes this), since quorum commit already provides write durability.
CheckpointIntervaltime.Duration15 minHow often the leader writes a checkpoint to S3. Set to 0 to disable.
CheckpointEntriesint640Also trigger a checkpoint after this many WAL entries (0 = disabled).
NodeIDstringhostnameStable unique identifier for this node. Must not change across restarts.
PeerListenAddrstring""gRPC listen address for the WAL stream (e.g. 0.0.0.0:3380). Empty = single-node mode.
AdvertisePeerAddrstringPeerListenAddrAddress that followers use to reach this node. Set this when the listen address is not directly routable (container, NAT).
LeaderWatchIntervaltime.Duration5 minHow often the leader re-reads the S3 lock to detect supersession by a new leader.
FollowerMaxRetriesint5Consecutive stream failures before a follower attempts election takeover.
FollowerWaitModeFollowerWaitModequorumHow many follower ACKs the leader waits for before acknowledging a write: none, quorum, or all.
PeerBufferSizeint10 000WAL entries buffered in memory for follower catch-up.
PeerServerTLScredentials.TransportCredentialsnilmTLS credentials for the peer gRPC server (leader side).
PeerClientTLScredentials.TransportCredentialsnilmTLS credentials for the peer gRPC client (follower side).
MetricsAddrstring""HTTP address for /metrics, /healthz, /readyz. Empty = disabled.
ReadConsistencyReadConsistency"linearizable"Consistency guarantee for reads served by the etcd adapter. "linearizable" (default): each read syncs to the leader’s current revision before returning, ensuring no stale reads. "serializable": reads are served from local Pebble state without a round-trip to the leader; lower latency but may return slightly stale data on followers.
PebbleOptions[]func(*pebble.Options)nilExpert hook for appending Pebble options before opening the local state machine. Production deployments normally leave this empty.
WALWALWriternilExpert hook for replacing the filesystem WAL. Intended for constrained runtimes and tests. Production deployments normally leave this nil.
LoggerLoggerlogrus standard loggerReceives all T4 log output. Set this in embedded mode to control destination, level, and format. Use t4.NoopLogger to silence T4 logs.
MetricsRegistererprometheus.Registererprometheus.DefaultRegistererPrometheus registerer used for T4 metrics. Pass a custom registry to isolate T4 metrics when embedding.

object.Store is a five-method interface (Put, Get, Delete, DeleteMany, List). Implement it to use any storage backend.

type Store interface {
Put(ctx context.Context, key string, r io.Reader) error
Get(ctx context.Context, key string) (io.ReadCloser, error)
Delete(ctx context.Context, key string) error
DeleteMany(ctx context.Context, keys []string) error
List(ctx context.Context, prefix string) ([]string, error)
}

List must return keys in lexicographic order. Delete and DeleteMany must not fail when keys are already absent.

Advanced embedders can also replace the WAL by implementing WALWriter:

type WALWriter interface {
Open(dir string, term uint64, startRev int64) error
ReplayLocal(db wal.RecoveryStore, afterRev int64) error
Append(e *wal.Entry) error
AppendBatch(ctx context.Context, entries []*wal.Entry) error
SealAndFlush(nextSeq int64) error
Close() error
}

Custom WAL implementations must preserve the same durability ordering as the default filesystem WAL.

pkg/object provides NewS3Store (AWS SDK v2) and NewMem (in-memory, for tests).

Optionally implement ConditionalStore for atomic election writes:

type ConditionalStore interface {
Store
GetETag(ctx context.Context, key string) (*GetWithETag, error)
PutIfAbsent(ctx context.Context, key string, r io.Reader) error // If-None-Match: *
PutIfMatch(ctx context.Context, key string, r io.Reader, etag string) error // If-Match: <etag>
}

Both S3Store and Mem implement ConditionalStore. If your custom store does not, election falls back to an unconditional write + read-back (slightly less race-safe under concurrent startup), and liveness touches fall back to unconditional PUT (the Read→Touch split-brain protection is not available).


Start a node. All flags below are sub-flags of the run subcommand.

Terminal window
t4 run [flags]

Most t4 CLI flags can also be set via T4_* environment variables. Command-line flags take precedence over environment variables. Environment variables are only applied when the corresponding flag was not set explicitly, and empty environment variable values are ignored.

Required flags such as --s3-bucket, --branch-id, and --data-dir can be satisfied by their documented environment variables.

For S3 credentials, t4 fails closed unless you configure credentials explicitly. Use T4_S3_ACCESS_KEY_ID + T4_S3_SECRET_ACCESS_KEY for static credentials, or set --s3-profile / T4_S3_PROFILE to opt into the AWS shared config chain. If you want the shared default profile, set T4_S3_PROFILE=default explicitly.

Example:

Terminal window
export T4_DATA_DIR=/var/lib/t4
export T4_S3_BUCKET=my-bucket
export T4_S3_PREFIX=prod/cluster-a
export T4_NODE_ID=node-a
t4 run --listen 0.0.0.0:3379

Generated from the CLI flag definitions in Go. Run go run ./hack/docgen after changing CLI flags or env metadata.

CommandEnvironment variableEquivalent flag
t4 branch forkT4_BRANCH_ID--branch-id
t4 branch forkT4_S3_ACCESS_KEY_ID--s3-access-key-id
t4 branch forkT4_S3_BUCKET--s3-bucket
t4 branch forkT4_S3_CA_BUNDLE--s3-ca-bundle
t4 branch forkT4_S3_ENDPOINT--s3-endpoint
t4 branch forkT4_S3_PREFIX--s3-prefix
t4 branch forkT4_S3_PROFILE--s3-profile
t4 branch forkT4_S3_REGION--s3-region
t4 branch forkT4_S3_SECRET_ACCESS_KEY--s3-secret-access-key
t4 branch forkT4_S3_SESSION_TOKEN--s3-session-token
t4 branch unforkT4_BRANCH_ID--branch-id
t4 branch unforkT4_S3_ACCESS_KEY_ID--s3-access-key-id
t4 branch unforkT4_S3_BUCKET--s3-bucket
t4 branch unforkT4_S3_CA_BUNDLE--s3-ca-bundle
t4 branch unforkT4_S3_ENDPOINT--s3-endpoint
t4 branch unforkT4_S3_PREFIX--s3-prefix
t4 branch unforkT4_S3_PROFILE--s3-profile
t4 branch unforkT4_S3_REGION--s3-region
t4 branch unforkT4_S3_SECRET_ACCESS_KEY--s3-secret-access-key
t4 branch unforkT4_S3_SESSION_TOKEN--s3-session-token
t4 gcT4_S3_ACCESS_KEY_ID--s3-access-key-id
t4 gcT4_S3_BUCKET--s3-bucket
t4 gcT4_S3_CA_BUNDLE--s3-ca-bundle
t4 gcT4_S3_ENDPOINT--s3-endpoint
t4 gcT4_S3_PREFIX--s3-prefix
t4 gcT4_S3_PROFILE--s3-profile
t4 gcT4_S3_REGION--s3-region
t4 gcT4_S3_SECRET_ACCESS_KEY--s3-secret-access-key
t4 gcT4_S3_SESSION_TOKEN--s3-session-token
t4 inspect countT4_DATA_DIR--data-dir
t4 inspect diffT4_DATA_DIR--data-dir
t4 inspect getT4_DATA_DIR--data-dir
t4 inspect historyT4_DATA_DIR--data-dir
t4 inspect listT4_DATA_DIR--data-dir
t4 inspect metaT4_DATA_DIR--data-dir
t4 restore checkpointT4_DATA_DIR--data-dir
t4 restore checkpointT4_S3_ACCESS_KEY_ID--s3-access-key-id
t4 restore checkpointT4_S3_BUCKET--s3-bucket
t4 restore checkpointT4_S3_CA_BUNDLE--s3-ca-bundle
t4 restore checkpointT4_S3_ENDPOINT--s3-endpoint
t4 restore checkpointT4_S3_PREFIX--s3-prefix
t4 restore checkpointT4_S3_PROFILE--s3-profile
t4 restore checkpointT4_S3_REGION--s3-region
t4 restore checkpointT4_S3_SECRET_ACCESS_KEY--s3-secret-access-key
t4 restore checkpointT4_S3_SESSION_TOKEN--s3-session-token
t4 restore listT4_S3_ACCESS_KEY_ID--s3-access-key-id
t4 restore listT4_S3_BUCKET--s3-bucket
t4 restore listT4_S3_CA_BUNDLE--s3-ca-bundle
t4 restore listT4_S3_ENDPOINT--s3-endpoint
t4 restore listT4_S3_PREFIX--s3-prefix
t4 restore listT4_S3_PROFILE--s3-profile
t4 restore listT4_S3_REGION--s3-region
t4 restore listT4_S3_SECRET_ACCESS_KEY--s3-secret-access-key
t4 restore listT4_S3_SESSION_TOKEN--s3-session-token
t4 runT4_ADVERTISE_PEER--advertise-peer
t4 runT4_AUTH_ENABLED--auth-enabled
t4 runT4_BRANCH_CHECKPOINT--branch-checkpoint
t4 runT4_BRANCH_PREFIX--branch-prefix
t4 runT4_CHECKPOINT_ENTRIES--checkpoint-entries
t4 runT4_CHECKPOINT_INTERVAL_MIN--checkpoint-interval-min
t4 runT4_CLIENT_TLS_CA--client-tls-ca
t4 runT4_CLIENT_TLS_CERT--client-tls-cert
t4 runT4_CLIENT_TLS_KEY--client-tls-key
t4 runT4_DATA_DIR--data-dir
t4 runT4_FOLLOWER_MAX_RETRIES--follower-max-retries
t4 runT4_FOLLOWER_WAIT_MODE--follower-wait-mode
t4 runT4_GRPC_KEEPALIVE_INTERVAL--grpc-keepalive-interval
t4 runT4_GRPC_KEEPALIVE_MIN_TIME--grpc-keepalive-min-time
t4 runT4_GRPC_KEEPALIVE_PERMIT_WITHOUT_STREAM--grpc-keepalive-permit-without-stream
t4 runT4_GRPC_KEEPALIVE_TIMEOUT--grpc-keepalive-timeout
t4 runT4_LEADER_WATCH_INTERVAL_SEC--leader-watch-interval-sec
t4 runT4_LISTEN--listen
t4 runT4_LOG_LEVEL--log-level
t4 runT4_METRICS_ADDR--metrics-addr
t4 runT4_NODE_ID--node-id
t4 runT4_PEER_LISTEN--peer-listen
t4 runT4_PEER_TLS_CA--peer-tls-ca
t4 runT4_PEER_TLS_CERT--peer-tls-cert
t4 runT4_PEER_TLS_KEY--peer-tls-key
t4 runT4_READ_CONSISTENCY--read-consistency
t4 runT4_S3_ACCESS_KEY_ID--s3-access-key-id
t4 runT4_S3_BUCKET--s3-bucket
t4 runT4_S3_CA_BUNDLE--s3-ca-bundle
t4 runT4_S3_ENDPOINT--s3-endpoint
t4 runT4_S3_PREFIX--s3-prefix
t4 runT4_S3_PROFILE--s3-profile
t4 runT4_S3_REGION--s3-region
t4 runT4_S3_SECRET_ACCESS_KEY--s3-secret-access-key
t4 runT4_S3_SESSION_TOKEN--s3-session-token
t4 runT4_SEGMENT_MAX_AGE_SEC--segment-max-age-sec
t4 runT4_SEGMENT_MAX_SIZE_MB--segment-max-size-mb
t4 runT4_TOKEN_TTL--token-ttl
t4 runT4_WAL_SYNC_UPLOAD--wal-sync-upload
t4 runT4_WATCH_SEND_TIMEOUT--watch-send-timeout
t4 statusT4_S3_ACCESS_KEY_ID--s3-access-key-id
t4 statusT4_S3_BUCKET--s3-bucket
t4 statusT4_S3_CA_BUNDLE--s3-ca-bundle
t4 statusT4_S3_ENDPOINT--s3-endpoint
t4 statusT4_S3_PREFIX--s3-prefix
t4 statusT4_S3_PROFILE--s3-profile
t4 statusT4_S3_REGION--s3-region
t4 statusT4_S3_SECRET_ACCESS_KEY--s3-secret-access-key
t4 statusT4_S3_SESSION_TOKEN--s3-session-token

Generated from the CLI flag definitions in Go. Run go run ./hack/docgen after changing CLI commands or flags.

CommandFlagDefaultEnvRequiredHelp
t4 branch fork--branch-idT4_BRANCH_IDYesunique identifier for this branch (required)
t4 branch fork--checkpointNofork from this specific checkpoint key instead of the latest revision
t4 branch fork--s3-access-key-idT4_S3_ACCESS_KEY_IDNot4 S3 access key ID; when set with —s3-secret-access-key, uses static credentials
t4 branch fork--s3-bucketT4_S3_BUCKETYesS3 bucket
t4 branch fork--s3-ca-bundleT4_S3_CA_BUNDLENoPEM CA bundle file to trust for HTTPS to the S3 endpoint; use this for MinIO and other S3-compatible stores running behind a self-signed CA
t4 branch fork--s3-endpointT4_S3_ENDPOINTNocustom S3 endpoint URL, e.g. for MinIO
t4 branch fork--s3-prefixT4_S3_PREFIXNokey prefix inside the S3 bucket
t4 branch fork--s3-profileT4_S3_PROFILENoenable the ambient AWS credentials chain (env vars → ~/.aws/credentials[profile] → EC2/EKS IMDS); SSO and AssumeRole profiles are not supported; use ‘default’ to opt in to the default profile
t4 branch fork--s3-regionT4_S3_REGIONNoAWS region
t4 branch fork--s3-secret-access-keyT4_S3_SECRET_ACCESS_KEYNoAWS secret access key
t4 branch fork--s3-session-tokenT4_S3_SESSION_TOKENNosession token for temporary STS credentials; honored with —s3-access-key-id/—s3-secret-access-key
t4 branch unfork--branch-idT4_BRANCH_IDYesunique identifier for this branch (required)
t4 branch unfork--s3-access-key-idT4_S3_ACCESS_KEY_IDNot4 S3 access key ID; when set with —s3-secret-access-key, uses static credentials
t4 branch unfork--s3-bucketT4_S3_BUCKETYesS3 bucket
t4 branch unfork--s3-ca-bundleT4_S3_CA_BUNDLENoPEM CA bundle file to trust for HTTPS to the S3 endpoint; use this for MinIO and other S3-compatible stores running behind a self-signed CA
t4 branch unfork--s3-endpointT4_S3_ENDPOINTNocustom S3 endpoint URL, e.g. for MinIO
t4 branch unfork--s3-prefixT4_S3_PREFIXNokey prefix inside the S3 bucket
t4 branch unfork--s3-profileT4_S3_PROFILENoenable the ambient AWS credentials chain (env vars → ~/.aws/credentials[profile] → EC2/EKS IMDS); SSO and AssumeRole profiles are not supported; use ‘default’ to opt in to the default profile
t4 branch unfork--s3-regionT4_S3_REGIONNoAWS region
t4 branch unfork--s3-secret-access-keyT4_S3_SECRET_ACCESS_KEYNoAWS secret access key
t4 branch unfork--s3-session-tokenT4_S3_SESSION_TOKENNosession token for temporary STS credentials; honored with —s3-access-key-id/—s3-secret-access-key
t4 gc--keep3Nonumber of most-recent checkpoints to retain
t4 gc--s3-access-key-idT4_S3_ACCESS_KEY_IDNot4 S3 access key ID; when set with —s3-secret-access-key, uses static credentials
t4 gc--s3-bucketT4_S3_BUCKETYesS3 bucket
t4 gc--s3-ca-bundleT4_S3_CA_BUNDLENoPEM CA bundle file to trust for HTTPS to the S3 endpoint; use this for MinIO and other S3-compatible stores running behind a self-signed CA
t4 gc--s3-endpointT4_S3_ENDPOINTNocustom S3 endpoint URL, e.g. for MinIO
t4 gc--s3-prefixT4_S3_PREFIXNokey prefix inside the S3 bucket
t4 gc--s3-profileT4_S3_PROFILENoenable the ambient AWS credentials chain (env vars → ~/.aws/credentials[profile] → EC2/EKS IMDS); SSO and AssumeRole profiles are not supported; use ‘default’ to opt in to the default profile
t4 gc--s3-regionT4_S3_REGIONNoAWS region
t4 gc--s3-secret-access-keyT4_S3_SECRET_ACCESS_KEYNoAWS secret access key
t4 gc--s3-session-tokenT4_S3_SESSION_TOKENNosession token for temporary STS credentials; honored with —s3-access-key-id/—s3-secret-access-key
t4 inspect count--data-dir/var/lib/t4T4_DATA_DIRNodirectory containing local Pebble data
t4 inspect count--jsonfalseNoemit JSON output
t4 inspect count--prefixNoonly count keys with this prefix
t4 inspect diff--data-dir/var/lib/t4T4_DATA_DIRNodirectory containing local Pebble data
t4 inspect diff--from-rev1Nostart revision, inclusive
t4 inspect diff--jsonfalseNoemit JSON output
t4 inspect diff--prefixNoonly include keys with this prefix
t4 inspect diff--to-rev0Noend revision, inclusive; defaults to current revision
t4 inspect get--data-dir/var/lib/t4T4_DATA_DIRNodirectory containing local Pebble data
t4 inspect get--jsonfalseNoemit JSON output
t4 inspect history--data-dir/var/lib/t4T4_DATA_DIRNodirectory containing local Pebble data
t4 inspect history--jsonfalseNoemit JSON output
t4 inspect history--limit100Nomaximum number of history events to print; 0 means no limit
t4 inspect list--data-dir/var/lib/t4T4_DATA_DIRNodirectory containing local Pebble data
t4 inspect list--jsonfalseNoemit JSON output
t4 inspect list--limit100Nomaximum number of keys to print; 0 means no limit
t4 inspect list--prefixNoonly return keys with this prefix
t4 inspect meta--data-dir/var/lib/t4T4_DATA_DIRNodirectory containing local Pebble data
t4 inspect meta--jsonfalseNoemit JSON output
t4 restore checkpoint--checkpointNocheckpoint key to restore (default: latest; use ‘t4 restore list’ to find keys)
t4 restore checkpoint--data-dirT4_DATA_DIRYeslocal directory to restore into (required; must not already contain a Pebble database)
t4 restore checkpoint--s3-access-key-idT4_S3_ACCESS_KEY_IDNot4 S3 access key ID; when set with —s3-secret-access-key, uses static credentials
t4 restore checkpoint--s3-bucketT4_S3_BUCKETYesS3 bucket
t4 restore checkpoint--s3-ca-bundleT4_S3_CA_BUNDLENoPEM CA bundle file to trust for HTTPS to the S3 endpoint; use this for MinIO and other S3-compatible stores running behind a self-signed CA
t4 restore checkpoint--s3-endpointT4_S3_ENDPOINTNocustom S3 endpoint URL, e.g. for MinIO
t4 restore checkpoint--s3-prefixT4_S3_PREFIXNokey prefix inside the S3 bucket
t4 restore checkpoint--s3-profileT4_S3_PROFILENoenable the ambient AWS credentials chain (env vars → ~/.aws/credentials[profile] → EC2/EKS IMDS); SSO and AssumeRole profiles are not supported; use ‘default’ to opt in to the default profile
t4 restore checkpoint--s3-regionT4_S3_REGIONNoAWS region
t4 restore checkpoint--s3-secret-access-keyT4_S3_SECRET_ACCESS_KEYNoAWS secret access key
t4 restore checkpoint--s3-session-tokenT4_S3_SESSION_TOKENNosession token for temporary STS credentials; honored with —s3-access-key-id/—s3-secret-access-key
t4 restore list--s3-access-key-idT4_S3_ACCESS_KEY_IDNot4 S3 access key ID; when set with —s3-secret-access-key, uses static credentials
t4 restore list--s3-bucketT4_S3_BUCKETYesS3 bucket
t4 restore list--s3-ca-bundleT4_S3_CA_BUNDLENoPEM CA bundle file to trust for HTTPS to the S3 endpoint; use this for MinIO and other S3-compatible stores running behind a self-signed CA
t4 restore list--s3-endpointT4_S3_ENDPOINTNocustom S3 endpoint URL, e.g. for MinIO
t4 restore list--s3-prefixT4_S3_PREFIXNokey prefix inside the S3 bucket
t4 restore list--s3-profileT4_S3_PROFILENoenable the ambient AWS credentials chain (env vars → ~/.aws/credentials[profile] → EC2/EKS IMDS); SSO and AssumeRole profiles are not supported; use ‘default’ to opt in to the default profile
t4 restore list--s3-regionT4_S3_REGIONNoAWS region
t4 restore list--s3-secret-access-keyT4_S3_SECRET_ACCESS_KEYNoAWS secret access key
t4 restore list--s3-session-tokenT4_S3_SESSION_TOKENNosession token for temporary STS credentials; honored with —s3-access-key-id/—s3-secret-access-key
t4 run--advertise-peerT4_ADVERTISE_PEERNoaddress followers use to reach this node’s peer stream (default: —peer-listen)
t4 run--auth-enabledfalseT4_AUTH_ENABLEDNoenable etcd-compatible authentication and RBAC
t4 run--branch-checkpointT4_BRANCH_CHECKPOINTNocheckpoint index key returned by ‘t4 branch fork’ (required with —branch-prefix)
t4 run--branch-prefixT4_BRANCH_PREFIXNoS3 key prefix of the source node to branch from (uses —s3-bucket)
t4 run--checkpoint-entries0T4_CHECKPOINT_ENTRIESNotriggers a checkpoint after this many WAL entries regardless of time. 0 means disabled (requires —s3-bucket)
t4 run--checkpoint-interval-min15T4_CHECKPOINT_INTERVAL_MINNocheckpoint interval in minutes (requires —s3-bucket)
t4 run--client-tls-caT4_CLIENT_TLS_CANoCA certificate for client mTLS (PEM); omit for server-only TLS
t4 run--client-tls-certT4_CLIENT_TLS_CERTNoserver certificate file for client-facing TLS (PEM)
t4 run--client-tls-keyT4_CLIENT_TLS_KEYNoserver private key file for client-facing TLS (PEM)
t4 run--data-dir/var/lib/t4T4_DATA_DIRNodirectory for Pebble data and local WAL segments
t4 run--follower-max-retries5T4_FOLLOWER_MAX_RETRIESNoconsecutive stream failures before a follower attempts a leader takeover
t4 run--follower-wait-modequorumT4_FOLLOWER_WAIT_MODENoleader wait policy for follower ACKs before commit: none, quorum, or all
t4 run--grpc-keepalive-interval2h0m0sT4_GRPC_KEEPALIVE_INTERVALNoserver keepalive ping interval; how often the server pings idle connections
t4 run--grpc-keepalive-min-time5sT4_GRPC_KEEPALIVE_MIN_TIMENominimum interval the server demands between client keepalive pings
t4 run--grpc-keepalive-permit-without-streamtrueT4_GRPC_KEEPALIVE_PERMIT_WITHOUT_STREAMNoaccept client pings even when no streams are open; required for etcd v3 client compatibility
t4 run--grpc-keepalive-timeout20sT4_GRPC_KEEPALIVE_TIMEOUTNoserver keepalive ping ack timeout before declaring the connection dead
t4 run--leader-watch-interval-sec300T4_LEADER_WATCH_INTERVAL_SECNohow often (seconds) the leader reads the lock to detect supersession
t4 run--listen0.0.0.0:3379T4_LISTENNogRPC listen address (kine/etcd protocol)
t4 run--log-levelinfoT4_LOG_LEVELNolog level (trace/debug/info/warn/error)
t4 run--metrics-addr0.0.0.0:9090T4_METRICS_ADDRNoHTTP address for /metrics, /healthz, /readyz (e.g. 0.0.0.0:9090)
t4 run--node-idT4_NODE_IDNostable unique node identifier (default: hostname)
t4 run--peer-listenT4_PEER_LISTENNoaddress for leader→follower WAL stream (e.g. 0.0.0.0:3380); enables multi-node mode
t4 run--peer-tls-caT4_PEER_TLS_CANoCA certificate file for peer mTLS (PEM)
t4 run--peer-tls-certT4_PEER_TLS_CERTNonode certificate file for peer mTLS (PEM)
t4 run--peer-tls-keyT4_PEER_TLS_KEYNonode private key file for peer mTLS (PEM)
t4 run--read-consistencylinearizableT4_READ_CONSISTENCYNoread consistency for follower nodes: linearizable (ReadIndex, etcd-compatible) or serializable (local, ~115x faster but may be slightly stale)
t4 run--s3-access-key-idT4_S3_ACCESS_KEY_IDNot4 S3 access key ID; when set with —s3-secret-access-key, uses static credentials
t4 run--s3-bucketT4_S3_BUCKETNoS3 bucket
t4 run--s3-ca-bundleT4_S3_CA_BUNDLENoPEM CA bundle file to trust for HTTPS to the S3 endpoint; use this for MinIO and other S3-compatible stores running behind a self-signed CA
t4 run--s3-endpointT4_S3_ENDPOINTNocustom S3 endpoint URL, e.g. for MinIO
t4 run--s3-prefixT4_S3_PREFIXNokey prefix inside the S3 bucket
t4 run--s3-profileT4_S3_PROFILENoenable the ambient AWS credentials chain (env vars → ~/.aws/credentials[profile] → EC2/EKS IMDS); SSO and AssumeRole profiles are not supported; use ‘default’ to opt in to the default profile
t4 run--s3-regionT4_S3_REGIONNoAWS region
t4 run--s3-secret-access-keyT4_S3_SECRET_ACCESS_KEYNoAWS secret access key
t4 run--s3-session-tokenT4_S3_SESSION_TOKENNosession token for temporary STS credentials; honored with —s3-access-key-id/—s3-secret-access-key
t4 run--segment-max-age-sec10T4_SEGMENT_MAX_AGE_SECNoWAL segment rotation age threshold in seconds
t4 run--segment-max-size-mb50T4_SEGMENT_MAX_SIZE_MBNoWAL segment rotation size threshold in MiB
t4 run--token-ttl300T4_TOKEN_TTLNobearer token TTL in seconds
t4 run--wal-sync-uploadT4_WAL_SYNC_UPLOADNoupload WAL segments synchronously before ack (true/false; default true for safety, set false when local storage is durable)
t4 run--watch-send-timeout30sT4_WATCH_SEND_TIMEOUTNocancel a watch whose server-side send queue blocks for longer than this; clients receive a ‘mvcc: watcher is slow’ cancellation when possible
t4 status--s3-access-key-idT4_S3_ACCESS_KEY_IDNot4 S3 access key ID; when set with —s3-secret-access-key, uses static credentials
t4 status--s3-bucketT4_S3_BUCKETYesS3 bucket
t4 status--s3-ca-bundleT4_S3_CA_BUNDLENoPEM CA bundle file to trust for HTTPS to the S3 endpoint; use this for MinIO and other S3-compatible stores running behind a self-signed CA
t4 status--s3-endpointT4_S3_ENDPOINTNocustom S3 endpoint URL, e.g. for MinIO
t4 status--s3-prefixT4_S3_PREFIXNokey prefix inside the S3 bucket
t4 status--s3-profileT4_S3_PROFILENoenable the ambient AWS credentials chain (env vars → ~/.aws/credentials[profile] → EC2/EKS IMDS); SSO and AssumeRole profiles are not supported; use ‘default’ to opt in to the default profile
t4 status--s3-regionT4_S3_REGIONNoAWS region
t4 status--s3-secret-access-keyT4_S3_SECRET_ACCESS_KEYNoAWS secret access key
t4 status--s3-session-tokenT4_S3_SESSION_TOKENNosession token for temporary STS credentials; honored with —s3-access-key-id/—s3-secret-access-key
t4 version--shortfalseNoPrint only the version string

Manage database branches.

Terminal window
t4 branch fork \
--s3-bucket <bucket> --s3-prefix <source-prefix> \
--branch-id <id> \
[--checkpoint <checkpoint-key>]

Registers a new branch against the source store. Prints the checkpoint key to stdout. Pass that key as --branch-checkpoint when starting the branch node.

FlagDescription
--s3-bucketS3 bucket of the source database
--s3-prefixS3 prefix of the source database
--s3-endpointCustom S3 endpoint (optional)
--s3-regionS3 region (optional)
--s3-profileS3 shared config profile (optional)
--s3-access-key-idS3 access key ID (optional)
--s3-secret-access-keyS3 secret access key (optional)
--branch-idUnique identifier for the branch
--checkpointFork from a specific checkpoint key instead of the latest

Environment variables: T4_S3_BUCKET, T4_S3_PREFIX, T4_S3_ENDPOINT, T4_S3_REGION, T4_S3_PROFILE, T4_S3_ACCESS_KEY_ID, T4_S3_SECRET_ACCESS_KEY, T4_BRANCH_ID

Terminal window
t4 branch unfork \
--s3-bucket <bucket> --s3-prefix <source-prefix> \
--branch-id <id>

Removes the branch registry entry from the source store. The next GC run on the source may reclaim SSTs that are no longer needed.

FlagDescription
--s3-bucketS3 bucket of the source database
--s3-prefixS3 prefix of the source database
--s3-endpointCustom S3 endpoint (optional)
--s3-regionAWS region (optional)
--s3-profileAWS shared config profile (optional)
--s3-access-key-idAWS access key ID (optional)
--s3-secret-access-keyAWS secret access key (optional)
--branch-idBranch identifier to remove

Environment variables: T4_S3_BUCKET, T4_S3_PREFIX, T4_S3_ENDPOINT, T4_S3_REGION, T4_S3_PROFILE, T4_S3_ACCESS_KEY_ID, T4_S3_SECRET_ACCESS_KEY, T4_BRANCH_ID


Inspect a local data-dir in read-only mode without starting a server.

Terminal window
t4 inspect meta --data-dir <dir>

Shows current revision, compact revision, and total live key count for the local Pebble database.

Environment variable: T4_DATA_DIR

Terminal window
t4 inspect get --data-dir <dir> <key>

Shows the current value and metadata for one key.

Environment variable: T4_DATA_DIR

Terminal window
t4 inspect list --data-dir <dir> [--prefix <prefix>] [--limit <n>]

Lists live keys and their metadata, optionally filtered by prefix.

Environment variable: T4_DATA_DIR

Terminal window
t4 inspect count --data-dir <dir> [--prefix <prefix>]

Counts live keys, optionally filtered by prefix.

Environment variable: T4_DATA_DIR

Terminal window
t4 inspect history --data-dir <dir> [--limit <n>] <key>

Shows the change history for one key in revision order.

Environment variable: T4_DATA_DIR

Terminal window
t4 inspect diff --data-dir <dir> --from-rev <rev> [--to-rev <rev>] [--prefix <prefix>]

Summarizes keys that changed in a revision range, including before/after values.

Environment variable: T4_DATA_DIR