The AI-native trading CLI that actually earns the label
Longbridge flattens its whole trading API into one uniform CLI, with JSON on every command so scripts and LLM agents can drive a broker directly.
What it does A Rust CLI — plus a full-screen ratatui TUI for monitoring — that exposes essentially the entire Longbridge OpenAPI from the terminal. Market data side: real-time quotes, order-book depth, K-lines, option chains, warrants, financial statements, analyst ratings, news, and filings. Trading side: balances, positions, and order submission, modification, cancellation, and execution history. It’s a wrapper, not a new engine — but the wrapper is the product.
The interesting bit
The agent-first claims are backed by concrete choices, not a sticker: commands taking --count also accept --limit purely “for AI agent compatibility” (models stumble on flag names), and news and filing bodies render as Markdown — the format LLMs digest best. The network layer gets the same care: the CLI probes geotest.lbkrs.com to pick .cn vs. global endpoints, caches the answer for six hours, and check re-measures both because a split-tunnel proxy can route the probe and the API down entirely different paths.
Key highlights
- Full market-data surface: quotes, depth, broker queues, tick trades, intraday, K-lines, capital flows, index constituents
- Deep fundamentals: multi-period financials, analyst consensus and target-price history, dividends, shareholder tracking, peer valuation comps
- Unusual extras: strategy signals with target prices and catalysts, a 0–100 market-sentiment index, ETF holdings pulled from SEC N-PORT filings, and community topics you can post to from the terminal
- OAuth 2.0 handled by the SDK — one login covers both CLI and TUI
--format jsonon every command; Markdown bodies for news and filings
Caveats
- Longbridge-only — a client for one broker, not a general market-data tool
- A few commands (valuation history, latest financial-report summary) are marked “AP accounts only”
- Region detection phones
geotest.lbkrs.comto choose endpoints, thoughLONGBRIDGE_REGIONcan pin it
Verdict Longbridge customers who live in a terminal — or want to hand a broker to an agent — get unusually complete glue, well poured. Everyone else has no reason to install it.
Frequently asked
- What is longbridge/longbridge-terminal?
- Longbridge flattens its whole trading API into one uniform CLI, with JSON on every command so scripts and LLM agents can drive a broker directly.
- Is longbridge-terminal open source?
- Yes — longbridge/longbridge-terminal is open source, released under the Apache-2.0 license.
- What language is longbridge-terminal written in?
- longbridge/longbridge-terminal is primarily written in Rust.
- How popular is longbridge-terminal?
- longbridge/longbridge-terminal has 1k stars on GitHub.
- Where can I find longbridge-terminal?
- longbridge/longbridge-terminal is on GitHub at https://github.com/longbridge/longbridge-terminal.