Exhaustive, example-driven reference for the cache-cli command: every
subcommand, every flag, the exit-code and stream contracts, and scripting use
cases.
cache-cli is a scriptable inspector for a github.com/ubgo/cache
Redis backend. It connects with cache-redis, optionally applies a
cache.Namespaced prefix, and exits with meaningful codes.
Install / run:
go install github.com/ubgo/cache-cli@latest
cache-cli -addr localhost:6379 stats- Commands —
get,set,del,stats,keys,help. - Flags & contracts —
-addr,-ns,-ttl,-json, exit codes, stdout/stderr split.
| Surface | Kind | Page |
|---|---|---|
get <key> |
command | Commands |
set <key> <value> |
command | Commands |
del <key> |
command | Commands |
stats |
command | Commands |
keys [prefix] |
command | Commands |
help / -h / --help |
command | Commands |
-addr string |
flag | Flags |
-ns string |
flag | Flags |
-ttl duration |
flag | Flags |
-json |
flag | Flags |
| exit codes 0 / 1 / 2 | contract | Flags |
| stdout vs stderr | contract | Flags |
| Code | Meaning |
|---|---|
0 |
success (includes del of an absent key, stats, help) |
1 |
runtime/backend error, or a get miss (cache.ErrNotFound) |
2 |
usage error: bad flags, no command, wrong arg count, unknown command |