@erdoai/cli

中文文档
0.237.0发布于 2026/11/14MITES Module近 30 天下载 2.2万

Erdo CLI — drive datasets, pages, and evals from the terminal or CI

原始使用文档
文档目录7 节
  1. Install
  2. Auth
  3. Datasets
  4. Agents & pages
  5. Evals
  6. Develop
  7. Release

@erdoai/cli

Erdo CLI — drive evals (and more) from the terminal or CI, over the same /v1 REST API the MCP tools use.

Install

npm install -g @erdoai/cli   # global; then run `erdo`
npx @erdoai/cli --help       # or run without installing
erdo update                  # self-update to the latest published version

Requires Node.js 22.13+. User-facing install docs: https://docs.erdo.ai/cli

When a newer version is published, every command prints one line on stderr naming the installed version and erdo update. It is on stderr so stdout stays clean JSON for scripts and agents, the published version is remembered on disk and re-checked about once a day, and an unreachable registry says nothing at all. Set ERDO_NO_UPDATE_NOTIFIER=1 to silence it. An old build's --help is correct about itself and wrong about the product — that is the failure this notice exists to stop.

Auth

Multi-account, like gh. Log in with an API key (created in Erdo); it's stored per account at ~/.config/erdo/config.json and tied to your active org.

erdo login                      # browser sign-in (mints + stores a token)
erdo login --key erdo_api_...   # headless/CI: paste an API key instead
erdo whoami                     # active account + org
erdo auth status                # all accounts (* = active)
erdo auth switch [email]        # switch active account (auto-toggles with two)
erdo logout [email]

erdo org list                   # your orgs (* = active)
erdo org use [id|slug]          # set the active org for this account
erdo --org acme eval suites     # one-off override for a single command

Env overrides for CI/scripting: ERDO_API_KEY, ERDO_ORG, ERDO_API_URL, ERDO_ACCOUNT.

Datasets

Two ways to read a dataset, and the difference matters.

datasets fetch is the read. You write the SQL, so the same command gives the same rows every time — use it for anything mechanical, scripted, or run by an agent. It answers with {columns, rows, row_count}.

erdo --org 2200-brickell datasets fetch 2200-brickell.page-events \
  --sql "SELECT event, count(*) FROM data GROUP BY 1 ORDER BY 2 DESC" --limit 20

erdo datasets fetch acme.leads --limit 50        # no SQL: just the rows
erdo datasets fetch acme.leads --filter <name>   # opt into a saved filter

The table is named data — for file datasets (CSV, Excel, and anything written by an event pipeline) that is the name regardless of the dataset's slug or resource key, and it is not guessable, so it is the first thing to get right. The columns aren't guessable either, so look before you write SQL:

erdo datasets schema acme.leads          # column names and types

datasets schema reads the stored table itself, so it shows the columns that are actually there — the ones fetch --sql can reference — rather than a declared schema that may lag what recent writes added. Database and warehouse datasets are queried through their real table names, which come from the dataset's schema. The SQL dialect is DuckDB. A dataset's default filters apply on every read; --filter <name> adds a saved filter on top, and narrows further — a named filter never bypasses a default. See erdo datasets filter list <slug> for the names a dataset offers.

datasets query is the natural-language wrapper. Erdo writes and runs the SQL for you, and answers with that SQL alongside the values, so it is the one to reach for when you don't yet know the shape of the data. It runs an agent, so it is slower and it is not deterministic — two identical questions can produce two different queries.

erdo --org 2200-brickell datasets query 2200-brickell.page-events \
  "which pages get the most views, and how many convert?"

A file dataset keeps the versions it overwrote. Its contents are stored, and each write that replaces them keeps the version it replaced, so an import that landed bad rows over good ones has not destroyed them. List the versions, then read one back with fetch — the same SQL you would run against the live table.

erdo datasets revisions acme.leads               # live version first, then superseded
erdo datasets fetch acme.leads --revision <id> \
  --sql "SELECT * FROM data"                     # query those older contents

The history is read-only: nothing here rolls a dataset back. Restoring means fetching the rows out of the old revision and writing them in again through the normal write path.

erdo datasets list                     # slug, type, status, class, name
erdo datasets upload ./leads.csv       # create a dataset from a file

Agents & pages

erdo agent ask "what was revenue last week?" --datasets sales
erdo threads create --name "landing build"       # -> thread id
erdo agent send <thread> "Build a landing page for ACME ..." --agent erdo.artifact-builder
erdo agent send <thread> "What should I do next?" --context "Current screen: checkout experiment"
erdo agent send <thread> "Summarize the existing data" --read-only

erdo pages deploy --title "ACME" --html @page.html --js @page.js --public
erdo pages list --type html_page
erdo pages get <artifact-id>

--html/--js/--css accept @path to read a file. Sending a message to a thread runs an agent — that's also how the artifact-builder produces a page from a brief. Use --read-only to limit the default erdo.data-question-answerer turn to read-only agent tools. Other agents are rejected, and the flag is omitted by default so existing sends retain their behavior.

erdo runs list --agent erdo.artifact-builder --status failed   # inspect agent runs
erdo runs get <run-id>

Evals

erdo eval suites                          # list suites (slug, agent, artifact?)
erdo eval suite landing-variations        # show a suite + its cases
erdo eval run landing-variations --watch  # run it and poll until done
erdo eval results <run-id>                # per-case scores + lenses
erdo eval runs --suite landing-variations # recent runs

# maintain the corpus
erdo eval case add landing-variations \
  --name "voice-concierge" \
  --input "Build a landing page for ACME with a voice concierge (agent id abc123) ..." \
  --rubric '[{"criterion":"voice widget loads and is on-brand","weight":2},{"criterion":"hero + form render correctly","weight":1}]'
erdo eval case rm landing-variations voice-concierge

--watch exits non-zero if the run doesn't complete cleanly, so it doubles as a CI gate.

Develop

npm install            # or yarn
npm run dev eval suites   # run from source (tsx)
npm run build:check       # typecheck
npm run build             # bundle to dist/ (bin: erdo)

Release

The version in cli/package.json is the release. Bump it in the same PR as the change (semver: feat → minor, fix → patch) and merge; .github/workflows/publish-cli.yml publishes whatever main says and tags the result. There is no tag to remember — forgetting one is how the CLI sat at npm 0.5.1 while package.json read 0.23.0 and every work-engine command was unreachable for anyone who installed it.

npm itself is the guard: an already-published version stops the job before it builds, so a cli/ change with no bump, a re-run, and a revert all no-op. A change under cli/ that ships no bump ships to nobody.

版本与发布记录

@erdoai/cli 共发布 236 个版本,首次发布于 2026/06/18;过去 12 个月发布了 236 个版本。

版本发布日期距今
0.237.0latest2026/11/14今天
0.236.02026/11/14今天
0.235.02026/11/13今天
0.234.02026/11/13今天
0.233.02026/11/131 天前
0.232.02026/11/131 天前

关于 @erdoai/cli 的常见问题

@erdoai/cli 是什么?

Erdo CLI — drive datasets, pages, and evals from the terminal or CI

如何安装 @erdoai/cli?

在项目目录运行 npm install @erdoai/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 erdo,可以用 npx erdo 直接运行。

@erdoai/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/erdoai__cli 是否存在。

@erdoai/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@erdoai/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^22.13.0 || >=23.5.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@erdoai/cli 可以商用吗?

@erdoai/cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@erdoai/cli 的下载量有多少?

根据 npm 官方下载统计,@erdoai/cli 在 2026/10/14 – 2026/11/12 这 30 天内被下载 22,166 次,日均约 739 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@erdoai/cli 还在维护吗?

最新版本 0.237.0 发布于 2026/11/14(今天);至今共发布 236 个版本,其中过去 12 个月发布了 236 个;首次发布于 2026/06/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。