cli-e2e-tests

A set of end-to-end testing rules for a command-line application. End-to-end tests run the product through realistic command flows, while a monorepo is one repository containing several related packages.

In plain words
What is it for?
It helps organize shared test infrastructure, command tests, user-journey tests, smoke tests for available command paths, and runtime checks across the listed packages.
Why use it?
It keeps tests in the correct package layers and prevents product code from depending on test-only code. It also defines which command changes require tests and how live tests are gated.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/modelstudioai/cli/cli-e2e-tests
Clone the repo
git clone --depth 1 https://github.com/modelstudioai/cli
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,553 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02553
Opus 5 $0.00000 $0.01277
Sonnet 5 $0.00000 $0.00511
Haiku 4.5 $0.00000 $0.00255

Measured 2d ago against content hash 12e4315759c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli-e2e-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/cli-e2e-tests.md · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLI E2E 测试规范

架构分层

层级 路径 测什么
共享基建 packages/e2e gating、子进程 runner、output、globalSetup(private,不发布)
命令 E2E packages/commands/tests/e2e help、缺参、dry-run、live(gated);每用例最小路由
Journey E2E packages/commands/tests/e2e/knowledge/journeys 用户旅程全链路(跨命令回路 + 标记词召回闭环),全部 live gated;见 journeys/README.md
bl smoke packages/cli/tests/e2e/registry.smoke.e2e.test.ts 产品 map 全部 path --help、分组 help、根 help
kscli smoke packages/kscli/tests/e2e/registry.smoke.e2e.test.ts kscli/src/commands.ts 推导 path/分组;identity(--versionsearch --help path)
runtime packages/runtime/tests proxy.e2e、console 跨域 flag 拒绝

依赖边界e2ecorecommands/testse2e + commands/src;产品 tests → e2e + 各自 src禁止产品 import commands/tests/**(子进程 spawn harness 路径除外)。

触发条件

  • 新增/修改 packages/commands/src/commands 下的 command 实现
  • 新增/修改 packages/cli/src/commands.tsbl 命令路径 map
  • 新建或扩展 packages/commands/tests/e2e/<topic>.e2e.test.ts
  • 新增 bl 产品 path → registry.smoke 自动覆盖 leaf path;commands topic 测试在 topic-routes.ts 补最小路由

跑测与环境变量见 .cursor/skills/bailian-cli-e2e/SKILL.md

规则:共享 command 行为在 commands/tests/e2e;产品 map、identity、CLI-only 命令留在对应产品 tests/e2e

文件与工具

commands E2E

  • 路径:packages/commands/tests/e2e/<kebab-topic>.e2e.test.ts;knowledge 领域集中在 packages/commands/tests/e2e/knowledge/ 子目录(新增 knowledge 命令测试放这里)
  • 子进程:runCommandE2e(routes, args) from ./helpers.ts(spawn harness/main.tsroutes 为本 topic 最小 path → export 映射)
  • fixtures:packages/commands/tests/e2e/fixtures/
  • 路由常量:topic-routes.ts(按 topic 维护,全量产品 map)

Read the full file on GitHub · 155 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 155 lines · 0 tokens per session scan A 12e4315759c3

Subscribe to this mod's changes

cli-e2e-tests is an agent published in the GitHub repository modelstudioai/cli (320 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,553 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.