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/config-addgit 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.01067 |
| Opus 5 | $0.00000 | $0.00534 |
| Sonnet 5 | $0.00000 | $0.00213 |
| Haiku 4.5 | $0.00000 | $0.00107 |
Grade A, and why
config-add 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.
How it starts
The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
配置项扩展
触发条件
- 新增 env var(如
DASHSCOPE_*/BAILIAN_*/NO_COLOR) - 给
~/.bailian/config.json加字段 - 给全局 flag 加新选项(
--xxx) - 改 config 字段优先级
配置三层来源
flag (--xxx) ─┐
├─ buildSources() + buildSettings() ─→ Settings(命令读取面)
env (XXX=yyy) ─┤
│
config 文件 ─┘
~/.bailian/config.json
优先级一般是 flag > env > config 文件 > 默认值,具体见 packages/core/src/config/loader.ts。
必查清单
A. 类型定义
-
packages/core/src/config/schema.ts:Settings(运行时有效配置面)加新字段ConfigFile(disk 形状,snake_case)加新字段(如果允许写文件)parseConfigFile()解析新字段- 如果是 enum 字段,加校验
- 如果是数组字段,明确“缺失 / 空数组 / 非法值”的不同语义;安全策略字段的非法值必须 fail closed
B. 加载逻辑
-
packages/core/src/config/loader.ts:buildSources()如需新增来源,把 flag/file/env 纳入 sourcesbuildSettings()加新字段的合并逻辑(flags.x ?? process.env.XXX ?? file.x ?? default)- 校验(数值范围、枚举合法性等)
- 校验失败抛
BailianError(USAGE)
C. 全局 flag(如果加的是 flag)
-
packages/core/src/types/command.ts:GLOBAL_FLAGS -
packages/runtime/src/registry.ts会自动从GLOBAL_FLAGS生成 root help;tools/generate-reference.ts会生成reference/index.md的全局 flag 段 - flag 的 type 标注(
switch/boolean/number/array/string),让packages/runtime/src/args.ts正确解析 - 改完全局 flag 后跑
pnpm --filter bailian-cli run generate:reference
D. 命令使用方
- 用到新字段的命令文件直接读
ctx.settings.xxx,不要重复解析 env/config - 配置展示 / 修改命令同步:
packages/commands/src/commands/config/show.ts显示新字段packages/commands/src/commands/config/set.ts的VALID_KEYS/KEY_ALIASES/ description 允许 setpackages/commands/src/commands/config/ui.ts/ui-html.ts能按原类型往返数组字段,不能把[]保存成字段缺失
E. 文档
-
README.md/README.zh.md的 env var 表格
F. 测试
- 单测覆盖优先级:flag > env > file
- 校验失败抛错(非法值)
- 默认值正确
- 数组配置覆盖 CLI 逗号/JSON 输入、Config UI 往返、去重和显式空数组
完成后自查
# 三个来源都试一遍
pnpm -F bailian-cli exec tsx src/main.ts config show --output json | grep <new-field>
XXX=value pnpm -F bailian-cli exec tsx src/main.ts config show --output json | grep <new-field>
pnpm -F bailian-cli exec tsx src/main.ts config show --xxx value --output json | grep <new-field>
# 写到文件(会改用户 HOME,必要时先用临时 HOME)
pnpm -F bailian-cli exec tsx src/main.ts config set --key <key> --value <value>
cat ~/.bailian/config.json
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 · 89 lines · 0 tokens per session scan A fc73d194aabb
config-add 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 1,067 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.