diff --git a/docs/.vitepress/.temp/assets/ai.svg b/docs/.vitepress/.temp/assets/ai.svg new file mode 100644 index 00000000..9934fda1 --- /dev/null +++ b/docs/.vitepress/.temp/assets/ai.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/.vitepress/.temp/assets/bar.svg b/docs/.vitepress/.temp/assets/bar.svg new file mode 100644 index 00000000..8aefcabc --- /dev/null +++ b/docs/.vitepress/.temp/assets/bar.svg @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/docs/.vitepress/.temp/assets/code.svg b/docs/.vitepress/.temp/assets/code.svg new file mode 100644 index 00000000..f665ee45 --- /dev/null +++ b/docs/.vitepress/.temp/assets/code.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/.vitepress/.temp/assets/icon-cloud.svg b/docs/.vitepress/.temp/assets/icon-cloud.svg new file mode 100644 index 00000000..f5c2e0bd --- /dev/null +++ b/docs/.vitepress/.temp/assets/icon-cloud.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/docs/.vitepress/.temp/assets/icon-code.svg b/docs/.vitepress/.temp/assets/icon-code.svg new file mode 100644 index 00000000..1d1a78e3 --- /dev/null +++ b/docs/.vitepress/.temp/assets/icon-code.svg @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/docs/.vitepress/.temp/assets/icon-lanuch.svg b/docs/.vitepress/.temp/assets/icon-lanuch.svg new file mode 100644 index 00000000..6523d152 --- /dev/null +++ b/docs/.vitepress/.temp/assets/icon-lanuch.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/docs/.vitepress/.temp/assets/quote.svg b/docs/.vitepress/.temp/assets/quote.svg new file mode 100644 index 00000000..d548172e --- /dev/null +++ b/docs/.vitepress/.temp/assets/quote.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/.vitepress/.temp/assets/sdk.svg b/docs/.vitepress/.temp/assets/sdk.svg new file mode 100644 index 00000000..cc8d1abc --- /dev/null +++ b/docs/.vitepress/.temp/assets/sdk.svg @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/.vitepress/.temp/assets/trade.svg b/docs/.vitepress/.temp/assets/trade.svg new file mode 100644 index 00000000..9b1c3a1f --- /dev/null +++ b/docs/.vitepress/.temp/assets/trade.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/.vitepress/.temp/longbridge-terminal/install b/docs/.vitepress/.temp/longbridge-terminal/install new file mode 100755 index 00000000..2d8eec88 --- /dev/null +++ b/docs/.vitepress/.temp/longbridge-terminal/install @@ -0,0 +1,67 @@ +#!/usr/bin/env sh +set -eu +type curl > /dev/null || { echo "curl: not found"; exit 1; } + +repo='longbridge/longbridge-terminal' + +get_latest_release() { + tag=$(curl --silent "https://open.longbridge.cn/$repo/releases/latest") + if [ -z "$tag" ]; then + echo "Failed to fetch the latest release." >&2 + return 1 + fi + echo "$tag" +} + +version=$(get_latest_release) || exit 1 + +echo "Latest release: $version" + +bin_name='longbridge' +package_name='longbridge-terminal' + + +platform="$(uname | tr "[A-Z]" "[a-z]")" # Linux => linux +arch="$(uname -m)" # x86_64, arm64, aarch64, etc. + +# Normalize architecture names +case "$arch" in + x86_64) + arch="amd64" + ;; + aarch64) + arch="arm64" + ;; + arm64) + arch="arm64" + ;; +esac + +echo "Downloading $package_name@$version ..." + +# Always use the musl build on Linux – it is statically linked and works on any +# Linux system regardless of the glibc version (avoids segfaults on glibc +# systems where the binary was compiled against a different glibc version). +libc='' +if [ "$platform" = "linux" ]; then + libc='-musl' +fi + +download_url=https://open.longbridge.com/github/release/longbridge-terminal/$version/$package_name-$platform$libc-$arch.tar.gz +echo $download_url + +tmp_dir=$(mktemp -d) +trap 'rm -rf "$tmp_dir"' EXIT + +curl -Lo "$tmp_dir/$bin_name.tar.gz" $download_url +tar zxf "$tmp_dir/$bin_name.tar.gz" -C "$tmp_dir" + +if test $(id -u) -eq 0; then + mv "$tmp_dir/$bin_name" /usr/local/bin/$bin_name +else + sudo mv "$tmp_dir/$bin_name" /usr/local/bin/$bin_name +fi +echo "Longbridge CLI $version has installed successfully." +echo "" +echo "You can use \`longbridge -h\` to get help." +echo "" diff --git a/docs/.vitepress/.temp/longbridge-terminal/install.ps1 b/docs/.vitepress/.temp/longbridge-terminal/install.ps1 new file mode 100644 index 00000000..60529804 --- /dev/null +++ b/docs/.vitepress/.temp/longbridge-terminal/install.ps1 @@ -0,0 +1,78 @@ +#!/usr/bin/env pwsh +# Longbridge Terminal CLI installer for Windows +# Usage: iwr https://open.longbridge.com/longbridge/longbridge-terminal/install.ps1 | iex + +$ErrorActionPreference = 'Stop' + +$repo = 'longbridge/longbridge-terminal' +$binName = 'longbridge' +$packageName = 'longbridge-terminal' +$installDir = Join-Path $env:LOCALAPPDATA 'Programs\longbridge' + +# ── Resolve latest release version ─────────────────────────────────────────── + +Write-Host "Fetching latest release..." + +try { + $version = (Invoke-WebRequest -Uri "https://open.longbridge.com/$repo/releases/latest" -UseBasicParsing -TimeoutSec 15).Content.Trim() + if (-not $version) { + throw "Failed to fetch the latest release." + } +} catch { + throw "Failed to fetch the latest release: $_" +} + +Write-Host "Latest release: $version" + +# ── Download ────────────────────────────────────────────────────────────────── + +$downloadUrl = "https://open.longbridge.com/github/release/longbridge-terminal/$version/$packageName-windows-amd64.zip" + +Write-Host "Downloading $packageName@$version ..." +Write-Host $downloadUrl + +$tmpDir = Join-Path $env:TEMP ([System.IO.Path]::GetRandomFileName()) +$zipPath = Join-Path $tmpDir "$binName.zip" + +New-Item -ItemType Directory -Path $tmpDir | Out-Null + +try { + $wc = New-Object System.Net.WebClient + $wc.DownloadFile($downloadUrl, $zipPath) + $wc.Dispose() + + # ── Extract ─────────────────────────────────────────────────────────────── + + Add-Type -AssemblyName System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::ExtractToDirectory($zipPath, $tmpDir) + + # ── Install ─────────────────────────────────────────────────────────────── + + if (-not (Test-Path $installDir)) { + New-Item -ItemType Directory -Path $installDir | Out-Null + } + + $srcExe = Join-Path $tmpDir "$binName.exe" + $destExe = Join-Path $installDir "$binName.exe" + Move-Item -Path $srcExe -Destination $destExe -Force + +} finally { + Remove-Item -Recurse -Force $tmpDir -ErrorAction SilentlyContinue +} + +# ── Add to user PATH if needed ──────────────────────────────────────────────── + +$userPath = [Environment]::GetEnvironmentVariable('PATH', 'User') +if ($userPath -notlike "*$installDir*") { + $newPath = ($userPath.TrimEnd(';') + ";$installDir").TrimStart(';') + [Environment]::SetEnvironmentVariable('PATH', $newPath, 'User') + Write-Host "" + Write-Host "Added $installDir to your PATH." + Write-Host "Restart your terminal for the PATH change to take effect." +} + +Write-Host "" +Write-Host "Longbridge CLI $version has been installed successfully." +Write-Host "" +Write-Host "Run 'longbridge auth login' to authenticate, then 'longbridge -h' for help." +Write-Host "" diff --git a/docs/.vitepress/theme/components/NewHomePage/ProductSkill.vue b/docs/.vitepress/theme/components/NewHomePage/ProductSkill.vue index c9f8abd9..eb74e938 100644 --- a/docs/.vitepress/theme/components/NewHomePage/ProductSkill.vue +++ b/docs/.vitepress/theme/components/NewHomePage/ProductSkill.vue @@ -26,12 +26,12 @@ const agents = [ }, ] -const SEMANTIC_TEXT = `Install Longbridge Skill following the guide:\nhttps://developers.longbridge.com/skill/install.md` +const SEMANTIC_TEXT = `Install Longbridge Skill following the guide:\nhttps://open.longbridge.com/skill/install.md` const cliTabs = [ - { label: 'bun', cmd: 'bunx skills add longbridge/developers -g -y' }, - { label: 'npx', cmd: 'npx skills add longbridge/developers -g -y' }, - { label: 'yarn', cmd: 'yarn dlx skills add longbridge/developers -g -y' }, + { label: 'bun', cmd: 'bunx skills add longbridge/skills -g' }, + { label: 'npx', cmd: 'npx skills add longbridge/skills -g' }, + { label: 'yarn', cmd: 'yarn dlx skills add longbridge/skills -g' }, ] const activeCliTab = ref(0) @@ -160,7 +160,7 @@ function copyCli() {
Install Longbridge Skill following the guide: - https://developers.longbridge.com/skill/install.md + https://open.longbridge.com/skill/install.md