Config files
Everything the CLI persists lives under ~/.tealstreet/. All of it
is plain text or SQLite — readable with cat, jq, or sqlite3. No
binary blobs, no hidden state stores.
Files
| File | Shape | Lifetime |
|---|---|---|
config.json | { defaultAccount, defaultSymbol, accounts: [...], auth: {...}, listener: { enabled?, accountSync?, remoteExec? } } | Persistent. Main config + creds. |
tasks.json | { version: 1, tasks: PersistedTask[] } | Persistent. Top-level tealstreet tasks view. |
vars.json | Record<string, string> — static set @x only | Persistent. |
aliases.json | Record<string, string> | Persistent. |
whitelist.json | string[] (symbols) | Persistent. |
fatfingers.json | Record<string, number> — symbol → max contracts | Persistent. |
simulation.json | { enabled: boolean } | Persistent. |
cli-export.json | { version: 1, vars: {...}, aliases: {...}, binds: {} } | Written by the REPL export command. |
listener.json | { listenerId, createdAt } | Persistent. Identity for the loopback listener. |
trusted-clients.json | { clients: TrustedClient[] } | Persistent. Paired web clients. |
hooks.json | { hooks: Hook[] } — contains plaintext secrets | Persistent. |
cli.log | Log lines | Cleared on every CLI startup. |
market-data.db | SQLite — orderbook snapshots + recording config | Persistent. See Recording. |
cli_history | Newline-separated commands (cap 200) | Persistent. |
Session-only state
These are never written to disk. Restart the CLI and they're gone:
- Live vars (
sets @x …) — reactive variables that recompute on every read. - Tracked vars (
track max @x …/track min @x …) — ratchet trackers. - In-process chasers and TWAPs — running background tasks. The
top-level
tealstreet tasksview readstasks.jsoninstead, which is a separate persisted record. See Tasks.
If you want to round-trip your vars + aliases between machines, use
export / import below.
Overrides
Two environment variables relocate the state directory:
| Variable | Effect |
|---|---|
TEALSTREET_CONFIG_DIR | Move the entire ~/.tealstreet/ dir |
TEALSTREET_CONFIG_FILE | Override just the main config.json |
Useful for sandboxed test setups (TEALSTREET_CONFIG_DIR=/tmp/ts-test tealstreet) or for keeping multiple identity configs on one machine.
Backing up
config.json and hooks.json are the sensitive ones — config.json
contains exchange API credentials, hooks.json contains webhook
secrets. Treat both like credentials. Don't sync them through anything
unencrypted.
The rest of the directory (vars, aliases, whitelist, fatfingers, sim state, history, market-data.db) is safe to back up wholesale:
tar -czf tealstreet-backup.tar.gz \
--exclude='cli.log' \
--exclude='hooks.json' \
--exclude='config.json' \
~/.tealstreet
Restore by extracting back into ~/.tealstreet/.
Export / import
Two distinct round-trip flows exist. They do not overlap.
| Command | Surface | Content | File |
|---|---|---|---|
export / import | REPL only | Vars + aliases (binds reserved) | ~/.tealstreet/cli-export.json |
tealstreet accounts export / accounts import | Top-level binary or REPL | Exchange account credentials | Path you pass (or stdin/stdout) |
Use the first for moving your workflow setup between machines. Use the second for moving exchange creds — typically when seeding a new machine from the web app's exported account JSON.
See Aliases & vars → export/import for the workflow round-trip and Commands → Accounts for the credential round-trip.