Sakfe (Stephen’s Abstract Key-File Engine) is a command-line file-based key-value store, written in pure Go 1.19 by Stephen Malone. It’s designed to take a directory of plain text files and present them as a key-value interface for command-line operations.
$ ls files/ alpha.txt bravo.txt charlie.txt $ sakfe lst alpha bravo charlie $ sakfe get alpha It's like a weird baby Redis full of text files!
changes.mdfor the complete changelog.
license.mdfor licensing information (BSD-3).
- See the issue tracker for bug reports and features suggestions.
To install Sakfe, you can use
go install github.com/wirehaiku/Sakfe/[email protected]
…or download a binary from the latest release.
The only configuration Sakfe needs is two environment variables: the path to a directory, and the file extension you want to use.
# Sakfe's directory path. Variables and tildes welcome! export SAKFE_DIR = "$HOME/my-text-files/" # Sakfe's file extension. The leading dot is optional. export SAKFE_EXT = ".txt"
Once you’ve set these two variables, you can start using Sakfe!
Sakfe has a deliberately simple command structure with minimal output. All arguments are strings unless explicitly stated otherwise, and arguments ending in
... can be given multiple times.
Print the value of each key in
KEYS, or print nothing if one doesn’t exist.
$ sakfe get alpha This is file alpha! $ sakfe get alpha bravo missing-key This is file alpha! This is file bravo!
set KEY VALS...
Set the value of
VALS, each value separated by a newline.
$ sakfe set alpha "One." $ sakfe get alpha One. $ sakfe set alpha "One." "Two." "Three." $ sakfe get alpha One. Two. Three.
Delete each key in
KEYS by deleting their underlying text files.
$ ls files/ alpha.txt bravo.txt charlie.txt $ sakfe del alpha bravo $ ls files/ charlie.txt
Print a list of all existing keys, or keys starting with
$ sakfe lst alpha-one alpha-two bravo $ sakfe lst alpha alpha-one alpha-two
Please submit all bug reports and feature suggestions to the issue tracker. Thank you!