浏览文档
开始使用
从终端或 AI 智能体搜索 Google、获取 YouTube 数据及交付媒体。一个可执行文件,无需 Node.js 或 Python。
本页内容
1. 安装
选择平台。原生程序不需要 Node.js 或 Python。在可写目录运行命令;独立下载会校验哈希。
Bash · 先运行 uname -m。x86_64 使用此版本;下方提供 ARM64 及包管理器选项。
# Run in Bash, in a writable parent directory.
(
set -eu
mkdir "flashdata-cli-1.2.1"
cd "flashdata-cli-1.2.1"
curl --fail --show-error --location 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/flashdata_1.2.1_linux_amd64.tar.gz' -o 'flashdata_1.2.1_linux_amd64.tar.gz'
curl --fail --show-error --location 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/SHA256SUMS' -o SHA256SUMS
grep ' flashdata_1.2.1_linux_amd64.tar.gz$' SHA256SUMS | sha256sum -c -
tar -xzf 'flashdata_1.2.1_linux_amd64.tar.gz'
chmod +x flashdata
./flashdata --version
) &&
export PATH="$PWD/flashdata-cli-1.2.1:$PATH" &&
flashdata --version# Run in PowerShell, in a writable parent directory.
& {
$ErrorActionPreference = 'Stop'
$archive = 'flashdata_1.2.1_windows_amd64.zip'
$installDir = Join-Path (Get-Location) 'flashdata-cli-1.2.1'
if (Test-Path -LiteralPath $installDir) { throw 'Directory exists; choose a fresh parent directory.' }
New-Item -ItemType Directory -Path $installDir | Out-Null
Invoke-WebRequest 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/flashdata_1.2.1_windows_amd64.zip' -OutFile (Join-Path $installDir $archive)
Invoke-WebRequest 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/SHA256SUMS' -OutFile (Join-Path $installDir 'SHA256SUMS')
$entry = Get-Content (Join-Path $installDir 'SHA256SUMS') | Where-Object { $_.EndsWith(' ' + $archive) }
if (@($entry).Count -ne 1) { throw 'Archive checksum entry missing or ambiguous.' }
$expected = ($entry -split '\s+')[0]
$actual = (Get-FileHash (Join-Path $installDir $archive) -Algorithm SHA256).Hash
if ($actual -ne $expected) { throw 'Checksum mismatch; stop installation.' }
Expand-Archive -LiteralPath (Join-Path $installDir $archive) -DestinationPath $installDir
$env:PATH = $installDir + [IO.Path]::PathSeparator + $env:PATH
& (Join-Path $installDir 'flashdata.exe') --version
}其他安装方式
独立安装命令仅设置当前终端 PATH。后续会话请将解压目录加入用户 PATH,或使用可执行文件绝对路径。
# Run in Bash, in a writable parent directory.
(
set -eu
mkdir "flashdata-cli-1.2.1"
cd "flashdata-cli-1.2.1"
curl --fail --show-error --location 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/flashdata_1.2.1_linux_arm64.tar.gz' -o 'flashdata_1.2.1_linux_arm64.tar.gz'
curl --fail --show-error --location 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/SHA256SUMS' -o SHA256SUMS
grep ' flashdata_1.2.1_linux_arm64.tar.gz$' SHA256SUMS | sha256sum -c -
tar -xzf 'flashdata_1.2.1_linux_arm64.tar.gz'
chmod +x flashdata
./flashdata --version
) &&
export PATH="$PWD/flashdata-cli-1.2.1:$PATH" &&
flashdata --version# Run in Bash, in a writable parent directory.
(
set -eu
mkdir "flashdata-cli-1.2.1"
cd "flashdata-cli-1.2.1"
curl --fail --show-error --location 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/flashdata_1.2.1_darwin_amd64.tar.gz' -o 'flashdata_1.2.1_darwin_amd64.tar.gz'
curl --fail --show-error --location 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/SHA256SUMS' -o SHA256SUMS
grep ' flashdata_1.2.1_darwin_amd64.tar.gz$' SHA256SUMS | shasum -a 256 -c -
tar -xzf 'flashdata_1.2.1_darwin_amd64.tar.gz'
chmod +x flashdata
./flashdata --version
) &&
export PATH="$PWD/flashdata-cli-1.2.1:$PATH" &&
flashdata --version# Run in Bash, in a writable parent directory.
(
set -eu
mkdir "flashdata-cli-1.2.1"
cd "flashdata-cli-1.2.1"
curl --fail --show-error --location 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/flashdata_1.2.1_darwin_arm64.tar.gz' -o 'flashdata_1.2.1_darwin_arm64.tar.gz'
curl --fail --show-error --location 'https://github.com/flashdatadev/flashdata-cli/releases/download/v1.2.1/SHA256SUMS' -o SHA256SUMS
grep ' flashdata_1.2.1_darwin_arm64.tar.gz$' SHA256SUMS | shasum -a 256 -c -
tar -xzf 'flashdata_1.2.1_darwin_arm64.tar.gz'
chmod +x flashdata
./flashdata --version
) &&
export PATH="$PWD/flashdata-cli-1.2.1:$PATH" &&
flashdata --version2. 配置访问
选择一种方式。以下命令使用默认配置;搜索与认领时继续使用同一配置。
创建或复用具有 Google 搜索权限的密钥,在 login 隐藏输入提示中粘贴。
flashdata auth login
flashdata auth status在项目目录运行并选择 Codex、Claude Code 或 Cursor。Setup 安装 16 个技能,复用访问或申请一次符合资格的试用,不执行付费查询。自动化智能体可使用 --agent codex --non-interactive(替换为实际支持的宿主)。
flashdata setup
flashdata auth status无需安装智能体技能即可开始一次符合资格的试用。默认申请 Google 搜索与 YouTube 元数据。已有有效访问时直接复用。
flashdata init --name "My CLI"
flashdata auth status3. 执行首次搜索
此命令发送一次 Google 搜索,最多请求五条结果,并输出响应。
flashdata search "battery recycling research" --num 5预期结果
检查 ok: true 及 data.status: done。通过 data.results[].organic 读取标题与 URL,通过 data.usage.credits 查看扣费。示例(精简):
{
"schemaVersion": 1,
"ok": true,
"cached": false,
"data": {
"status": "done",
"results": [
{
"organic": [
{
"title": "Battery recycling research",
"link": "https://example.org/recycling",
"snippet": "An example search excerpt."
}
]
}
],
"usage": {
"credits": 0.02
}
}
}更多 CLI 任务
选择下方任务。查询使用所连接密钥的来源权限及 Credits。切换任务前检查密钥允许的来源;下载需要所有者访问。
按结果数量、语言及国家场景查找网页。
flashdata search "battery recycling research" --num 5 --hl en --gl us --json先搜索候选视频,再将一个返回的视频 ID 用于 metadata 或 transcript。每条命令是独立查询,请将示例 ID 替换为选定视频。
flashdata youtube search "battery recycling" --max-results 5 --jsonflashdata youtube metadata FUfGcZ092b0 --jsonflashdata youtube transcript FUfGcZ092b0 --language en --json使用具有 youtube_download 权限的所有者密钥。按下方私有文件指南准备包含目标存储设置的私有 storage.json。替换为你有权处理的视频 ID。命令等待后台任务并保存交付记录,而非媒体文件。
flashdata youtube download FUfGcZ092b0 --format mp3 --storage-config storage.json --wait --output delivery.json --json检查价格、余额及可用来源,不提交查询。
flashdata account balance
flashdata account pricing --source google_search --request-count 1
flashdata sources list查询前预览成本
以下命令读取余额与估价,不执行搜索。检查 data.estimateAvailable,并比较估价与可用 Credits。
flashdata account balance
flashdata search "battery recycling research" --num 5 --dry-run --json用于脚本与智能体
执行另一次预期搜索时,选择新的运行 ID 及输出文件名。已有文件不会被覆盖。运行中断后,先检查已有记录,再决定是否重发。
| 选项 | 用途 |
|---|---|
| --json | 机器可读执行回执;使用 --output 时,data 描述保存文件。 |
| --non-interactive | 禁用提示及浏览器打开。 |
| --output FILE | 将来源响应保存到新文件。 |
| --run-id ID | 标识一次预期运行并复用其已保存结果。 |
| --help | 显示任意命令的语法与参数。 |
flashdata search "battery recycling research" --accept text/plain --respond-with markdown --json=false