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.
npx agentmods add agents/modelstudioai/cli/command-flag-changegit clone --depth 1 https://github.com/modelstudioai/cliWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00859 |
| Opus 5 | $0.00000 | $0.00430 |
| Sonnet 5 | $0.00000 | $0.00172 |
| Haiku 4.5 | $0.00000 | $0.00086 |
Grade A, and why
command-flag-change 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 yesterday.
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.
What it actually says
命令选项变更
触发条件
- 给已有命令新增
--flag <value> - 改 flag 默认值
- 删除 / 重命名已有 flag
- 把 flag 从可选变成必填(或反向)
必查清单
A. 命令文件本身
-
packages/commands/src/commands/<group>/<action>.ts:defineCommand({ flags: { ... } })里增删/改 camelCase flag key 与{ type, valueHint, description, required }usageArgs字段只写参数片段(如"--message <text> [flags]"),不写bl <path>exampleArgs数组覆盖新 flag 至少一个示例,同样不写 bin/path 前缀run()里只从ctx.flags读取本命令 flag,从ctx.settings读取全局/config 解析结果- 类型由
ParsedFlags<typeof FLAGS>推导;避免手写flags.x as number这类断言 - 单 flag 必填用
required: true;跨 flag / 值相关校验放validate - 默认值 fallback 写在命令实现或
Settings解析层,不要重复解析 env/config
B. 鉴权 / 全局选项
- 如果是全局 flag(所有命令通用),改
packages/core/src/types/command.ts的GLOBAL_FLAGS - 如果是凭证域 flag,优先确认是否属于
MODEL_AUTH_FLAGS或CONSOLE_AUTH_FLAGS;不要在单个命令里重复声明 - 如果新 flag 影响有效配置面,改
packages/core/src/config/schema.ts的Settings接口 - 如果对应 env var 或 config 文件字段,改
packages/core/src/config/loader.ts的buildSettings
C. 文档层
-
README.md/README.zh.md如果在示例里展示了相关命令,补充新 flag - 跑
pnpm --filter bailian-cli run generate:reference,让各skills/<skill>/reference/与命令一致(勿手改;改完提交)
D. 测试层
- 按 cli-e2e-tests.md 在
packages/cli/tests/e2e/<command>.e2e.test.ts增加新 flag 的断言(含缺参、--help、dry-run 若适用) - 删除 flag 时,清掉相关测试用例
E. 重命名特殊处理
- 全仓 grep 旧 flag 名(包括
--old-name、oldName、old_name三种形态,因为 args.ts 会做 kebab→camel 转换) - 必要时保留deprecated alias(老 flag 仍可用,但 stderr 警告 → 下版本删)
完成后自查
pnpm -F bailian-cli exec tsx src/main.ts <command> --help # 看新 flag 出现在 Flags
pnpm -F bailian-cli exec tsx src/main.ts <command> --new-flag x # 实测一遍
常见漏点
- ✗ 加了 array 型 flag 但没考虑用户可能传多次
- ✗ 改默认值忘记更新 description 里的 "(default: xxx)" 文案
- ✗ 在
usageArgs/exampleArgs里写死bl <path>,导致其它产品入口复用时 help 错 - ✗ required flag 缺失又在
run()里重复手写校验,与 parser/validate的错误文案不一致
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.
- yesterday First seen · 58 lines · 0 tokens per session scan A 5e14a3a7184e
command-flag-change 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 859 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.
Other agents, from other repositories
index
Browse built-in Agent Framework capabilities for multimodal input, tools, retrieval, evaluation, security, and autonomous execution.
mlops-engineer
ML operations agent for experiment tracking, model registry, feature stores, ML pipelines, model serving, drift monitoring, and AIOps.
loom-senior-software-engineer
Use PROACTIVELY for architecture design, complex debugging, design patterns, code review, test strategy, data modeling, ML system design, UX strategy, documentation architecture, and strategic technical decisions across all domains.
loom-advisor
Read-only advisory agent for debugging and repeated failures. Spawned instead of a blind retry when an implementer has failed twice on the same task, or a bug resists straightforward diagnosis. Returns a root-cause diagnosis plus one concrete next step.
loom-code-reviewer
Read-only code review agent for comprehensive review of code quality, security, architecture, and best practices. Cannot modify files.
integrity-check
Detect adversarial content in .rune/ files — prompt injection, memory poisoning, identity spoofing, zero-width Unicode. Verdict: CLEAN/SUSPICIOUS/TAINTED.