Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions docs/en/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ sidebar_icon: terminal
id: cli
---

# Longbridge Terminal CLI
# Longbridge CLI

Longbridge Terminal is an AI-native CLI covering every Longbridge OpenAPI endpoint — real-time market data, account management, and trading. Designed for scripting, AI-agent tool-calling, and daily trading workflows from the terminal.
Longbridge CLI is an AI-native CLI tool covering every Longbridge OpenAPI endpoint — real-time market data, account management, and trading. Designed for scripting, AI-agent tool-calling, and daily trading workflows from the terminal.

**GitHub:** [longbridge/longbridge-terminal](https://github.com/longbridge/longbridge-terminal)

Expand Down Expand Up @@ -50,30 +50,37 @@ $ longbridge quote TSLA.US NVDA.US --format json

## Installation

**macOS** (requires [Homebrew](https://brew.sh))
<Tabs groupId="cli-install">
<TabItem value="homebrew" label="macOS (Homebrew)" default>

```bash
brew install --cask longbridge/tap/longbridge-terminal
```

**macOS / Linux**
</TabItem>
<TabItem value="script" label="Linux / macOS (Script)">

```bash
curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh
```

**Windows** ([Scoop](https://scoop.sh))
</TabItem>
<TabItem value="scoop" label="Windows (Scoop)">

```powershell
scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json
```

**Windows** (PowerShell)
</TabItem>
<TabItem value="powershell" label="Windows (PowerShell)">

```powershell
iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex
```

</TabItem>
</Tabs>

Installs `longbridge` to `/usr/local/bin` (macOS/Linux) or `%LOCALAPPDATA%\Programs\longbridge` (Windows). On Windows the binary is `longbridge.exe`.

After installation, authenticate and explore available commands:
Expand Down
73 changes: 62 additions & 11 deletions docs/en/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,80 @@ All API response are used [Unix Timestamp](https://en.wikipedia.org/wiki/Unix_ti
<Tabs groupId="programming-language">
<TabItem value="python" label="Python" default>
<ul>
<li><a href="https://www.python.org/">Python 3</a></li>
<li>Pip</li>
<li><a href="https://www.python.org/">Python 3</a></li>
<li>Pip</li>
</ul>
</TabItem>
<TabItem value="javascript" label="JavaScript">
<ul>
<li><a href="https://nodejs.org/">Node.js</a> or <a href="https://bun.sh">Bun</a></li>
<li>Yarn</li>
</ul>
<ul>
<li><a href="https://nodejs.org/">Node.js</a> or <a href="https://bun.sh">Bun</a></li>
<li>Yarn</li>
</ul>
</TabItem>
<TabItem value="rust" label="Rust">
<ul><li><a href="https://www.rust-lang.org/">Rust</a></li></ul>
<ul>
<li><a href="https://www.rust-lang.org/">Rust</a></li>
</ul>
</TabItem>
<TabItem value="java" label="Java">
<ul><li><a href="https://openjdk.org/">JDK</a></li>
<li><a href="https://maven.apache.org/">Maven</a></li></ul>
<ul>
<li><a href="https://openjdk.org/">JDK</a></li>
<li><a href="https://maven.apache.org/">Maven</a></li>
</ul>
</TabItem>
<TabItem value="go" label="Go">
<ul><li><a href="https://go.dev">Go</a></li>
<li><a href="https://pkg.go.dev/github.com/longbridge/openapi-go">Go Docs</a></li></ul>
<ul>
<li><a href="https://go.dev">Go</a></li>
<li><a href="https://pkg.go.dev/github.com/longbridge/openapi-go">Go Docs</a></li>
</ul>
</TabItem>
</Tabs>

## CLI Quick Start

If you don't need to write code, the [Longbridge CLI](/docs/cli) offers a lightweight alternative — install once, authorize via OAuth, no environment variables needed.

### Installation

<Tabs groupId="cli-install">
<TabItem value="homebrew" label="macOS (Homebrew)" default>

```bash
brew install --cask longbridge/tap/longbridge-terminal
```

</TabItem>
<TabItem value="script" label="Linux / macOS (Script)">

```bash
curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh
```

</TabItem>
<TabItem value="scoop" label="Windows (Scoop)">

```powershell
scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json
```

</TabItem>
<TabItem value="powershell" label="Windows (PowerShell)">

```powershell
iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex
```

</TabItem>
</Tabs>

### Login

```bash
longbridge login
```

The browser opens the authorization page automatically. The token is saved after approval — no need to repeat.

## Install SDK

:::warning Package Renamed
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: -999
title: Introduction
title: Platform Introduction
id: getting_started_introduce
sidebar_icon: book
---
Expand Down
6 changes: 3 additions & 3 deletions docs/en/docs/llm.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
sidebar_position: 2.2
sidebar_position: 2.3
slug: /llm
sidebar_label: LLM
sidebar_label: LLMs
sidebarCollapsed: true
sidebar_icon: sparkles
id: llm
---

# LLM Components
# LLMs Components

We provide several components for LLMs (Large Language Models) that allow you to easily access and analyze financial data, real-time market data, and even enable AI to place orders.

Expand Down
50 changes: 37 additions & 13 deletions docs/en/docs/mcp.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 2
sidebar_position: 2.2
slug: /mcp
sidebar_label: MCP
sidebarCollapsed: true
Expand All @@ -9,13 +9,16 @@ sidebar_icon: cpu

# Longbridge MCP Service

Longbridge provides a hosted MCP (Model Context Protocol) service that lets you use Longbridge market data and account capabilities directly from AI coding assistants and chat tools — without managing API keys manually.
Longbridge provides a hosted HTTP MCP (Model Context Protocol) service that lets you use Longbridge market data and account capabilities directly from AI coding assistants and chat tools — without managing API keys manually.

**MCP endpoint:** `https://openapi.longbridge.com/mcp`
:::tip MCP endpoint
- Global: `https://openapi.longbridge.com/mcp`
- Mainland China: `https://openapi.longbridge.cn/mcp` (faster access)
:::

## Prerequisites

- An active Longbridge account with onboarding completed
- An active Longbridge account with onboarding completed, or a paper trading account
- An AI client that supports MCP OAuth 2.1 (see compatibility note below)

## Available capabilities
Expand All @@ -34,7 +37,34 @@ Actual tool availability varies by region, account level, and granted scopes.

> Configuration format may vary across client versions. Treat your client's official MCP documentation as the source of truth. The core parameter you need is the server URL below.

In any MCP-capable client, add Longbridge as a remote MCP server:
### Claude Code

Run the following command in your terminal:

```bash
claude mcp add --transport http longbridge https://openapi.longbridge.com/mcp
```

Then open the `claude` terminal interface, type `/mcp`, select `longbridge`, and choose **Authenticate** to complete the OAuth authorization flow.

### Codex

1. Click **Settings** (bottom right) → **MCP Servers** → **Add Server**
2. In the "Connect to a custom MCP" screen, fill in:
- Name: `longbridge`
- Type: **Streamable HTTP**
- URL: `https://openapi.longbridge.com/mcp`
- Leave all other fields empty
3. Click **Save**
4. Back in the MCP Servers list, click **Authenticate** on the `longbridge` entry to complete OAuth authorization

### Cursor

Settings → MCP Servers → Add Remote MCP Server, then enter the URL above.

### Zed

Add the following to your `settings.json` under the `context_servers` key (key name is customizable):

```json
{
Expand All @@ -46,15 +76,9 @@ In any MCP-capable client, add Longbridge as a remote MCP server:
}
```

Where to find the MCP configuration entry in each client:

- **Cursor**: Settings → MCP Servers → Add Remote MCP Server
- **Claude Code**: MCP config file or the `claude mcp add` command
- **ChatGPT**: Settings → Connectors (or the workspace MCP configuration entry)
- **Zed**: `context_servers` key in `settings.json` (key name is customizable)
- **Cherry Studio**: Settings → MCP Servers → Add
### Cherry Studio

After saving the configuration, the client will guide you through the OAuth authorization flow automatically.
Settings → MCP Servers → Add, then enter the URL above.

## OAuth authorization flow

Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/qa/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The platform offers two ways to access stock data without writing any code:

**CLI (Command-line Tool)**

Install the [Longbridge Terminal CLI](/docs/cli) and query market data with simple commands — no programming required:
Install the [Longbridge CLI](/docs/cli) and query market data with simple commands — no programming required:

```bash
longbridge quote AAPL.US TSLA.US
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/qa/trade.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ After placing orders via the OpenAPI, you can view them through any of the follo

- **Order inquiry API**: Call the API to query real-time order status
- **WebSocket push**: Subscribe to trade push events to receive order updates in real time
- **CLI**: Use the [Longbridge Terminal CLI](/docs/cli) to query from the command line, e.g. `longbridge orders`
- **CLI**: Use the [Longbridge CLI](/docs/cli) to query from the command line, e.g. `longbridge orders`
- **App / PC**: View orders and their statuses directly in the terminal products

## Q7: How can I know if my account has sufficient funds for trading?
Expand Down
19 changes: 13 additions & 6 deletions docs/zh-CN/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ id: cli
sidebar_icon: terminal
---

# Longbridge Terminal CLI
# Longbridge CLI

Longbridge Terminal 是一款 AI-native 命令行工具,覆盖全部 Longbridge Developers 端点,支持实时行情、账户管理与交易操作。专为脚本自动化、AI 代理工具调用及日常终端交易工作流设计。
Longbridge CLI 是一款 AI-native 命令行工具,覆盖全部 Longbridge Developers 端点,支持实时行情、账户管理与交易操作。专为脚本自动化、AI 代理工具调用及日常终端交易工作流设计。

**GitHub:** [longbridge/longbridge-terminal](https://github.com/longbridge/longbridge-terminal)

Expand Down Expand Up @@ -50,30 +50,37 @@ $ longbridge quote TSLA.US NVDA.US --format json

## 安装

**macOS**(需要 [Homebrew](https://brew.sh))
<Tabs groupId="cli-install">
<TabItem value="homebrew" label="macOS (Homebrew)" default>

```bash
brew install --cask longbridge/tap/longbridge-terminal
```

**macOS / Linux**
</TabItem>
<TabItem value="script" label="Linux / macOS (脚本)">

```bash
curl -sSL https://open.longbridge.com/longbridge/longbridge-terminal/install | sh
```

**Windows**([Scoop](https://scoop.sh))
</TabItem>
<TabItem value="scoop" label="Windows (Scoop)">

```powershell
scoop install https://open.longbridge.com/longbridge/longbridge-terminal/longbridge.json
```

**Windows**(PowerShell)
</TabItem>
<TabItem value="powershell" label="Windows (PowerShell)">

```powershell
iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex
```

</TabItem>
</Tabs>

安装完成后,`longbridge` 二进制文件位于 `/usr/local/bin`(macOS/Linux)或 `%LOCALAPPDATA%\Programs\longbridge`(Windows),Windows 下可执行文件名为 `longbridge.exe`。

安装完成后,完成登录并查看可用命令:
Expand Down
Loading
Loading