zshot/cliDownload

--history

CLI
--history
REST
CLI only
ValuePATH
Defaulthistory.sqlite in the user's state directory

Records each CLI run, authenticated server request, and MCP tool call as a row in a SQLite ledger. Pass a custom path with =, as --history=PATH. Without a path, ZShot writes to $XDG_STATE_HOME/zshot/history.sqlite, defaulting to ~/.local/state/zshot/history.sqlite on Linux and ~/Library/Application Support/zshot/history.sqlite on macOS.

ColumnDescription
started_atStart timestamp in UTC
zshot_versionZShot version
sourcecli, http, or mcp
commandSanitized CLI command with secrets replaced by [FILTERED]
requestSanitized HTTP or MCP request JSON with secrets replaced by [FILTERED]
urlFirst requested URL
elapsed_msDuration in milliseconds
exit_codeProcess exit code for CLI runs
statusHTTP response status code
outcomeOutcome label such as successful, timeout, or cache_hit
input_tokens, output_tokens, cache_read_tokens, cache_write_tokensTotal tokens across all model calls
llm_usagePer-provider and per-model token breakdown as JSON, tagged with source: "zshot" for API counts or source: "agent" for counts appended by a stdio agent
outputsFiles a CLI run wrote, as a JSON array of {role, path, type, url}. role is output for a render, which carries its output type and page URL; any other role is the flag that asked for the file, such as har. Paths are absolute

The annotated schema ships with each release; schema updates only add nullable columns so existing queries remain compatible.

Each CLI invocation writes one row regardless of URL count, including runs rejected by argument or license validation. Servers record authenticated requests including cache hits, and configure history at startup only.

For stdio runs, ZShot cannot observe the driving agent’s tokens and prints History: row N in PATH to stderr so the agent can append its own counts using the ZShot skill.

Multiple ZShot processes can share one ledger on a local filesystem. ZShot only appends rows; prune old entries with SQL. Write failures log an error without failing the run.

Enable history globally in the configuration file.

Example

Record a run to runs.sqlite:

zshot --history=runs.sqlite -f page.png https://zshot-cli.com/

Summarize token usage by URL:

sqlite3 runs.sqlite \
  "SELECT url, count(*), sum(input_tokens), sum(output_tokens) FROM history GROUP BY url"