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
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ title: 'Page Title'
id: category_filename # 例:quote_pull-static
slug: '/quote/pull/static' # 以 / 开头,对应 URL 路径
sidebar_position: 3 # 数字越小越靠前
sidebar_icon: book # 可选:book | zap | cpu | terminal | sparkles
sidebar_icon: book # 可选:book_open | book | zap | cpu | terminal | sparkles
---
```

Expand Down
45 changes: 28 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ Every `.md` file requires frontmatter:
```yaml
---
title: 'Page Title'
id: category_file-name # e.g., quote_pull-static
slug: '/quote/pull/static' # must start with /, matches the URL path
sidebar_position: 3 # lower = higher in sidebar
sidebar_icon: book # optional: book | zap | cpu | terminal | sparkles
id: category_file-name # e.g., quote_pull-static
slug: '/quote/pull/static' # must start with /, matches the URL path
sidebar_position: 3 # lower = higher in sidebar
sidebar_icon: book # optional: book_open | book | zap | cpu | terminal | sparkles
---
```

Expand All @@ -96,24 +96,26 @@ The sidebar is **auto-generated** from the filesystem by `docs/.vitepress/theme/

```markdown
<!-- Wrong -->

![diagram](../../static/diagram.png)

<!-- Correct -->

![diagram](https://pub.pbkrs.com/files/xxx/diagram.png)
```

### Global Vue Components

These components are globally registered and can be used directly in any `.md` file:

| Component | Purpose |
|-----------|---------|
| `<Tabs>` / `<TabItem>` | Code group tabs |
| `<TipContainer>` | Callout/tip boxes |
| `<TryIt>` | Interactive API playground |
| `<SDKLinks>` / `<SDK>` | SDK download links |
| `<Skill>` | AI Skill feature showcase |
| `<HomePage>` | Homepage layout |
| Component | Purpose |
| ---------------------- | -------------------------- |
| `<Tabs>` / `<TabItem>` | Code group tabs |
| `<TipContainer>` | Callout/tip boxes |
| `<TryIt>` | Interactive API playground |
| `<SDKLinks>` / `<SDK>` | SDK download links |
| `<Skill>` | AI Skill feature showcase |
| `<HomePage>` | Homepage layout |

To add a new component: create the Vue file in `docs/.vitepress/theme/components/` and export it from `index.ts`.

Expand Down Expand Up @@ -159,6 +161,7 @@ skills/longbridge/SKILL.md
### When to update the Skill

Update `SKILL.md` when:

- A new API endpoint is added or an existing one changes
- A new SDK language is supported
- New features are added to the CLI or MCP server
Expand All @@ -167,6 +170,7 @@ Update `SKILL.md` when:
### Skill structure

The Skill is a self-contained Markdown document that gives an AI agent everything needed to call Longbridge APIs correctly. It includes:

- Authentication and environment setup
- All major API endpoints with parameters and response shapes
- Common workflows (quote → order → confirm)
Expand All @@ -180,11 +184,11 @@ Keep the Skill accurate and current — AI agents may invoke it instead of readi

### Locale configuration

| Locale | Directory | URL prefix | Config path |
|--------|-----------|------------|-------------|
| English | `docs/en/` | `/` (root) | `docs/.vitepress/locales/en/` |
| Simplified Chinese | `docs/zh-CN/` | `/zh-CN/` | `docs/.vitepress/locales/zh-CN/` |
| Traditional Chinese | `docs/zh-HK/` | `/zh-HK/` | `docs/.vitepress/locales/zh-HK/` |
| Locale | Directory | URL prefix | Config path |
| ------------------- | ------------- | ---------- | -------------------------------- |
| English | `docs/en/` | `/` (root) | `docs/.vitepress/locales/en/` |
| Simplified Chinese | `docs/zh-CN/` | `/zh-CN/` | `docs/.vitepress/locales/zh-CN/` |
| Traditional Chinese | `docs/zh-HK/` | `/zh-HK/` | `docs/.vitepress/locales/zh-HK/` |

### Adding nav items

Expand All @@ -209,6 +213,7 @@ docs/.vitepress/theme/locales/zh-HK.json
### Route rewriting

The `docs/.vitepress/utils.ts` `rewriteMarkdownPath` function handles URL generation. The `slug` frontmatter field overrides the default path:

- An absolute `slug` like `/trade-order-create` replaces the entire path segment
- A relative `slug` resolves relative to the file's directory

Expand All @@ -231,11 +236,13 @@ git submodule update --remote --merge
Contains the canonical OpenAPI specification and multi-language SDK source code (Python, Rust, Go, Node.js, Java, C++).

**Sync when:**

- An API endpoint is added, removed, or its parameters/response shape changes
- A new SDK language is added
- An existing SDK method is renamed or its signature changes

**What to change:**

- `openapi/openapi.yaml` — the authoritative API spec; all other changes derive from this
- SDK source files for any affected method across all languages

Expand All @@ -244,11 +251,13 @@ Contains the canonical OpenAPI specification and multi-language SDK source code
The official Go SDK. Method names, parameter types, and response structs must stay consistent with what is documented in `docs/{lang}/` and defined in `openapi/openapi.yaml`.

**Sync when:**

- An API method signature changes (parameter added/removed/renamed)
- A new endpoint is added that needs a Go implementation
- Response struct fields change

**What to change:**

- Go struct definitions and method signatures in `openapi-go/`
- Ensure Go method names in `SDKLinks` component (`docs/.vitepress/theme/components/SDKLinks.vue`) match

Expand All @@ -257,11 +266,13 @@ The official Go SDK. Method names, parameter types, and response structs must st
The `longbridge` CLI distributed via Homebrew. CLI docs (`docs/{lang}/docs/cli.md`) and `<CliCommand>` examples in API docs must reflect the actual CLI behavior.

**Sync when:**

- A new CLI command or flag is added
- A command's output format or behavior changes
- A command is deprecated or removed

**What to change:**

- CLI source in `longbridge-terminal/`
- `docs/{lang}/docs/cli.md` in all three locales
- Any `<CliCommand>` blocks in docs that use the affected command
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/md-plugins/cli-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function getUsageTitle(localeIndex: string): string {
}

function getInstallUrl(localeIndex: string): string {
return `${getLocalePrefix(localeIndex)}/docs/cli/installation`
return `${getLocalePrefix(localeIndex)}/docs/cli/install`
}

function extractFirstCommand(content: string): string | null {
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/theme/components/ApiReference.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const PAGE_ICONS: Record<string, string> = {
lock: `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>`,
activity: `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>`,
'alert-circle': `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>`,
book: `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/></svg>`,
}
interface TagGroup {
name: string
Expand Down
11 changes: 8 additions & 3 deletions docs/.vitepress/theme/utils/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { type DefaultTheme } from 'vitepress'
import { isPageIncluded } from '../../region-utils'

const SIDEBAR_ICONS: Record<string, string> = {
book: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg>`,
book_open: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open-icon lucide-book-open"><path d="M12 7v14"/><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"/></svg>`,
book: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/></svg>`,
zap: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>`,
cpu: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><rect x="9" y="9" width="6" height="6"/><line x1="9" y1="1" x2="9" y2="4"/><line x1="15" y1="1" x2="15" y2="4"/><line x1="9" y1="20" x2="9" y2="23"/><line x1="15" y1="20" x2="15" y2="23"/><line x1="20" y1="9" x2="23" y2="9"/><line x1="20" y1="14" x2="23" y2="14"/><line x1="1" y1="9" x2="4" y2="9"/><line x1="1" y1="14" x2="4" y2="14"/></svg>`,
terminal: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>`,
Expand All @@ -20,6 +21,8 @@ const SIDEBAR_ICONS: Record<string, string> = {
star: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>`,
newspaper: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 0-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2"/><path d="M18 14h-8"/><path d="M15 18h-5"/><path d="M10 6h8v4h-8V6Z"/></svg>`,
github: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.2c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.4 5.4 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>`,
'arrow-down-to-line': `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 17V3"/><path d="m6 11 6 6 6-6"/><path d="M19 21H5"/></svg>`,
'badge-question-mark': `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" x2="12.01" y1="17" y2="17"/></svg>`,
}

export const SIDEBAR_ICONS_MAP = SIDEBAR_ICONS
Expand Down Expand Up @@ -129,7 +132,8 @@ function generateSidebarItems(
const { data } = matter(fileContent)
const rawTitle = data['sidebar_label'] || data['title'] || getDefaultTitle(file)
const iconKey = data['sidebar_icon'] as string | undefined
const iconHtml = iconKey && SIDEBAR_ICONS[iconKey] ? `<span class="sidebar-item-icon">${SIDEBAR_ICONS[iconKey]}</span>` : ''
const iconHtml =
iconKey && SIDEBAR_ICONS[iconKey] ? `<span class="sidebar-item-icon">${SIDEBAR_ICONS[iconKey]}</span>` : ''
const title = iconHtml ? `${iconHtml}${rawTitle}` : rawTitle
const slug = data['slug']

Expand Down Expand Up @@ -169,7 +173,8 @@ function generateSidebarItems(
if (subItems.length > 0) {
const dirTitle = subCategoryConfig?.label || formatDirName(dir)
const iconKey = subCategoryConfig?.icon
const iconHtml = iconKey && SIDEBAR_ICONS[iconKey] ? `<span class="sidebar-item-icon">${SIDEBAR_ICONS[iconKey]}</span>` : ''
const iconHtml =
iconKey && SIDEBAR_ICONS[iconKey] ? `<span class="sidebar-item-icon">${SIDEBAR_ICONS[iconKey]}</span>` : ''
const text = iconHtml ? `${iconHtml}${dirTitle}` : dirTitle
const collapsed = depth === 0 ? false : (subCategoryConfig?.collapsed ?? true)
const position = subCategoryConfig?.position
Expand Down
1 change: 1 addition & 0 deletions docs/en/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
layout: api-reference
title: API Reference
sidebar: false
sidebar_icon: book
---
1 change: 1 addition & 0 deletions docs/en/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ id: changelog
title: Changelog
slug: changelog
sidebar_position: 7
sidebar_icon: newspaper
---

## 2026-04-09
Expand Down
4 changes: 2 additions & 2 deletions docs/en/docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Longbridge CLI'
sidebar_label: 'Overview'
sidebar_position: 1
sidebar_icon: terminal
sidebar_icon: book_open
---

# Longbridge CLI
Expand All @@ -15,7 +15,7 @@ scripting, AI-agent tool-calling, and daily workflows from the terminal.

## Quick Start

See [Installation](/docs/cli/installation) for platform-specific install instructions and authentication setup. After installing, try any command:
See [Installation](/docs/cli/install) for platform-specific install instructions and authentication setup. After installing, try any command:

```bash
# Check real-time price
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Installation'
sidebar_label: 'Installation'
sidebar_position: 2
sidebar_icon: cpu
sidebar_icon: arrow-down-to-line
---

# Installation
Expand Down
1 change: 1 addition & 0 deletions docs/en/docs/cli/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 'Release Notes'
sidebar_label: 'Release Notes'
sidebar_position: 100
sidebar_icon: newspaper
---

# Release Notes
Expand Down
1 change: 1 addition & 0 deletions docs/en/docs/cli/tui.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 'tui'
sidebar_label: 'TUI'
sidebar_position: 99
sidebar_icon: sparkles
---

# longbridge tui
Expand Down
6 changes: 3 additions & 3 deletions docs/en/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
sidebar_position: -999
title: Platform Introduction
id: getting_started_introduce
sidebar_icon: book
title: Overview
id: overview
sidebar_icon: book_open
---

Longbridge Developers provides programmatic quote trading interfaces for investors with research and development capabilities and assists them to build trading or quote strategy analysis tools based on their own investment strategies. The functions fall into the following categories:
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/qa/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"collapsed": true,
"link": null,
"position": 6.5,
"icon": "book-open"
"icon": "badge-question-mark"
}
1 change: 1 addition & 0 deletions docs/zh-CN/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ id: changelog
title: 更新日志
slug: changelog
sidebar_position: 7
sidebar_icon: newspaper
---

## 2026-04-09
Expand Down
20 changes: 10 additions & 10 deletions docs/zh-CN/docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Longbridge CLI'
sidebar_label: '概述'
sidebar_position: 1
sidebar_icon: terminal
sidebar_icon: book_open
---

# Longbridge CLI
Expand All @@ -13,7 +13,7 @@ Longbridge CLI(`longbridge`)是面向 Longbridge OpenAPI 全端点的 AI 原

## 快速开始

参见[安装说明](/zh-CN/docs/cli/installation)了解平台安装方式与鉴权配置。安装后可直接运行任意命令:
参见[安装说明](/zh-CN/docs/cli/install)了解平台安装方式与鉴权配置。安装后可直接运行任意命令:

```bash
# 查询实时行情
Expand All @@ -39,11 +39,11 @@ longbridge quote TSLA.US NVDA.US --format json

标的代码采用 `代码.市场` 格式:

| 示例 | 市场 |
| ------------- | ------------------ |
| `TSLA.US` | 美股 |
| `700.HK` | 港股 |
| `600519.SH` | A 股(上交所) |
| `000568.SZ` | A 股(深交所) |
| `D05.SG` | 新加坡 |
| `BTCUSD.HAS` | 加密货币(Longbridge 专属)|
| 示例 | 市场 |
| ------------ | --------------------------- |
| `TSLA.US` | 美股 |
| `700.HK` | 港股 |
| `600519.SH` | A 股(上交所) |
| `000568.SZ` | A 股(深交所) |
| `D05.SG` | 新加坡 |
| `BTCUSD.HAS` | 加密货币(Longbridge 专属) |
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: '安装'
sidebar_label: '安装'
sidebar_position: 2
sidebar_icon: cpu
sidebar_icon: arrow-down-to-line
---

# 安装
Expand Down
1 change: 1 addition & 0 deletions docs/zh-CN/docs/cli/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 'Release Notes'
sidebar_label: 'Release Notes'
sidebar_position: 100
sidebar_icon: newspaper
---

# Release Notes
Expand Down
1 change: 1 addition & 0 deletions docs/zh-CN/docs/cli/tui.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 'tui'
sidebar_label: 'TUI'
sidebar_position: 99
sidebar_icon: sparkles
---

# longbridge tui
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: -999
title: 平台介绍
id: getting_started_introduce
sidebar_icon: book
sidebar_icon: book_open
---

Longbridge Developers 为有研发能力的投资者提供程序化行情交易接口,助力投资者根据自身投资策略搭建交易或行情策略分析工具。覆盖以下类别功能:
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/docs/qa/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"collapsed": true,
"link": null,
"position": 6.5,
"icon": "book-open"
"icon": "badge-question-mark"
}
1 change: 1 addition & 0 deletions docs/zh-HK/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ id: changelog
title: 更新日誌
slug: changelog
sidebar_position: 7
sidebar_icon: newspaper
---

## 2026-04-09
Expand Down
Loading
Loading