7 releases (4 breaking)
0.10.1 | Nov 2, 2023 |
---|---|
0.10.0 | Sep 8, 2023 |
0.4.0 | Sep 25, 2022 |
0.3.0 | Sep 19, 2022 |
0.1.1 | Aug 25, 2022 |
#995 in Authentication
28 downloads per month
52KB
780 lines
Faasten CLI Client
This is a simple remote command-line client for the Faasten datastore.
The client supports five basic sub-commands commands:
login Login to Faasten
get Get the value of a database key
put Put a "blob" from a local file
fetch Download a "blob" to a local file
set Set the value of a database key from the provided value or standard in
Login credentials are stored in $XDG_CONFIG
/fstn/credentials as a TOML-formatted file. Once logged in, you can perform the other operations.
Values vs. Blobs
Faasten distinguishes between values and blobs, with the former intended for smaller, typically JSON, data that might change frequently and the latter intended for larger binary data, such as tarballs. Both are stored at database keys, but values are stored directly, while blobs are stored separately and referred by the SHA256 hash of their content in the database.
As a result, you can get
a blob but instead of the actual content you'll see a
SHA256 hash. fetch
ing is typically more useful.
Getting and Setting Values
Getting a key will print its value to standard out.
$ fstn get myvalue
{ "hello": "world" }
You can set values by either passing the value on the command line or via standard in.
$ fstn set myvalue '{"hello": "world"}'
$ echo '{"hello": "world"}' | fstn set myvalue
Fetching and putting Blobs
Fetch blobs using the database key that refers to them and a file to store the output.
$ fstn fetch key/for/tarball output.tgz
Similarly, put a blob by providing a key to reference it and a file to put
$ fstn put key/for/tarball local_tarball.tgz
Dependencies
~16–30MB
~468K SLoC