xs (cross-stream)

"You don't so much run it, as poke at it."
An event stream store for personal, local-first use. Kinda like the
sqlite3
cli, but specializing in the
event sourcing use case.
Usage
)
Unlike sqlite
, which operates directly on the file system, xs requires a
running process to manage access to the local store. This enables features like
subscribing to real-time updates from the event stream.
Basics
Note: xs
is designed to be orchestrated with
Nushell, but since many are more familiar with bash
,
here are the very basics that work just fine from bash
.
To append items to the stream, use:
The content for the event can be provided via stdin and, if present, will be
stored in Content-Addressable Storage (CAS). You can also append events without
content. Additionally, you can attach arbitrary metadata to an event using the
--meta
flag, which accepts metadata in JSON format.
For example:
|
} }
To fetch the contents of the stream, use the cat
command:
} }
} }
xs
generates a few meta events, such as xs.start
, which is emitted whenever
the process managing the store starts.
You can also see the my-topic
event we just appended, along with a hash
,
which represents the hash of the stored content. You can retrieve this content
from the Content-Addressable Storage (CAS) using: