> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firecrawl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 技能 + CLI

> Firecrawl 技能让 Claude Code、Antigravity 和 OpenCode 等 AI 代理能够通过 CLI 轻松使用 Firecrawl。

直接在终端中执行搜索、抓取、交互、爬取、Map，并运行代理任务。Firecrawl CLI 既可独立使用，也可结合技能；Claude Code、Antigravity 和 OpenCode 等 AI 编码代理可以自动发现并使用这些技能。

<div id="installation">
  ## 安装
</div>

如果你正在使用某个 AI 代理，例如 Claude Code，你可以安装下面的 Firecrawl 技能，代理将为你完成设置。

```bash theme={null}
npx -y firecrawl-cli@latest init --all --browser
```

* `--all` 会将每个 Firecrawl 技能分段 (CLI、构建、工作流) 安装到所有检测到的 AI 编码代理中
* `--browser` 会自动打开浏览器以完成 Firecrawl 身份验证

<Note>
  安装这些技能后，请重启你的代理，以便其发现它们。
</Note>

你也可以使用 npm 手动全局安装 Firecrawl CLI：

```bash CLI theme={null}
# 使用 npm 全局安装
npm install -g firecrawl-cli
```

<div id="authentication">
  ## 身份验证
</div>

使用 CLI 之前，您需要使用 Firecrawl API 密钥进行身份验证。

<Note>
  **某些 CLI 命令无需登录即可使用。** 如果未配置 API 密钥，受支持的命令会自动使用免密钥免费档位——免费，但会按 IP 限流。有关当前免密钥命令列表和注意事项，请参见[限流](/zh/rate-limits#keyless-no-api-key)。[注册获取免费密钥](https://firecrawl.dev)，即可获得 1,000 额度和更高限额；配置完成后，CLI 会自动使用它。
</Note>

<div id="login">
  ### 登录
</div>

```bash CLI theme={null}
# 交互式登录(打开浏览器或提示输入 API 密钥)
firecrawl login

# 使用浏览器身份验证登录(推荐用于代理)
firecrawl login --browser

# 直接使用 API 密钥登录
firecrawl login --api-key fc-YOUR-API-KEY

# 或通过环境变量设置
export FIRECRAWL_API_KEY=fc-YOUR-API-KEY
```

<div id="view-configuration">
  ### 查看配置
</div>

```bash CLI theme={null}
# 查看当前配置和身份验证状态
firecrawl view-config
```

<div id="logout">
  ### 退出登录
</div>

```bash CLI theme={null}
# 清除已存储的凭据
firecrawl logout
```

<div id="self-hosted-local-development">
  ### 自托管 / 本地开发
</div>

对于自托管的 Firecrawl 实例或本地开发，使用 `--api-url` 参数：

```bash CLI theme={null}
# 使用本地 Firecrawl 实例(无需 API 密钥)
firecrawl --api-url http://localhost:3002 scrape https://example.com

# Or set via environment variable
export FIRECRAWL_API_URL=http://localhost:3002
firecrawl scrape https://example.com

# Configure and persist the custom API URL
firecrawl config --api-url http://localhost:3002
```

当使用自定义 API URL (即不是 `https://api.firecrawl.dev`) 时，会自动跳过 API 密钥验证，因此你在本地实例中可以在无需 API 密钥的情况下使用 Firecrawl。

<div id="check-status">
  ### 检查状态
</div>

验证安装和身份验证，并查看速率限制：

```bash CLI theme={null}
firecrawl --status
```

就绪时的输出：

```
  🔥 firecrawl cli v1.16.2

  ● Authenticated via FIRECRAWL_API_KEY
  Concurrency: 0/100 jobs (parallel scrape limit)
  Credits: 500,000 remaining
```

* **并发数 (Concurrency) **：最大并行任务数。并行操作应尽量接近该上限，但不要超过。
* **额度 (Credits) **：剩余 API 额度。每次抓取/爬取都会消耗额度。

<div id="commands">
  ## 命令
</div>

<Note>
  隐藏的 `firecrawl browser` 命令已弃用，不再用于代理工作流。请先使用 `firecrawl scrape <url>`，再结合生成的抓取会话使用 `firecrawl interact ...`。
</Note>

<div id="scrape">
  ### Scrape
</div>

抓取单个 URL，并以多种 formats 输出其内容。

<Tip>
  使用 `--only-main-content` 即可获取不含导航栏、页脚和广告的干净输出。对于大多数只需要文章或主页面内容的用例，推荐使用该选项。
</Tip>

```bash CLI theme={null}
# 抓取 URL(默认:markdown 输出)
firecrawl https://example.com

# 或使用显式的 scrape 命令
firecrawl scrape https://example.com

# 推荐:使用 --only-main-content 获取不含导航/页脚的干净输出
firecrawl https://example.com --only-main-content
```

<div id="output-formats">
  #### 输出 formats 类型
</div>

```bash CLI theme={null}
# 获取 HTML 输出
firecrawl https://example.com --html

# 多种格式（返回 JSON）
firecrawl https://example.com --format markdown,links

# 获取页面中的图片
firecrawl https://example.com --format images

# 获取页面内容摘要
firecrawl https://example.com --format summary

# 跟踪页面变化
firecrawl https://example.com --format changeTracking

# 可用格式：markdown, html, rawHtml, links, screenshot, json, images, summary, changeTracking, attributes, branding, product
```

<div id="scrape-options">
  #### 抓取选项
</div>

```bash CLI theme={null}
# 仅提取主要内容(移除导航和页脚)
firecrawl https://example.com --only-main-content

# Wait for JavaScript rendering
firecrawl https://example.com --wait-for 3000

# Take a screenshot
firecrawl https://example.com --screenshot

# 使用 schema 提取结构化 JSON
firecrawl https://example.com --format json --schema '{"type":"object","properties":{"title":{"type":"string"}}}'

# 在提取前执行轻量级 scrape actions
firecrawl https://example.com --actions '[{"type":"wait","milliseconds":1000}]'

# 选择代理模式
firecrawl https://example.com --proxy basic

# 脱敏个人身份信息
firecrawl https://example.com --redact-pii

# Include/exclude specific HTML tags
firecrawl https://example.com --include-tags article,main
firecrawl https://example.com --exclude-tags nav,footer

# Save output to file
firecrawl https://example.com -o output.md

# Pretty print JSON output
firecrawl https://example.com --format markdown,links --pretty

# Force JSON output even with single format
firecrawl https://example.com --json

# Show request timing information
firecrawl https://example.com --timing
```

**可用选项：**

| 选项                       | 简写   | 描述                                                                                                                                               |
| ------------------------ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--url <url>`            | `-u` | 要抓取的 URL (位置参数的替代方式)                                                                                                                             |
| `--format <formats>`     | `-f` | 输出 formats (逗号分隔) ：`markdown`, `html`, `rawHtml`, `links`, `screenshot`, `json`, `images`, `summary`, `changeTracking`, `attributes`, `branding` |
| `--html`                 | `-H` | `--format html` 的快捷方式                                                                                                                            |
| `--only-main-content`    |      | 仅提取主要内容                                                                                                                                          |
| `--wait-for <ms>`        |      | 等待 JS 渲染的时间 (毫秒)                                                                                                                                 |
| `--screenshot`           |      | 生成页面截图                                                                                                                                           |
| `--full-page-screenshot` |      | 生成整页截图                                                                                                                                           |
| `--include-tags <tags>`  |      | 要包含的 HTML 标签 (逗号分隔)                                                                                                                              |
| `--exclude-tags <tags>`  |      | 要排除的 HTML 标签 (逗号分隔)                                                                                                                              |
| `--schema <json>`        |      | 用于结构化提取的 JSON schema                                                                                                                             |
| `--schema-file <path>`   |      | JSON schema 文件路径                                                                                                                                 |
| `--actions <json>`       |      | 抓取期间要执行的 JSON actions 数组                                                                                                                         |
| `--actions-file <path>`  |      | JSON actions 文件路径                                                                                                                                |
| `--proxy <proxy>`        |      | 抓取使用的代理模式 (例如 `auto` 或 `basic`)                                                                                                                  |
| `--redact-pii`           |      | 对返回内容中的个人身份识别信息进行脱敏处理                                                                                                                            |
| `--output <path>`        | `-o` | 将输出保存到文件                                                                                                                                         |
| `--json`                 |      | 即使只有单一 format 也强制输出 JSON                                                                                                                         |
| `--pretty`               |      | 对 JSON 输出进行格式化打印                                                                                                                                 |
| `--timing`               |      | 显示请求耗时和其他有用信息                                                                                                                                    |

***

<div id="search">
  ### 搜索
</div>

搜索网页，并按需抓取结果。

```bash CLI theme={null}
# 搜索网络
firecrawl search "web scraping tutorials"

# 限制结果数量
firecrawl search "AI news" --limit 10

# 美化打印结果
firecrawl search "machine learning" --pretty
```

<div id="search-options">
  #### 搜索选项
</div>

```bash CLI theme={null}
# Search specific sources
firecrawl search "AI" --sources web,news,images

# Search with category filters
firecrawl search "react hooks" --categories github
firecrawl search "machine learning" --categories research,pdf

# Time-based filtering
firecrawl search "tech news" --tbs qdr:h   # Last hour
firecrawl search "tech news" --tbs qdr:d   # Last day
firecrawl search "tech news" --tbs qdr:w   # Last week
firecrawl search "tech news" --tbs qdr:m   # 过去一个月
firecrawl search "tech news" --tbs qdr:y   # Last year

# Location-based search
firecrawl search "restaurants" --location "Berlin,Germany" --country DE

# Search and scrape results
firecrawl search "documentation" --scrape --scrape-formats markdown

# Save to file
firecrawl search "firecrawl" --pretty -o results.json
```

**可用选项：**

| 选项                           | 描述                                                                    |
| ---------------------------- | --------------------------------------------------------------------- |
| `--limit <number>`           | 结果数量上限 (默认：5，最大：100)                                                  |
| `--sources <sources>`        | 要搜索的数据源：`web`、`images`、`news` (逗号分隔)                                  |
| `--categories <categories>`  | 按类别过滤：`github`、`research`、`pdf` (逗号分隔)                                |
| `--tbs <value>`              | 时间过滤：`qdr:h` (小时) 、`qdr:d` (天) 、`qdr:w` (周) 、`qdr:m` (月) 、`qdr:y` (年) |
| `--location <location>`      | 地域定向 (例如："Berlin,Germany")                                            |
| `--country <code>`           | ISO 国家代码 (默认：US)                                                      |
| `--timeout <ms>`             | 以毫秒为单位的超时时间 (默认：60000)                                                |
| `--ignore-invalid-urls`      | 排除对其他 Firecrawl 端点无效的 URL                                             |
| `--scrape`                   | 抓取搜索结果                                                                |
| `--scrape-formats <formats>` | 抓取内容的 formats (默认：markdown)                                           |
| `--only-main-content`        | 抓取时仅包含主要内容 (默认：true)                                                  |
| `--json`                     | 以 JSON 格式输出                                                           |
| `--output <path>`            | 将输出保存到文件                                                              |
| `--pretty`                   | 以易读格式打印 JSON 输出                                                       |

***

<div id="map">
  ### Map
</div>

快速发现站点中的所有 URL。

```bash CLI theme={null}
# 发现网站上的所有 URL
firecrawl map https://example.com

# Output as JSON
firecrawl map https://example.com --json

# Limit number of URLs
firecrawl map https://example.com --limit 500
```

<div id="map-options">
  #### Map 命令选项
</div>

```bash CLI theme={null}
# Filter URLs by search query
firecrawl map https://example.com --search "blog"

# Include subdomains
firecrawl map https://example.com --include-subdomains

# 控制站点地图使用方式
firecrawl map https://example.com --sitemap include   # 使用站点地图
firecrawl map https://example.com --sitemap skip      # 跳过站点地图
firecrawl map https://example.com --sitemap only      # 仅使用站点地图

# Ignore query parameters (dedupe URLs)
firecrawl map https://example.com --ignore-query-parameters

# Wait for map to complete with timeout
firecrawl map https://example.com --wait --timeout 60

# Save to file
firecrawl map https://example.com -o urls.txt
firecrawl map https://example.com --json --pretty -o urls.json
```

**可用选项：**

| 选项                          | 描述                                   |
| --------------------------- | ------------------------------------ |
| `--url <url>`               | 要进行 Map 的 URL (可替代位置参数)              |
| `--limit <number>`          | 要发现的最大 URL 数量                        |
| `--search <query>`          | 根据搜索查询筛选 URL                         |
| `--sitemap <mode>`          | Sitemap 处理模式：`include`、`skip`、`only` |
| `--include-subdomains`      | 包含子域名                                |
| `--ignore-query-parameters` | 将带有不同参数的 URL 视为同一 URL                |
| `--wait`                    | 等待 Map 完成                            |
| `--timeout <seconds>`       | 超时时间 (秒)                             |
| `--json`                    | 以 JSON 格式输出                          |
| `--output <path>`           | 将输出保存到文件                             |
| `--pretty`                  | 以易读格式打印 JSON 输出                      |

***

<div id="interact">
  ### 交互
</div>

先抓取网页，然后使用自然语言或代码与页面交互。交互默认使用最近一次抓取的结果，也可以传入指定的抓取 ID。

```bash CLI theme={null}
# 1. 抓取 Amazon 首页（scrape ID 自动保存）
firecrawl scrape https://www.amazon.com

# 2. 交互 — 搜索商品并获取价格
firecrawl interact "Search for iPhone 16 Pro Max"
firecrawl interact "Click on the first result and tell me the price"

# 3. 停止会话
firecrawl interact stop
```

**可用选项：**

| 选项                     | 描述                             |
| ---------------------- | ------------------------------ |
| `-p, --prompt <text>`  | AI prompt (可替代位置参数)            |
| `-c, --code <code>`    | 在当前页面会话中执行代码                   |
| `-s, --scrape-id <id>` | 抓取任务 ID (默认：最近一次抓取)            |
| `--python`             | 以 Python/Playwright 执行代码       |
| `--node`               | 以 Node.js/Playwright 执行代码 (默认) |
| `--bash`               | 以 Bash 执行代码                    |
| `--timeout <seconds>`  | 超时时间 (秒)  (1-300，默认：30)        |
| `--output <path>`      | 将输出保存到文件                       |
| `--json`               | 以 JSON 格式输出                    |

***

<div id="crawl">
  ### Crawl
</div>

从单个 URL 出发爬取整个网站。

```bash CLI theme={null}
# Start a crawl (returns job ID immediately)
firecrawl crawl https://example.com

# Wait for crawl to complete
firecrawl crawl https://example.com --wait

# 等待并显示进度指示器
firecrawl crawl https://example.com --wait --progress
```

<div id="check-crawl-status">
  #### 查看抓取状态
</div>

```bash CLI theme={null}
# 使用作业 ID 检查爬取状态
firecrawl crawl <job-id>

# 真实作业 ID 示例
firecrawl crawl 550e8400-e29b-41d4-a716-446655440000
```

<div id="crawl-options">
  #### Crawl 选项
</div>

```bash CLI theme={null}
# Limit crawl depth and pages
firecrawl crawl https://example.com --limit 100 --max-depth 3 --wait

# Include only specific paths
firecrawl crawl https://example.com --include-paths /blog,/docs --wait

# Exclude specific paths
firecrawl crawl https://example.com --exclude-paths /admin,/login --wait

# Include subdomains
firecrawl crawl https://example.com --allow-subdomains --wait

# Crawl entire domain
firecrawl crawl https://example.com --crawl-entire-domain --wait

# Rate limiting
firecrawl crawl https://example.com --delay 1000 --max-concurrency 2 --wait

# 将爬取选项传递给每个已爬取的页面
firecrawl crawl https://example.com --scrape-options '{"formats":["markdown"],"onlyMainContent":true}'

# 将爬取完成事件发送到 webhook
firecrawl crawl https://example.com --webhook '{"url":"https://example.com/webhook","events":["completed"]}'

# 取消正在进行的爬取任务
firecrawl crawl <job-id> --cancel

# 自定义轮询间隔和超时时间
firecrawl crawl https://example.com --wait --poll-interval 10 --timeout 300

# Save results to file
firecrawl crawl https://example.com --wait --pretty -o results.json
```

**可用选项：**

| 选项                             | 描述                                   |
| ------------------------------ | ------------------------------------ |
| `--url <url>`                  | 要爬取的 URL (位置参数的替代方式)                 |
| `--wait`                       | 等待爬取完成                               |
| `--progress`                   | 等待期间显示进度指示器                          |
| `--poll-interval <seconds>`    | 轮询间隔 (默认：5 秒)                        |
| `--timeout <seconds>`          | 等待时的超时时长                             |
| `--status`                     | 检查已有爬取任务的状态                          |
| `--limit <number>`             | 最大爬取页面数                              |
| `--max-depth <number>`         | 最大爬取深度                               |
| `--include-paths <paths>`      | 要包含的路径 (逗号分隔)                        |
| `--exclude-paths <paths>`      | 要排除的路径 (逗号分隔)                        |
| `--sitemap <mode>`             | Sitemap 处理方式：`include`、`skip`、`only` |
| `--allow-subdomains`           | 包含子域名                                |
| `--allow-external-links`       | 跟随外部链接                               |
| `--crawl-entire-domain`        | 爬取整个域名                               |
| `--ignore-query-parameters`    | 将具有不同参数的 URL 视为相同                    |
| `--delay <ms>`                 | 请求之间的延迟                              |
| `--max-concurrency <n>`        | 最大并发请求数                              |
| `--scrape-options <json>`      | 传递给每个页面的 JSON 抓取选项                   |
| `--scrape-options-file <path>` | 抓取选项 JSON 文件路径                       |
| `--webhook <url-or-json>`      | Webhook URL 或配置                      |
| `--cancel`                     | 通过 job ID 取消活动中的爬取任务                 |
| `--output <path>`              | 将输出保存到文件                             |
| `--pretty`                     | 以更易读的格式输出 JSON                       |

***

<div id="monitor">
  ### 监控
</div>

创建周期性抓取或爬取任务，并将每次运行结果与上一次快照进行差异比对。当你希望 Firecrawl 判断哪些页面变化对你的用例真正有意义时，可添加目标。

```bash CLI theme={null}
firecrawl monitor create --name "Hacker News AI" \
  --schedule "every 30 minutes" \
  --goal "Alert when a new Hacker News story related to AI enters the top 10. Ignore changes to stories that are not about AI. Do not alert on changes outside the top 10." \
  --page https://news.ycombinator.com

firecrawl monitor run <monitorId>
firecrawl monitor checks <monitorId> --limit 10
firecrawl monitor check <monitorId> <checkId> --page-status changed
firecrawl monitor update <monitorId> \
  --goal "Alert when a new Hacker News story related to AI enters the top 10. Do not alert on changes outside the top 10."
firecrawl monitor delete <monitorId>
```

监控目标应简短，并忠实反映用户意图：说明什么情况应触发告警，重述已说明的范围，并且仅在排除条件显而易见或被明确要求时才写出。如果用户要求“任何变化”，请保持目标宽泛。

**可用选项：**

| Option                    | Description                              |
| ------------------------- | ---------------------------------------- |
| `--name <name>`           | 监控名称                                     |
| `--goal <goal>`           | 用于判断是否为有意义变更的目标                          |
| `--cron <expression>`     | Cron 调度表达式，例如 `*/30 * * * *`             |
| `--schedule <text>`       | 自然语言调度，例如 `hourly`                       |
| `--timezone <tz>`         | 调度时区，默认 `UTC`                            |
| `--page <url>`            | 每次检查时要抓取的单个页面 URL                        |
| `--scrape-urls <list>`    | 每次检查时要抓取的页面 URL，多个值以逗号分隔                 |
| `--crawl-url <url>`       | 爬取目标的根 URL                               |
| `--webhook-url <url>`     | Webhook 接收地址                             |
| `--webhook-events <list>` | 以逗号分隔的监控事件列表                             |
| `--email <list>`          | 以逗号分隔的电子邮件收件人                            |
| `--retention-days <n>`    | 快照保留时长                                   |
| `--page-status <state>`   | 在 `monitor check` 时按状态筛选页面               |
| `--state <state>`         | 在 `monitor update` 时设置监控状态：active/paused |

***

<div id="agent">
  ### Agent
</div>

使用自然语言指令在网上搜索和获取数据。

```bash CLI theme={null}
# 基本用法 - URL 是可选的
firecrawl agent "Find the top 5 AI startups and their funding amounts" --wait

# 聚焦特定 URL
firecrawl agent "Compare pricing plans" --urls https://slack.com/pricing,https://teams.microsoft.com/pricing --wait

# 使用 schema 实现结构化输出
firecrawl agent "Get company information" --urls https://example.com --schema '{"type":"object","properties":{"name":{"type":"string"},"founded":{"type":"number"}}}' --wait

# 从文件加载 schema
firecrawl agent "Get product details" --urls https://example.com --schema-file schema.json --wait
```

<div id="agent-options">
  #### 代理 选项
</div>

```bash CLI theme={null}
# 使用 Spark 1 Pro 提高准确性
firecrawl agent "Competitive analysis across multiple domains" --model spark-1-pro --wait

# Set max credits to limit costs
firecrawl agent "Gather contact information from company websites" --max-credits 100 --wait

# Check status of an existing job
firecrawl agent <job-id> --status

# 将代理事件发送到 webhook
firecrawl agent "Extract product details" --urls https://example.com --webhook '{"url":"https://example.com/webhook","events":["completed","failed"]}'

# 取消活跃的代理任务
firecrawl agent <job-id> --cancel

# Custom polling interval and timeout
firecrawl agent "Summarize recent blog posts" --wait --poll-interval 10 --timeout 300

# Save output to file
firecrawl agent "Find pricing information" --urls https://example.com --wait -o pricing.json --pretty
```

**可用选项：**

| 选项                          | 说明                                                       |
| --------------------------- | -------------------------------------------------------- |
| `--urls <urls>`             | 可选的 URL 列表，用于限定代理的处理范围 (用逗号分隔)                           |
| `--model <model>`           | 使用的模型：`spark-1-mini` (默认，成本低 60%) 或 `spark-1-pro` (精度更高) |
| `--schema <json>`           | 用于结构化输出的 JSON schema (内联 JSON 字符串)                       |
| `--schema-file <path>`      | 用于结构化输出的 JSON schema 文件路径                                |
| `--max-credits <number>`    | 最多可消耗的额度 (达到上限时任务失败)                                     |
| `--webhook <url-or-json>`   | Webhook URL 或配置                                          |
| `--status`                  | 检查已有代理任务的状态                                              |
| `--cancel`                  | 通过任务 ID 取消正在运行的代理任务                                      |
| `--wait`                    | 等待代理任务完成后再返回结果                                           |
| `--poll-interval <seconds>` | 等待时的轮询间隔 (默认：5)                                          |
| `--timeout <seconds>`       | 等待时的超时时间 (默认：无限制)                                        |
| `--output <path>`           | 将输出保存到文件                                                 |
| `--json`                    | 以 JSON 格式输出                                              |

***

<div id="credit-usage">
  ### 额度使用情况
</div>

查看你团队的额度余额和使用明细。

```bash CLI theme={null}
# View credit usage
firecrawl credit-usage

# 以 JSON 格式输出
firecrawl credit-usage --json --pretty
```

***

<div id="version">
  ### Version
</div>

显示 CLI 的版本。

```bash CLI theme={null}
firecrawl version
# 或
firecrawl --version
```

<div id="global-options">
  ## 全局选项
</div>

以下选项适用于所有命令：

| 选项                | 简写   | 说明                         |
| ----------------- | ---- | -------------------------- |
| `--status`        |      | 显示版本、认证状态、并发数和额度           |
| `--api-key <key>` | `-k` | 在此命令中临时覆盖已保存的 API 密钥       |
| `--api-url <url>` |      | 使用自定义 API URL (用于自托管/本地开发) |
| `--help`          | `-h` | 显示命令帮助信息                   |
| `--version`       | `-V` | 显示 CLI 版本                  |

<div id="output-handling">
  ## 输出处理
</div>

CLI 默认将结果输出到 stdout，便于通过管道或重定向进行处理：

```bash CLI theme={null}
# 将 Markdown 通过管道传递给另一个命令
firecrawl https://example.com | head -50

# 重定向到文件
firecrawl https://example.com > output.md

# 保存格式化后的 JSON
firecrawl https://example.com --format markdown,links --pretty -o data.json
```

<div id="format-behavior">
  ### formats 的行为
</div>

* **单一 format**：输出原始内容 (markdown 文本、HTML 等)
* **多个 formats**：输出包含所有请求数据的 JSON

```bash CLI theme={null}
# 原始 markdown 输出
firecrawl https://example.com --format markdown

# 使用多个 formats 的 JSON 输出
firecrawl https://example.com --format markdown,links
```

<div id="examples">
  ## 示例
</div>

<div id="quick-scrape">
  ### 快速抓取
</div>

```bash CLI theme={null}
# 从 URL 获取 Markdown 内容(使用 --only-main-content 获取简洁输出)
firecrawl https://docs.firecrawl.dev --only-main-content

# Get HTML content
firecrawl https://example.com --html -o page.html
```

<div id="full-site-crawl">
  ### 整站爬取
</div>

```bash CLI theme={null}
# 爬取文档站点并设置限制
firecrawl crawl https://docs.example.com --limit 50 --max-depth 2 --wait --progress -o docs.json
```

<div id="site-discovery">
  ### 站点发现
</div>

```bash CLI theme={null}
# 查找所有博客文章
firecrawl map https://example.com --search "blog" -o blog-urls.txt
```

<div id="research-workflow">
  ### 研究工作流
</div>

```bash CLI theme={null}
# 搜索并抓取结果用于研究
firecrawl search "machine learning best practices 2024" --scrape --scrape-formats markdown --pretty
```

### 智能体

```bash CLI theme={null}
# URL 可选
firecrawl agent "Find the top 5 AI startups and their funding amounts" --wait

# 针对特定 URL
firecrawl agent "Compare pricing plans" --urls https://slack.com/pricing,https://teams.microsoft.com/pricing --wait
```

<div id="combine-with-other-tools">
  ### 与其他工具结合使用
</div>

```bash CLI theme={null}
# Extract URLs from search results
jq -r '.data.web[].url' search-results.json

# Get titles from search results
jq -r '.data.web[] | "\(.title): \(.url)"' search-results.json

# 提取链接并使用 jq 处理
firecrawl https://example.com --format links | jq '.links[].url'

# Count URLs from map
firecrawl map https://example.com | wc -l
```

<div id="telemetry">
  ## 遥测
</div>

CLI 在身份验证过程中会收集匿名使用数据，以帮助改进产品：

* CLI 版本、操作系统和 Node.js 版本
* 检测到的开发工具 (例如 Cursor、VS Code、Claude Code)

**CLI 不会收集任何命令数据、URL 或文件内容。**

如需禁用遥测，请设置以下环境变量：

```bash CLI theme={null}
export FIRECRAWL_NO_TELEMETRY=1
```

<div id="open-source">
  ## 开源
</div>

Firecrawl CLI 和全部三个技能分段都已开源，并可在 GitHub 上获取：

* [`firecrawl/cli`](https://github.com/firecrawl/cli) — CLI 和 CLI 技能 (实时网页工作)
* [`firecrawl/skills`](https://github.com/firecrawl/skills) — 构建技能 (将 Firecrawl 集成到应用程序代码中)
* [`firecrawl/firecrawl-workflows`](https://github.com/firecrawl/firecrawl-workflows) — 工作流技能 (可重复生成的交付成果，例如研究简报、SEO 审计、潜在客户列表和设计克隆)

> 你是需要 Firecrawl API 密钥的 AI 代理吗？请参见 [firecrawl.dev/agent-onboarding/SKILL.md](https://www.firecrawl.dev/agent-onboarding/SKILL.md) 获取自动化入门说明。
