Documentation
¶
Overview ¶
Command korbit is a command-line client for the Korbit Open API v2 — market data, ED25519-signed trading, and key management — built as a stable, JSON-in/JSON-out tool surface for AI agents.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
accountseq
Package accountseq centralizes the accountSeq selection policy shared by REST operations and private WebSocket subscriptions.
|
Package accountseq centralizes the accountSeq selection policy shared by REST operations and private WebSocket subscriptions. |
|
agentskill
Package agentskill installs and inspects the bundled Korbit Agent Skill on disk.
|
Package agentskill installs and inspects the bundled Korbit Agent Skill on disk. |
|
botapi
Package botapi is the monitor command's JavaScript bot runtime: a goja event loop on a dedicated script goroutine, an asynchronous Promise-based korbit.* API generated from the command spec, and a script-local SQLite db.* surface — so a small script passed via --init/--where/--on can be a complete trading bot.
|
Package botapi is the monitor command's JavaScript bot runtime: a goja event loop on a dedicated script goroutine, an asynchronous Promise-based korbit.* API generated from the command spec, and a script-local SQLite db.* surface — so a small script passed via --init/--where/--on can be a complete trading bot. |
|
callrec
Package callrec is the single home of the CLI's journaling POLICY plus the journal-backed korbit.Recorder that enacts it.
|
Package callrec is the single home of the CLI's journaling POLICY plus the journal-backed korbit.Recorder that enacts it. |
|
candles
Package candles derives live OHLC candle series from the two sources the Korbit API offers — the REST candles endpoint and the public trade stream — because the API has no candle WebSocket channel.
|
Package candles derives live OHLC candle series from the two sources the Korbit API offers — the REST candles endpoint and the public trade stream — because the API has no candle WebSocket channel. |
|
cli
Package cli wires the declarative spec into a cobra command tree, parses and validates input, and enforces the output contract: one JSON document on stdout, diagnostics and one structured error on stderr, and the documented exit codes.
|
Package cli wires the declarative spec into a cobra command tree, parses and validates input, and enforces the output contract: one JSON document on stdout, diagnostics and one structured error on stderr, and the documented exit codes. |
|
cli/agentskillcmd
Package agentskillcmd implements the `agent skill …` builtins: install the bundled Agent Skill onto disk for each supported agent, and a doctor that reports install/drift/PATH health.
|
Package agentskillcmd implements the `agent skill …` builtins: install the bundled Agent Skill onto disk for each supported agent, and a doctor that reports install/drift/PATH health. |
|
cli/clienv
Package clienv is the seam between the cli command tree and the command subpackages it dispatches into.
|
Package clienv is the seam between the cli command tree and the command subpackages it dispatches into. |
|
cli/doctorcmd
Package doctorcmd implements the `doctor` command: a read-only assessment of whether the current key configuration can reach and trade on Korbit, with a fix named for every problem.
|
Package doctorcmd implements the `doctor` command: a read-only assessment of whether the current key configuration can reach and trade on Korbit, with a fix named for every problem. |
|
cli/keymgmtcmd
Package keymgmtcmd implements the key & keystore management commands — `setup`, the `key` group (add/bind/use/rename/remove/list/show/set-base-url/ set-default-account-seq), and the `keystore` group (status/migrate/default).
|
Package keymgmtcmd implements the key & keystore management commands — `setup`, the `key` group (add/bind/use/rename/remove/list/show/set-base-url/ set-default-account-seq), and the `keystore` group (status/migrate/default). |
|
cli/monitorcmd
Package monitorcmd implements the `monitor` command — the CLI's one streaming command and its experimental JavaScript bot runtime.
|
Package monitorcmd implements the `monitor` command — the CLI's one streaming command and its experimental JavaScript bot runtime. |
|
cli/probe
Package probe holds the endpoint-soundness and reachability primitives the cli's onboarding and diagnostic commands share (ip, doctor, setup, key set-base-url, mcp): base-URL validation, the public-IP probe and its allowlist report, the REST/WebSocket reachability smoke test, and the IP-allowlist error classifier.
|
Package probe holds the endpoint-soundness and reachability primitives the cli's onboarding and diagnostic commands share (ip, doctor, setup, key set-base-url, mcp): base-URL validation, the public-IP probe and its allowlist report, the REST/WebSocket reachability smoke test, and the IP-allowlist error classifier. |
|
cli/sandboxcmd
Package sandboxcmd implements the `sandbox …` builtin group: the lifecycle manager for the local Korbit API Sandbox.
|
Package sandboxcmd implements the `sandbox …` builtin group: the lifecycle manager for the local Korbit API Sandbox. |
|
cli/selfcmd
Package selfcmd implements the `self install|update|uninstall|doctor` builtins: the CLI-facing layer over internal/selfupdate.
|
Package selfcmd implements the `self install|update|uninstall|doctor` builtins: the CLI-facing layer over internal/selfupdate. |
|
cli/setupui
Package setupui is the interactive terminal front-end for the `setup` command.
|
Package setupui is the interactive terminal front-end for the `setup` command. |
|
cli/textout
Package textout holds the command-agnostic human-output toolkit: the table, key/value and number-formatting primitives the cli's human-readable mode is built from, plus the TextFormatter seam a command's result type implements to render itself.
|
Package textout holds the command-agnostic human-output toolkit: the table, key/value and number-formatting primitives the cli's human-readable mode is built from, plus the TextFormatter seam a command's result type implements to render itself. |
|
cli/tuicmd
Package tuicmd implements the `tui` command — the interactive, full-screen trading terminal (the human sibling of monitor).
|
Package tuicmd implements the `tui` command — the interactive, full-screen trading terminal (the human sibling of monitor). |
|
clock
Package clock holds one session's (or process's) estimate of the Korbit server clock — the single piece of shared state behind every signed request — and the one operation that measures and installs it.
|
Package clock holds one session's (or process's) estimate of the Korbit server clock — the single piece of shared state behind every signed request — and the one operation that measures and installs it. |
|
cmdmeta
Package cmdmeta is the command-surface vocabulary AND the per-value validation engine over it, shared by the operation catalog and the command descriptors: value kinds, the flag and positional shapes, sections, response-field hints, auth, the safety classification, and NormalizeValue/CoerceValue (validate one value against its kind).
|
Package cmdmeta is the command-surface vocabulary AND the per-value validation engine over it, shared by the operation catalog and the command descriptors: value kinds, the flag and positional shapes, sections, response-field hints, auth, the safety classification, and NormalizeValue/CoerceValue (validate one value against its kind). |
|
config
Package config resolves the CLI home directory and loads config.json.
|
Package config resolves the CLI home directory and loads config.json. |
|
fslock
Package fslock provides an advisory, cross-process file lock used to serialize read-modify-write cycles over the CLI's on-disk state.
|
Package fslock provides an advisory, cross-process file lock used to serialize read-modify-write cycles over the CLI's on-disk state. |
|
i18n
Package i18n owns every locale decision in the program: which display languages exist, which one is active, and how a localized string is looked up.
|
Package i18n owns every locale decision in the program: which display languages exist, which one is active, and how a localized string is looked up. |
|
ids
Package ids mints client order ids and enforces the Korbit clientOrderId charset.
|
Package ids mints client order ids and enforces the Korbit clientOrderId charset. |
|
indicators
Package indicators provides technical-analysis indicator helpers — moving averages, oscillators, bands, and volume studies — for trading bots.
|
Package indicators provides technical-analysis indicator helpers — moving averages, oscillators, bands, and volume studies — for trading bots. |
|
journal
Package journal is the CLI's local action journal: a SQLite database under the CLI home that records what the tool did, in three linked tables.
|
Package journal is the CLI's local action journal: a SQLite database under the CLI home that records what the tool did, in three linked tables. |
|
jqfilter
Package jqfilter compiles a jq program (github.com/itchyny/gojq) and runs it over a stream of JSON documents to filter and/or transform them.
|
Package jqfilter compiles a jq program (github.com/itchyny/gojq) and runs it over a stream of JSON documents to filter and/or transform them. |
|
keys
Package keys manages named API keys: the registry (keys.json) and the lifecycle commands over it (add/bind/use/remove/rename/set-base-url/resolve).
|
Package keys manages named API keys: the registry (keys.json) and the lifecycle commands over it (add/bind/use/remove/rename/set-base-url/resolve). |
|
keystore
Package keystore stores private key material, addressed by key name.
|
Package keystore stores private key material, addressed by key name. |
|
keystore/keystoretest
Package keystoretest provides an in-memory keystore.Keystore for tests that need to exercise migration and error paths without touching a platform keyring (which isn't available or deterministic in unit tests).
|
Package keystoretest provides an in-memory keystore.Keystore for tests that need to exercise migration and error paths without touching a platform keyring (which isn't available or deterministic in unit tests). |
|
korbit
Package korbit is the wire layer (L0) plus the L1 primitive client for the Korbit Open API v2.
|
Package korbit is the wire layer (L0) plus the L1 primitive client for the Korbit Open API v2. |
|
logging
Package logging is the CLI's leveled diagnostic logger, built on log/slog.
|
Package logging is the CLI's leveled diagnostic logger, built on log/slog. |
|
netbind
Package netbind resolves the outbound networking flags (--bind / --family) into a Binder that pins where the CLI's connections come from and which IP family they use, so a customer on a multi-homed host can pin traffic to a link (reliability) and spread calls across source IPs to raise the effective rate limit (the public endpoints are rate-limited per source IP).
|
Package netbind resolves the outbound networking flags (--bind / --family) into a Binder that pins where the CLI's connections come from and which IP family they use, so a customer on a multi-homed host can pin traffic to a link (reliability) and spread calls across source IPs to raise the effective rate limit (the public endpoints are rate-limited per source IP). |
|
ops
Package ops is the L2 operations layer: the Korbit Open API v2 with THIS CLI's guarantees layered on top of the L1 primitive client (internal/korbit).
|
Package ops is the L2 operations layer: the Korbit Open API v2 with THIS CLI's guarantees layered on top of the L1 primitive client (internal/korbit). |
|
output
Package output owns the CLI's stdout/stderr contract.
|
Package output owns the CLI's stdout/stderr contract. |
|
progname
Package progname holds the program's invoked name — the basename of the executable as it was run.
|
Package progname holds the program's invoked name — the basename of the executable as it was run. |
|
rawapi
Package rawapi is a statically-typed layer over the wire client with one function per REST endpoint.
|
Package rawapi is a statically-typed layer over the wire client with one function per REST endpoint. |
|
sandbox
Package sandbox is the lifecycle manager for the local Korbit API Sandbox: it runs the single-file mock under Deno — the CLI-managed pinned Deno by default, or a system `deno` — handing Deno the Official-Source bundle URL to fetch and cache itself, runs/stops/inspects it as a managed background server, and imports the seeded ED25519 key into the normal keystore so a user goes from nothing to a signed, working local exchange in one command.
|
Package sandbox is the lifecycle manager for the local Korbit API Sandbox: it runs the single-file mock under Deno — the CLI-managed pinned Deno by default, or a system `deno` — handing Deno the Official-Source bundle URL to fetch and cache itself, runs/stops/inspects it as a managed background server, and imports the seeded ED25519 key into the normal keystore so a user goes from nothing to a signed, working local exchange in one command. |
|
sandbox/deno
Package deno manages a pinned, checksum-verified Deno runtime that korbit-cli downloads on demand to run the local API sandbox.
|
Package deno manages a pinned, checksum-verified Deno runtime that korbit-cli downloads on demand to run the local API sandbox. |
|
selfupdate
Package selfupdate owns the on-disk install layout and the self-update mechanics behind the `self install|update|uninstall|doctor` commands.
|
Package selfupdate owns the on-disk install layout and the self-update mechanics behind the `self install|update|uninstall|doctor` commands. |
|
spec
Package spec declares the BUILTIN command surface (setup, doctor, ip, key and keystore management, monitor, mcp, logs, debug, commands, license, sandbox) and reuses the shared command-vocabulary types — Param, Positional, the value kinds, the section labels, ResponseField — from internal/cmdmeta.
|
Package spec declares the BUILTIN command surface (setup, doctor, ip, key and keystore management, monitor, mcp, logs, debug, commands, license, sandbox) and reuses the shared command-vocabulary types — Param, Positional, the value kinds, the section labels, ResponseField — from internal/cmdmeta. |
|
stream
Package stream is the resilient real-time data layer over the Korbit WebSocket API.
|
Package stream is the resilient real-time data layer over the Korbit WebSocket API. |
|
stream/state
Package state materializes a stream.Session's event stream into current state: latest ticker and orderbook per symbol, recent public trades, the account's orders, fills, and balances, plus connection health.
|
Package state materializes a stream.Session's event stream into current state: latest ticker and orderbook per symbol, recent public trades, the account's orders, fills, and balances, plus connection health. |
|
tui
Package tui is the interactive trading terminal behind the `tui` command: a full-screen view of live market data (ticker, orderbook, trades) and the account's orders, fills, and balances, materialized from a stream.Session's events by internal/stream/state and kept current through reconnects and REST backfill by the stream layer.
|
Package tui is the interactive trading terminal behind the `tui` command: a full-screen view of live market data (ticker, orderbook, trades) and the account's orders, fills, and balances, materialized from a stream.Session's events by internal/stream/state and kept current through reconnects and REST backfill by the stream layer. |
|
tui/candlechart
Package candlechart renders OHLC candlestick charts in a terminal cell grid.
|
Package candlechart renders OHLC candlestick charts in a terminal cell grid. |
|
tui/candlechart/demo
command
Command demo shows the candlechart component in a real terminal with a simulated live feed (no API, synthetic data).
|
Command demo shows the candlechart component in a real terminal with a simulated live feed (no API, synthetic data). |
|
tui/chartind
Package chartind holds the technical-indicator implementations for the candle chart.
|
Package chartind holds the technical-indicator implementations for the candle chart. |
|
tui/components/balances
Package balances renders the balances pane: a pinned column header (currency / available / total) above a scrolling list of per-currency balances.
|
Package balances renders the balances pane: a pinned column header (currency / available / total) above a scrolling list of per-currency balances. |
|
tui/components/curlist
Package curlist renders the funding screen's currency list: a pinned column header (currency / available / est.
|
Package curlist renders the funding screen's currency list: a pinned column header (currency / available / est. |
|
tui/components/fills
Package fills renders the recent-fills pane: one row per fill, newest first, each showing the local time, symbol, side (buy/sell, side-colored), price, and quantity.
|
Package fills renders the recent-fills pane: one row per fill, newest first, each showing the local time, symbol, side (buy/sell, side-colored), price, and quantity. |
|
tui/components/footer
Package footer renders the two-line status footer: line one is the connection dots, stream-health counters, and the latest non-info notice; line two is the focus-specific key-hint, replaced by a transient toast while it is unexpired.
|
Package footer renders the two-line status footer: line one is the connection dots, stream-health counters, and the latest non-info notice; line two is the focus-specific key-hint, replaced by a transient toast while it is unexpired. |
|
tui/components/header
Package header renders the two-line page header: line one names the app, the active-symbol count, and a right-aligned key/base-URL (with a terminal-size warning chip beside it when the parent flags a cramped terminal); line two is the active symbol's ticker summary (last/bid/ask/24h range/volume) or a loading line.
|
Package header renders the two-line page header: line one names the app, the active-symbol count, and a right-aligned key/base-URL (with a terminal-size warning chip beside it when the parent flags a cramped terminal); line two is the active symbol's ticker summary (last/bid/ask/24h range/volume) or a loading line. |
|
tui/components/keystrip
Package keystrip renders the TUI's key-hint strips — the global footer hint line and the chart/overlay hint lines — from a single ordered list of [Item]s, and returns BOTH the styled line and a click hitmap so the same tokens that document a key are also clickable buttons that dispatch that key.
|
Package keystrip renders the TUI's key-hint strips — the global footer hint line and the chart/overlay hint lines — from a single ordered list of [Item]s, and returns BOTH the styled line and a click hitmap so the same tokens that document a key are also clickable buttons that dispatch that key. |
|
tui/components/ladder
Package ladder renders the trade-ladder body: a DOM-style vertical price ladder over the live book — MINE | bid qty | price | ask qty | MINE — asks above a last/spread line, bids below, the account's resting orders shown in the MINE columns at their price row.
|
Package ladder renders the trade-ladder body: a DOM-style vertical price ladder over the live book — MINE | bid qty | price | ask qty | MINE — asks above a last/spread line, bids below, the account's resting orders shown in the MINE columns at their price row. |
|
tui/components/notices
Package notices renders the stream-notices list shown in the TUI's 'n' popup: recent notices, newest first, each line "HH:MM:SS CODE message" with the code colored by its level (warn yellow, error red, otherwise dim).
|
Package notices renders the stream-notices list shown in the TUI's 'n' popup: recent notices, newest first, each line "HH:MM:SS CODE message" with the code colored by its level (warn yellow, error red, otherwise dim). |
|
tui/components/orderbook
Package orderbook renders the depth (orderbook) pane: asks above, a mid line, bids below, each level drawn over a side-colored depth bar.
|
Package orderbook renders the depth (orderbook) pane: asks above, a mid line, bids below, each level drawn over a side-colored depth bar. |
|
tui/components/orders
Package orders renders the orders pane, a fixed five-column table with a dim header, the data rows windowed by the scroll offset, and the selected row reverse-highlighted.
|
Package orders renders the orders pane, a fixed five-column table with a dim header, the data rows windowed by the scroll offset, and the selected row reverse-highlighted. |
|
tui/components/sidebar
Package sidebar renders the markets pane: one row per watched symbol (symbol + 24h %change), windowed by a scroll offset.
|
Package sidebar renders the markets pane: one row per watched symbol (symbol + 24h %change), windowed by a scroll offset. |
|
tui/components/trades
Package trades renders the recent-trades (time & sales) pane: newest trade on top, each row showing local time, price, and quantity, with the price colored by taker side (buyer-taker up, seller-taker down).
|
Package trades renders the recent-trades (time & sales) pane: newest trade on top, each row showing local time, price, and quantity, with the price colored by taker side (buyer-taker up, seller-taker down). |
|
tui/components/transfers
Package transfers renders the funding screen's history pane: a windowed table of deposit or withdrawal records with a dim column header and the selected row reverse-highlighted.
|
Package transfers renders the funding screen's history pane: a windowed table of deposit or withdrawal records with a dim column header and the selected row reverse-highlighted. |
|
tui/uikit
Package uikit holds the shared presentation primitives and the component contract for the TUI: the per-component render cache (Memo), the comparable style identity (StyleID), and the shared styles, palette, box/panel helpers, and formatters that the individual pane components draw with.
|
Package uikit holds the shared presentation primitives and the component contract for the TUI: the per-component render cache (Memo), the comparable style identity (StyleID), and the shared styles, palette, box/panel helpers, and formatters that the individual pane components draw with. |
|
useragent
Package useragent composes the User-Agent header sent on Korbit API requests (both REST and the WebSocket upgrade).
|
Package useragent composes the User-Agent header sent on Korbit API requests (both REST and the WebSocket upgrade). |
|
version
Package version holds the single CLI version string.
|
Package version holds the single CLI version string. |
Click to show internal directories.
Click to hide internal directories.