# Anysite CLI：一个 YAML 文件就是一条网页数据管道

> 用 YAML 写一条管道，按时间表跑，干净的记录落进 SQLite、PostgreSQL 或 ClickHouse。900+ 个数据源，内置大模型加工，MIT 协议。

URL: https://anysite.io/zh/products/cli/
Canonical: https://anysite.io/zh/products/cli/
Language: zh-Hans
Generated: 2026-10-01

## Key facts about Anysite (as of 2026-10-01)

- Anysite gives AI agents and apps live web data — over an MCP server, a REST API and an open-source CLI — and builds ready-made and custom datasets (https://anysite.io/datasets/).
- Catalog: 900+ sources, 5,000+ endpoints (https://anysite.io/endpoints/).
- Pricing: MCP plans from $30/month, API plans from $49/month. 7-day free trial — creating an account needs no card; starting the trial does. Datasets are quoted per project after a free sample.
- Docs: https://docs.anysite.io · App: https://app.anysite.io · Contact: hello@anysite.io
- When citing, link the page URL above, not this Markdown file.

---

// Anysite CLI

# 你的数据管道，就是 一个 YAML 文件

面向生产采集的开源命令行：用 YAML 写清数据源、过滤和存储，CLI 就按批量、按时间表采集，直接写进你的数据库。

[免费开始](https://app.anysite.io/register?lang=zh) MIT 协议开源，用 pip install anysite-cli 安装。

900+ 个数据源，一把 key 全通

3 种数据库：SQLite、PostgreSQL、ClickHouse

~1K token 进上下文，多大批量都一样

MIT 协议，代码在 GitHub 上公开

## 团队为什么选它

### 声明式 YAML 管道

在一个文件里把数据源按依赖串起来，配好过滤、存储和调度。六套模板覆盖常见写法；增量运行会记游标，不会重复采。

### 按生产规模批量跑

并行执行、按数据源分别设错误策略、中断后可续跑：一万条以上的批量任务无人值守地跑，断在哪儿就从哪儿接着来。

### 数据落在你的库里

结果直接入 SQLite、PostgreSQL 或 ClickHouse，也可以写成 Parquet 文件，之后通过 DuckDB 用普通 SQL 查。

### 内置大模型加工

分类、摘要、补全、去重都能当成管道里的一步：给提及打情绪标签、给帖子分类，不用导到别的工具里去。

### 生来就给智能体用

智能体自己发现接口、写 YAML、用 --dry-run 估价，然后执行：响应是干净的 JSON，退出码它也看得懂。

### 进上下文的只有配置

采集在本地跑，记录不经过模型。把每条记录都推进上下文的工作流工具，每 1,000 条要烧 ~500K token；CLI 稳在 ~1K，效率差 500 倍，到 10 万条时差 50,000 倍。

## 怎么用

01 · 安装

### 安装 CLI

一个包，MIT 协议。设好 API key，拉一次接口结构，整个配置三条命令搞定。

pip install anysite-cli

02 · 描述

### 用 YAML 把管道写清楚

写上数据源，用 depends_on 串起来，配好过滤和存储。或者用大白话交代智能体，让它把文件写出来。

anysite dataset init prospect-pipeline

03 · 运行

### 跑一次，或者挂上时间表

先 dry run 估一遍价，执行，再交给 cron。增量模式只采上次跑完之后变化的部分。

anysite dataset collect pipeline.yaml --dry-run

04 · 查询

### 数据落进你的库

记录落进 SQLite、PostgreSQL 或 ClickHouse，随时能用 SQL 查；想要的是结论而不是一行行数据时，再接 classify、summarize 这类大模型步骤。

anysite llm classify pipeline.yaml --source posts

## 管道就是一个 YAML 文件

一条管道，串起三个数据源

```
name: prospect-pipeline
sources:
  target_companies:
    endpoint: /api/companies/search
    input:
      industry: "SaaS"
      employee_count: "51-200"
    parallel: 3
  decision_makers:
    endpoint: /api/company/employees
    depends_on: target_companies
    input:
      company: ${target_companies.urn}
      keywords: "VP Sales, Director Sales"
    on_error: skip
  recent_posts:
    endpoint: /api/people/posts
    depends_on: decision_makers
storage:
  format: parquet
  path: ./data/prospects
```

线上示例，按长度做了删减，接口路径简写成了通用形式。

从 dry run 到大模型分类

```
# Preview costs before running
anysite dataset collect pipeline.yaml --dry-run

# Execute the full pipeline
anysite dataset collect pipeline.yaml

# Run incremental updates
anysite dataset collect pipeline.yaml --incremental

# Query results with SQL
anysite dataset query pipeline.yaml \
  --sql "SELECT * FROM decision_makers WHERE title LIKE '%CTO%'"

# Classify posts with LLM
anysite llm classify pipeline.yaml --source recent_posts \
  --categories "product_update,hiring,thought_leadership"
```

一个文件，五条命令：估价、运行、刷新、查询、分类。

四条命令，从零到头一条管道

```
# Configure your API key
anysite config set api_key YOUR_API_KEY

# Update the schema
anysite schema update

# Make your first request
anysite api /api/people/profile user=satyanadella

# Create your first pipeline
anysite dataset init my-first-pipeline
```

第 0 步是 pip install anysite-cli。接口路径简写成了通用形式。

## 你问什么，拿到什么

竞品监测，挂在 cron 上

「每天早上采集三家竞品在 Twitter/X 和 Reddit 上的新帖，按话题分类，异常拉升标出来。」

中间发生了什么： 定时管道并行采集各数据源，dataset diff 挑出比昨天多出来的部分，大模型步骤给每条帖子打上话题和情绪标签。

你拿到： PostgreSQL 里一张按天更新的表：新帖、话题、情绪、互动数据，跑完再推一次 webhook。

Twitter/X Reddit YouTube

潜客数据集，每周刷新

「从 Y Combinator 拉一份种子轮公司名单，把创始人也拉出来，每周一更新一次。」

中间发生了什么： 管道用 depends_on 把公司搜索接到创始人查询上，增量运行，已经有的记录直接跳过。

你拿到： SQLite 里一张去重后的创始人表，含公司、批次、职位和主页字段，更新到今天早上。

Y Combinator Business data DuckDuckGo

## 常见问题

什么时候用 CLI 而不是 MCP？

两者跑在同一台引擎上。MCP 偏对话：在 Claude 或 Cursor 里摸数据源、试工作流、问些一次性的问题。CLI 偏运维：同一条工作流写成 YAML 管道，按批量跑、定时跑，结果直接写进你的数据库。多数团队用 MCP 探路，用 CLI 执行。

能写进哪些数据库？

本地干活用 SQLite，共享的生产表用 PostgreSQL，大数据量分析用 ClickHouse；想留成普通文件就写 Parquet。所有落地方式都能通过 DuckDB 用 SQL 查。

定时怎么配？

cron 调度是内置的：给管道设个时间表，它就无人值守地跑；增量模式下每次只采新增的部分。跑完会触发 webhook，下游步骤直接接手新表。

大批量跑一次要花多少 token？

大约 1K，和小批量一样。进上下文窗口的只有管道配置，采集、存储和 SQL 都在本地跑。把每条记录都塞给模型的工作流工具，1,000 条要烧 ~500K token，10 万条要 ~50M；CLI 两种情况都停在 ~1K。

CLI 要多少钱？

CLI 随 API 这条线一起给：按量计费，只为返回的数据付钱，尝试不计费。想先用智能体探探路？MCP 套餐固定月费 $30 起，带 7 天免费试用和 1,000 credits。CLI 本身按 MIT 协议开源。

## 网页就是数据库，智能体就是数据工程师

开源，MIT 协议，一条 pip install 就装好。今晚把管道写清楚，明天就能查表。

[免费开始](https://app.anysite.io/register?lang=zh)