#download #command-line #blobs #cli-client #login #key #faasten

app fstn

A CLI client for interacting with Faasten

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

#491 in Database interfaces

42 downloads per month

Custom license

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. fetching 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

~17–31MB
~505K SLoC