internal/

directory
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0

Directories

Path Synopsis
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.
Package agentskill installs and inspects the bundled Korbit Agent Skill on disk.
Package agentskill installs and inspects the bundled Korbit Agent Skill on disk.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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).
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.
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).
Package config resolves the CLI home directory and loads config.json.
Package config resolves the CLI home directory and loads config.json.
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.
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.
Package ids mints client order ids and enforces the Korbit clientOrderId charset.
Package ids mints client order ids and enforces the Korbit clientOrderId charset.
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.
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.
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.
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).
Package keystore stores private key material, addressed by key name.
Package keystore stores private key material, addressed by key name.
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).
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.
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.
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).
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).
Package output owns the CLI's stdout/stderr contract.
Package output owns the CLI's stdout/stderr contract.
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.
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.
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.
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.
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.
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.
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.
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.
candlechart
Package candlechart renders OHLC candlestick charts in a terminal cell grid.
Package candlechart renders OHLC candlestick charts in a terminal cell grid.
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).
chartind
Package chartind holds the technical-indicator implementations for the candle chart.
Package chartind holds the technical-indicator implementations for the candle chart.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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).
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.
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.
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).
Package version holds the single CLI version string.
Package version holds the single CLI version string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL