knowledge-interaction-surfaces-cli-bootstrap-headless-and-print

knowledge-interaction-surfaces-cli-bootstrap-headless-and-print is a skill for Claude Code, Codex from echoVic/blade-code. It costs 160 tokens per session (2,068 once invoked), scanned A, original, MIT.

A codebase guide for the command-line startup path, including interactive, non-interactive, print, and structured JSONL output modes.

In plain words
What is it for?
Use it for CLI flags, subcommands, piped input, headless agent runs, one-response print mode, machine-readable output, and session resume or fork.
Why use it?
It helps developers add commands or options without changing how input, sessions, output, signals, and exit codes behave in scripts.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for CLI flags, subcommands, piped input, headless agent runs, one-response print mode, machine-readable output, and session resume or fork.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echovic/blade-code/cli-bootstrap-headless-and-print
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.

Any agent
npx skills add echoVic/blade-code --skill cli-bootstrap-headless-and-print
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

Made for: Claude Code, Codex.

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 knowledge-interaction-surfaces-cli-bootstrap-headless-and-print

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/cli-bootstrap-headless-and-print.svg)](https://agentmods.dev/skills/echovic/blade-code/cli-bootstrap-headless-and-print)
Your own site
<a href="https://agentmods.dev/skills/echovic/blade-code/cli-bootstrap-headless-and-print"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/cli-bootstrap-headless-and-print.svg" alt="Measured on agentmods" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,068 The whole file, excluding the scripts and references it only reads on demand.
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.00160 $0.02068
Opus 5 $0.00080 $0.01034
Sonnet 5 $0.00032 $0.00414
Haiku 4.5 $0.00016 $0.00207

Measured 3d ago against content hash 1344f335c7e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

knowledge-interaction-surfaces-cli-bootstrap-headless-and-print 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 3d 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.

.trae/knowledges/interaction-surfaces/cli-bootstrap-headless-and-print/SKILL.md · 67 lines

How it starts

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

Module Structure

CLI 层先建立进程级 cwd、日志和可信资源覆盖,再按参数选择专用运行器;Headless 与 Print 都直接拥有 SessionRuntime,但面向不同的机器消费与一次性文本消费场景。

Directory Layout

  • packages/cli/src/blade.tsx — 进程预解析、工作区初始化、模式分流和默认 Ink 启动
  • packages/cli/src/cli/ — 全局选项、设置文件校验、运行时配置合并和中间件
  • packages/cli/src/commands/headless.ts — 完整 Agent loop 的非交互运行器
  • packages/cli/src/commands/headlessEvents.ts — 版本化 snake_case JSONL wire schema
  • packages/cli/src/commands/HeadlessOutputEgress.ts — stdout/stderr 有界串行写入
  • packages/cli/src/commands/print.ts — 单一最终响应运行器
  • packages/cli/src/commands/shared/ — 输入规范化、输出 schema 和非交互 Session 解析
  • packages/cli/src/commands/ — Serve、Web、Browser、Doctor、MCP、Projects、Schedule 等管理命令

Key Entry Points

  • main() in packages/cli/src/blade.tsx — 选择 Headless、Print、ACP、yargs 子命令或 TUI
  • loadConfiguration() in packages/cli/src/cli/middleware.ts — 合并 settings、CLI 和持久配置
  • runHeadless() in packages/cli/src/commands/headless.ts — 执行完整事件化 Agent loop
  • runPrint() in packages/cli/src/commands/print.ts — 聚合一次最终响应并退出
  • resolveNonInteractiveSession() in packages/cli/src/commands/shared/sessionContext.ts — 统一 resume、continue 与 fork

Gotchas

  • --debug 必须在导入 yargs 和创建其他 logger 前从原始 argv 预解析,否则早期模块日志不会继承过滤设置 (packages/cli/src/blade.tsx)
  • 工作区根与命令调用目录不是同一概念:项目探测会更新全局 cwd,但 --plugin-dir--settings 的相对路径仍按原始 invocation cwd 解析 (packages/cli/src/blade.tsx, packages/cli/src/cli/settings.ts)
  • --headless 在全局 GracefulShutdown 初始化前分流并独占 SIGINT/SIGTERM;把它移到普通 yargs 路径会让活动 turn 来不及 settle 就退出 (packages/cli/src/blade.tsx, packages/cli/src/commands/headless.ts, git:3d7ec137)
  • Headless 新 Session 默认 yolo,Print 则回退到 Runtime 配置的权限模式;resume 时两者都优先采用显式参数,再采用 Session 持久模式 (packages/cli/src/commands/headless.ts, packages/cli/src/commands/print.ts)
  • 无参数 --resume 只在 TUI 中打开选择器,Print/Headless 必须获得具体 Session ID;--session-id 与 resume/continue 同用时还必须显式 fork (packages/cli/src/cli/middleware.ts, packages/cli/src/commands/shared/sessionContext.ts)
  • Headless 的 jsonl 是版本化、snake_case 且经 TypeBox 定义的外部契约,不应直接序列化内部 camelCase LoopEvent (packages/cli/src/commands/headlessEvents.ts)
  • Print 的 stream-json 名称不表示逐 delta 输出;实现会先 drainLoop(),最后只写一个 response 或 structured_output 对象 (packages/cli/src/commands/print.ts)
  • ! <command> 不能与 output schema 组合,Headless 中还不能与 --task-isolation 组合;这些路径跳过模型并使用 Shell 自己的退出码 (packages/cli/src/commands/headless.ts, packages/cli/src/commands/print.ts)
  • Headless 的 stdout 与 stderr 是两个独立容量队列;任一 writer 的 EPIPE、超时、overflow 或无法观察的 drain 都会中止当前运行并返回失败 (packages/cli/src/commands/HeadlessOutputEgress.ts, git:1af43232)
  • Headless 对 MCP Elicitation 和 Sampling 默认拒绝,但普通工具确认默认 Session 级批准;这不是 TUI 的交互权限行为 (packages/cli/src/commands/headless.ts)
  • globalOptions 的 yargs 总体为 strict: false 以保留兼容性,Headless 仍在内部用 HeadlessOptionsSchema fail closed;新增选项必须同步这两层,否则可能被 yargs 接收后在运行器拒绝 (packages/cli/src/cli/config.ts, packages/cli/src/commands/headless.ts)

Read the full file on GitHub · 67 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. 3d ago First seen · 67 lines · 160 tokens per session scan A 1344f335c7e6

Subscribe to this mod's changes

knowledge-interaction-surfaces-cli-bootstrap-headless-and-print is a skill published in the GitHub repository echoVic/blade-code (178 stars, last pushed yesterday), licensed MIT. It adds 160 tokens to every session and 2,068 once invoked, about $0.0008 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-09-03.

Related

Other skills, from other repositories

groq-inference

Ultra-fast LLM inference on custom LPU hardware. OpenAI-compatible API at api.groq.com. Lowest latency in the industry (500-1000+ tok/s). Supports chat completions, vision, audio (Whisper STT + TTS), tool calling, JSON mode, and streaming. Free tier available. Inference only — no training.

synthetic-sciences/openscience · 77 tokens

bun-file-io

Use this when you are working on file operations like reading, writing, scanning, or deleting files. It summarizes the preferred file APIs and patterns used in this repo. It also notes when to use filesystem helpers for directories.

synthetic-sciences/openscience · 49 tokens

protocolsio-integration

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io…

synthetic-sciences/openscience · 85 tokens

Code Execution

Run Python, Node.js, AND arbitrary shell commands in a secure E2B cloud sandbox that PERSISTS across calls within a conversation. Clone repos, install packages, run CLI tools (git, psql, ffmpeg, duckdb), and build up state turn over turn.

winsenlabs/platos · 60 tokens

slack-tools

Slack workspace management and automation specialist.

librefang/librefang-registry · 10 tokens

tg-moderator

Telegram chat moderator/companion mode. No tools, conversational only.

StarryCod/cogitum · 19 tokens