Output
How the CLI shapes what you see — output kinds, prompt config, watch modes, fill notifications, connection dots.
Output kinds
Every line the CLI prints carries a PrintKind. Listener cmd:output frames
expose the same kind to web clients.
| Kind | Color | Listener field | Goes to log file? |
|---|---|---|---|
print | default | print | terminal only |
success | green | success | terminal only |
info | gray | info | terminal only |
warn | yellow | warn | terminal only |
error | red | error | terminal only |
logger.info / warn / error / debug→~/.tealstreet/cli.logonly.console.log / error / warn→ both terminal (rate-limited 5/sec, 10 s dedup) and the log file.
Source: apps/cli/src/listener/adapter-context.ts:13,
apps/cli/src/logger.ts.
Hook output
Each cmd:output frame produced by a webhook fire is also mirrored to
the local REPL with a [hook:<name>] prefix in the matching chalk color.
Prompt
The REPL prompt is fully configurable. View it with prompt, set it with
prompt set "<format>".
prompt # show current
prompt list # show all named presets
prompt preset <name> # switch to a preset
prompt set "{symbol} ${price} > "
prompt prefix <p> # change the leading "> " marker
prompt preview # render the current format with live data
Tokens
| Token | Renders |
|---|---|
{symbol} | Focused symbol |
{account} | Account name |
{price} | Last price for focused symbol |
{side} | Position side (L / S / —) |
{size} | Position size |
{entry} | Entry price |
{pnl} | Unrealized PnL (currency) |
{pnl%} | Unrealized PnL (percent) |
{liq} | Liquidation price |
{leverage} | Current leverage |
{orders} | Open order count |
{conn} | Connection health glyph (see below) |
Alias ps works for prompt. Source: PromptCommand.ts.
Watch modes (standalone-only)
Live, full-screen views that refresh every 1000 ms.
| Alias | Long forms | Shows |
|---|---|---|
wa | watch account, watch acc | Margin + positions + orders combo |
wp | watch positions, watch pos | Live positions table |
wo | watch orders, watch ord | Live orders table |
wm | watch margin, watch balance, watch bal | Live margin |
| — | watch chart (shorthand watch c <args>) | Live ASCII candlestick |
| — | watch chase | Live chaser status panel |
wa, wp, wo, wm all accept --all / -a for the multi-account view.
Exit keys
| Context | Keys |
|---|---|
| REPL mode | Escape, Ctrl+X |
| One-shot CLI | Ctrl+C, Escape, Ctrl+X |
(In the REPL, Ctrl+C is reserved for readline line-cancel.)
Terminal recovery
Watch modes use the alt screen + raw mode. On exit the CLI runs
recreateReadline() because readline state can corrupt across raw-mode
toggles. There's a 200 ms cooldown (MONITOR_EXIT_COOLDOWN_MS) where prompt
updates are skipped — that's intentional, not a freeze. Source:
apps/cli/src/repl.ts:280-330.
Web parity
Watch modes are standalone-only. The web app has its own live panels (positions table, orders panel, etc.) rendered as components, not as a terminal canvas.
Connection health
The {conn} prompt token and accounts listings render colored dots:
| Color | Meaning |
|---|---|
| Green | Healthy |
| Yellow | Warning / initializing |
| Red | Error / disconnected |
| Gray | Not connected |
Driven by getConnectionStatus(exchange) from ConnectionMonitor.
Force a fresh socket with conn reconnect.
Fill notifications
Every fill on the active exchange produces a one-liner:
✓ Fill: Bought 0.01 BTC-PERP @ $50,124.5
When you're inside a watch mode, the fill is appended via addWatchMessage
to whichever panel is up. Source: apps/cli/src/repl.ts:850-858.
Critical error suppression
Per-account critical errors (geo-blocked, invalid API key, etc.) are
classified by HealthMonitor and only printed once per category.
If your error scrolled by an hour ago, check cli.log — it's still in there.
Source: apps/cli/src/repl.ts:872-884.
Network monitor + rate limiting
The CLI's console interceptor (apps/cli/src/logger.ts) is rate-limited
to 5 messages / second with a 10 s dedup window. print() and the
unwrapped originalConsoleLog() bypass rate limiting and are what command
handlers use for primary output. The interceptor is mainly defense against
runaway third-party logging.