#cli #terminal #utility #key-value #store

app safir-mem

In-memory key/value store to share values between different shell sessions

5 unstable releases

0.3.2 Nov 8, 2023
0.3.1 Sep 7, 2023
0.2.1 Sep 1, 2023
0.2.0 Aug 29, 2023
0.1.0 Aug 28, 2023

#9 in #key-value-store

Download history 29/week @ 2023-08-23 36/week @ 2023-08-30 27/week @ 2023-09-06 5/week @ 2023-09-13 6/week @ 2023-09-20 7/week @ 2023-09-27 1/week @ 2023-10-04 10/week @ 2023-10-18 4/week @ 2023-10-25 4/week @ 2023-11-01 33/week @ 2023-11-08

51 downloads per month


579 lines



⚠️ This is now archived and no longer updated ⚠️

It was ambitious (and worked kinda) but became far too unweildy and complicated when it didn't have to. Maybe a rewrite in the future but for now, it's now archived.

Simple in-memory CLI key/value store.

The in-memory version of Safir!

safir-mem starts a service which runs on localhost or on dedicated port 9876.

This can be enabled / diabled with the start and stop commands respectively. Note that when the memcache service is disabled, ALL data contained within it is lost so use wisely.

In cases where you want to save the contents of the memcache, the dump command will allow for the contents to be saved out to disk in JSON format. This behaves as a snapshot as the contents of the cache persist after usage.


To install safir-mem, run cargo install safir-mem.


Using this requires that the Rubin CLI be installed.

cargo install rubin-cli


In-memory key/value store to share information between shell sessions

Usage: safir-mem <COMMAND>

  add     Add a value to the store with the given key
  get     Get a value from the store
  rm      Remove values from the store
  alias   Output the alias command for a key / value pair to be entered into a shell session
  export  Output the export command for a key / value pair to be entered into a shell session
  clear   Clear all keys/values from the store
  start   Start the memcache server
  stop    Stop the memcache server
  dump    Dump contents of memcache to disk
  help    Print this message or the help of the given subcommand(s)

  -h, --help     Print help
  -V, --version  Print version


~289K SLoC