cli AGENTS.md

Maintenance instructions for Bailian CLI, a command-line tool organized as a monorepo, meaning one repository containing several related packages.

In plain words
What is it for?
Use them to navigate the project, identify command entry points, and follow the required workflow for different business scenarios.
Why use it?
They help an agent find the right package and documentation before changing a command, while preserving the intended dependency layers.

Instructions file for CodexOpenCode

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 instructions/modelstudioai/cli/agents-md
Clone the repo
git clone --depth 1 https://github.com/modelstudioai/cli

Made for: Codex, OpenCode.

Per session 3,520 This file is loaded in full into every session.
When invoked 3,520 The same file — it is already loaded in full.
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.03520 $0.03520
Opus 5 $0.01760 $0.01760
Sonnet 5 $0.00704 $0.00704
Haiku 4.5 $0.00352 $0.00352

Measured yesterday against content hash 6e216b43cc0d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli AGENTS.md 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.

AGENTS.md · 146 lines

How it starts

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

bailian-cli — AI 维护指南

本文件是 AI agent 维护本仓库时的契约。每次进入项目先读这里,从"业务场景索引"挑一条,再进入对应 docs/agents/*.md 清单。

项目地图

monorepo 现在按"纯逻辑 → 运行时框架 → 命令库 → 产品入口"分层:

  • packages/corebailian-cli-core,纯逻辑层:鉴权、配置、HTTP client、错误、类型、文件工具
  • packages/runtimebailian-cli-runtime,通用 CLI 运行时:createCli、参数解析、registry/help、middleware、error handler、输出、pipeline、Command Pack host
  • packages/commandsbailian-cli-commands,可复用命令实现库,只导出 command,不决定产品路径
  • packages/clibailian-cli,完整 bl 产品入口;src/commands.ts 组装 bl 暴露的命令路径
  • packages/kscliknowledge-studio-cli,Knowledge Studio 专用入口;src/main.ts 复用 commands 并重映射为 kscli 路径
  • packages/bailian-kb-dshbailian-kb-dsh,下游宿主适配层(依赖方向朝外):百炼知识库的 DeepSeek Harness (dsh) 插件,消费 bl CLI 与知识库 API,不在上面这条分层链上;版本、构建、发布都独立,见 docs/agents/dsh-plugin.md

关键文件

packages/cli/src/main.ts          # bl 入口,注入 binName/version/clientName/npmPackage
packages/cli/src/commands.ts      # bl 产品命令 map,tools/generate-reference.ts 也读它
packages/cli/src/command-pack-policy.ts # bl 的 Command Pack policy
packages/kscli/src/main.ts        # kscli 入口和命令 map

packages/commands/src/index.ts    # re-export 单个命令实现
packages/commands/src/commands/   # defineCommand({ auth, flags, usageArgs, exampleArgs, run })

packages/runtime/src/create-cli.ts # createCli(commands, options)
packages/runtime/src/registry.ts   # 命令树解析 + 动态 help
packages/runtime/src/middleware.ts # auth / telemetry / update / run command
packages/runtime/src/command-packs/ # 通用 Command Pack 加载、校验、隔离安装目录和管理命令
packages/runtime/src/urls.ts       # 用户面控制台 URL

packages/core/src/types/command.ts # Command / flags / auth 类型
packages/core/src/config/          # ConfigFile / Settings / source 解析
packages/core/src/auth/            # apiKey / console credential 解析与落盘
packages/core/src/client/          # HTTP client / endpoints / console gateway

Skill / 命令手册随 skills/bailian-*/bl skill init 安装(装齐 registry 中全部 bailian-*,含共享协议 bailian-protocol)。业务 skill(bailian-cli / bailian-gen / bailian-finetune / bailian-managed-agent / bailian-web-search)执行前读 skills/bailian-protocol/;不要依赖 frontmatter companions(安装器不强制)。tools/generate-reference.tspackages/cli/src/commands.ts 按一级命令归属表分流写入各 skills/<skill>/reference/(纳入 git);tools/sync-skill-metadata.tspackages/cli/package.json 同步各 skills/*/SKILL.mdmetadata.version。两者由根脚本 pnpm run sync:skill-assets.vite-hooks/pre-commit 执行。hub bailian-cli 的路由表不复述领域命令明细;SKILL 文案 / 安装约定 / hand-off 见 docs/agents/skill-change.md

Read the full file on GitHub · 146 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. yesterday First seen · 146 lines · 3,520 tokens per session scan A 6e216b43cc0d

Subscribe to this mod's changes

cli AGENTS.md is an instructions file published in the GitHub repository modelstudioai/cli (320 stars, last pushed 4d ago), licensed Apache-2.0. It adds 3,520 tokens to every session, about $0.0176 per session on Opus 5. 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.

Related

Other instructions, from other repositories

ai-toolkit AGENTS.md

Instructions for pipefy/ai-toolkit, covering repository guidelines, documentation map, project structure, import namespace migration: pipefysdk → pipefy and src/pipefysdk/init.py (transitional shim).

pipefy/ai-toolkit · 3,184 tokens

superpowers-reasonix AGENTS.md

Instructions for christopherarter/superpowers-reasonix, covering project guidance, skills — stop. load a skill before you act, red flags — these thoughts mean stop. you are rationalizing and priority.

christopherarter/superpowers-reasonix · 761 tokens

ai-mind AGENTS.md

Instructions for HWYD/ai-mind, covering agents, version spec workspace continuity (mandatory), 项目定位, 事实来源优先级 and 开始大改前先读什么.

HWYD/ai-mind · 3,170 tokens

finding-unknowns-skills CLAUDE.md

Claude Code instructions for Neeeophytee/finding-unknowns-skills, covering repo notes, what ships, and the gate that decides, version lives in three manifests — move them together, files that must be edited together and shipped guidance is not this file.

Neeeophytee/finding-unknowns-skills · 1,447 tokens

vvvv-skills CLAUDE.md

Claude Code instructions for tebjan/vvvv-skills, covering vvvv gamma, when to patch vs code, core concepts, live environment and important conventions.

tebjan/vvvv-skills · 987 tokens

pi AGENTS.md

AGENTS.md instructions for counterposition/pi, covering agents.md, commands, pattern: pnpm --filter @counterposition/pi-web-search run, single test file and single test by name.

counterposition/pi · 806 tokens