跳到主要内容

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

FileShapeLifetime
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.jsonRecord<string, string> — static set @x onlyPersistent.
aliases.jsonRecord<string, string>Persistent.
whitelist.jsonstring[] (symbols)Persistent.
fatfingers.jsonRecord<string, number> — symbol → max contractsPersistent.
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 secretsPersistent.
cli.logLog linesCleared on every CLI startup.
market-data.dbSQLite — orderbook snapshots + recording configPersistent. See Recording.
cli_historyNewline-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 tasks view reads tasks.json instead, 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:

VariableEffect
TEALSTREET_CONFIG_DIRMove the entire ~/.tealstreet/ dir
TEALSTREET_CONFIG_FILEOverride 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.

CommandSurfaceContentFile
export / importREPL onlyVars + aliases (binds reserved)~/.tealstreet/cli-export.json
tealstreet accounts export / accounts importTop-level binary or REPLExchange account credentialsPath 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.


See also

  • Recordingmarket-data.db schema.
  • Listenerlistener.json, trusted-clients.json, hooks.json.
  • Pairing — how trusted-clients.json gets populated.