cli: Instructions file for Codex

AGENTS.md

cli AGENTS.md is an instructions file for Codex, OpenCode from modelstudioai/cli. It costs 3,885 tokens per session, scanned A, original, Apache-2.0.

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

Written for Codex and OpenCode: the file is AGENTS.md.

This is modelstudioai/cli's own configuration. It tells Codex and OpenCode how to work on cli itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cli configures →

Reuse

Borrowing it

Nothing to install: this file belongs to modelstudioai/cli. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/modelstudioai/cli/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/modelstudioai/cli

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cli AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/modelstudioai/cli/agents-md/github.svg)](https://agentmods.dev/instructions/modelstudioai/cli/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/modelstudioai/cli/agents-md"><img src="https://agentmods.dev/badge/instructions/modelstudioai/cli/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cli AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/modelstudioai/cli/agents-md"><img src="https://agentmods.dev/badge/instructions/modelstudioai/cli/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,885 This file is loaded in full into every session.
When invoked 3,885 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03885 $0.03885
Opus 5.5 $0.01554 $0.01554
Sonnet 5.5 $0.00777 $0.00777
Haiku 4.5 $0.00388 $0.00388

Measured 4d ago against content hash 42a6be3826a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 4d 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.

AGENTS.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 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/core — bailian-cli-core,纯逻辑层:鉴权、配置、HTTP client、错误、类型、文件工具
  • packages/runtime — bailian-cli-runtime,通用 CLI 运行时:createCli、参数解析、registry/help、middleware、error handler、输出、pipeline、Command Pack host
  • packages/commands — bailian-cli-commands,可复用命令实现库,只导出 command,不决定产品路径
  • packages/cli — bailian-cli,完整 bl 产品入口;src/commands.ts 组装 bl 暴露的命令路径
  • packages/kscli — knowledge-studio-cli,Knowledge Studio 专用入口;src/main.ts 复用 commands 并重映射为 kscli 路径
  • packages/bailian-kb-dsh — bailian-kb-dsh,下游宿主适配层(依赖方向朝外):百炼知识库的 DeepSeek Harness (dsh) 插件,消费 bl CLI 与知识库 API,不在上面这条分层链上;构建独立,版本与发布跟随 bailian-cli,见 docs/agents/dsh-plugin.md
  • packages/bailian-memo-dsh — bailian-memo-dsh,下游宿主适配层:百炼个人记忆 dsh 插件(dsh 0.2.1 Volatile Config / SettingsForms);身份在 ~/.bailian/personal-memory/config.json;构建独立,版本与发布跟随 bailian-cli,见 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

Read the full file on GitHub · 152 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. 4d ago Changed · +3 lines · +161 tokens per session 42a6be3826a0
  2. 9d ago Changed · +1 lines · +45 tokens per session 71a93dc20734
  3. 16d ago Changed · +1 lines · +98 tokens per session f07449840878
  4. 21d ago Changed · +1 lines · +53 tokens per session 1fa23f6c0a04
  5. 1mo ago Changed · +8 tokens per session cae34e5123d0
  6. 2mo ago 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 (369 stars, last pushed today), licensed Apache-2.0. It adds 3,885 tokens to every session, about $0.0155 per session on Opus 5.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

cli AGENTS.md compared with instructions from other repositories

cli AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cli AGENTS.mdmodelstudioai/cliInstructions file369todayApache-2.0A3,885Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode