bkt

bkt (pronounced "bucket") is a subprocess caching utility written in Rust.

github - releases - crates.io - docs.rs

$ bkt --help

bkt 0.5.2

CLI and Rust library for caching subprocess invocations


USAGE:

bkt [OPTIONS] [--] <COMMAND>...


ARGS:

<COMMAND>... The command to run


OPTIONS:

--ttl <TTL> Duration the cached result will be valid for [default: 60s]

[aliases: time-to-live]

--stale <STALE> Duration after which the result will be asynchronously refreshed

--warm Asynchronously execute and cache the given command, even if it's

already cached

--force Execute and cache the given command, even if it's already cached

--cwd Includes the current working directory in the cache key, so that

the same command run in different directories caches separately

[aliases: use-working-dir]

--env <ENV> Includes the given environment variable in the cache key, so that

the same command run with different values for the given

variables caches separately [aliases: use-environment]

--discard-failures Don't cache invocations that fail (non-zero exit code). USE

CAUTION when passing this flag, as unexpected failures can lead

to a spike in invocations which can exacerbate ongoing issues,

effectively a DDoS

--scope <SCOPE> If set, all cached data will be scoped to this value, preventing

collisions with commands cached with different scopes

--cache-dir <CACHE_DIR> The directory under which to persist cached invocations; defaults

to the system's temp directory. Setting this to a directory

backed by RAM or an SSD, such as a tmpfs partition, will

significantly reduce caching overhead

-h, --help Print help information

-V, --version Print version information