> ## Documentation Index
> Fetch the complete documentation index at: https://cache-pot.thatdevguy.in/llms.txt
> Use this file to discover all available pages before exploring further.

# cache-pot cli: an interactive RESP shell

> Cache-Pot ships its own redis-cli-style shell — cache-pot cli connects to a running server, runs one-shot commands, reads piped scripts, and supports TLS.

`cache-pot cli` is a small, dependency-free RESP2 shell built into the same binary as the server. Use it anywhere you'd reach for `redis-cli` — interactively, as a one-shot command, or piping in a script — without installing anything extra.

## Quick start

With no arguments it opens an interactive prompt against `localhost:6379`:

```bash theme={null}
cache-pot cli
```

```
Cache-Pot CLI — connected to localhost:6379
Type a command, "help" for tips, or "exit" to quit.
localhost:6379> SET hello world
OK
localhost:6379> GET hello
"world"
localhost:6379> exit
```

Replies are formatted the way `redis-cli` formats them — bulk strings quoted, integers tagged `(integer)`, arrays numbered, missing keys shown as `(nil)`, errors prefixed `(error)`.

## One-shot commands

Pass the command as trailing arguments and the CLI runs it, prints the reply, and exits — no prompt, no loop:

```bash theme={null}
cache-pot cli PING
# PONG
cache-pot cli GET hello
# "world"
```

This drops straight into shell scripts and CI checks.

## Scripting: piped input

When stdin isn't a terminal, the CLI reads one command per line and runs each in sequence, still connected to the same server:

```bash theme={null}
cat <<'EOF' | cache-pot cli
SET job:1 queued
INCR jobs:total
HSET job:1 status queued
EOF
```

Output is the same reply-per-line format as interactive mode, just without the prompt.

## Connecting

<ParamField name="--addr" type="string" default="localhost:6379">
  Server address (`host:port`). Also read from `CACHEPOT_ADDR`.
</ParamField>

<ParamField name="--auth" type="string" default="">
  Password sent via `AUTH` immediately after connecting. Also read from `CACHEPOT_AUTH`.
</ParamField>

<ParamField name="--tls" type="flag">
  Connect over TLS instead of plaintext.
</ParamField>

<ParamField name="--tls-cacert" type="string" default="">
  CA certificate (PEM) used to verify the server's certificate chain.
</ParamField>

<ParamField name="--tls-insecure" type="flag">
  Skip certificate verification — useful for self-signed certs in development. Never use this against a server you don't control.
</ParamField>

<ParamField name="--no-color" type="flag">
  Disable ANSI colors in output, useful when piping to a file or a program that doesn't expect escape codes.
</ParamField>

```bash theme={null}
cache-pot cli --addr db.internal:6379 --tls --tls-cacert ca.pem
```

<Warning>
  `--tls-insecure` disables server identity verification entirely. It's fine for a local self-signed cert while developing, but never point it at anything on a network you don't trust.
</Warning>

## Shell commands

Besides any Redis or Cache-Pot command, the interactive prompt understands:

| Command         | Effect                            |
| --------------- | --------------------------------- |
| `help`          | Print a short command cheat sheet |
| `clear`         | Clear the screen                  |
| `exit` / `quit` | Close the connection and leave    |

## Quoting and escapes

Arguments follow the same quoting rules as `redis-cli`: single quotes are literal, double quotes support `\n`, `\r`, `\t`, `\\`, `\"`, and `\xHH` byte escapes.

```
localhost:6379> SET note "line one\nline two"
OK
localhost:6379> STRLEN note
(integer) 13
```

## History

Interactive sessions append every command to `~/.cache-pot_history`. It's a plain append-only text file — there's no readline-style in-session recall yet, but the file is there if you want to grep past commands or feed them back in with `cache-pot cli < ~/.cache-pot_history`.

<Tip>
  Because the CLI speaks plain RESP, it works against any Redis-compatible server, not just Cache-Pot — handy for comparing behavior side by side. See [Benchmarking](/guides/benchmarking) for the same idea applied to load testing.
</Tip>
