
# tokenjuice 🧃
为重度依赖终端的 agent 工作流提供精简的输出压缩。
## 什么是 tokenjuice?
tokenjuice 是一个确定性的输出压缩器,专为重度依赖终端的 agent 工作流设计。agents 和测试框架(harnesses)会运行大量产生噪音的命令,如 `git status`、`pnpm test`、`docker build`、`rg` 或 `pnpm --help`;tokenjuice 在保持命令语义不变的同时,观察执行后的输出,并通过基于规则驱动的 reducer 返回更小的 payload,而不是将整片终端文本原封不动地塞回上下文。
其核心价值在于杠杆效应:减少记录浪费,避免无用的重复运行,并在工具间实现更清晰的交接,而无需让 shell 变得神奇。原始输出只有在您通过 `--raw` / `--full` 明确要求或选择性开启 artifact 存储时才可用;规则始终保持为可检查的 JSON,而非 LLM 的随意发挥;宿主集成始终作为同一核心 reducer 的轻量级封装,而不是变成一次性的适配器逻辑。
## 宿主集成
支持的集成:
| Logo | Client | Install | Hook file |
| --- | --- | --- | --- |
|

| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `tokenjuice install claude-code` | `~/.claude/settings.json` |
|

| [CodeBuddy](https://codebuddy.tencent.com/) | `tokenjuice install codebuddy` | `~/.codebuddy/settings.json` |
|

| [Codex CLI](https://github.com/openai/codex) | `tokenjuice install codex` | `~/.codex/hooks.json` |
|

| [Cursor](https://cursor.com/docs/hooks) | `tokenjuice install cursor` | `~/.cursor/hooks.json` |
|

| [Droid (Factory CLI)](https://docs.factory.ai/cli/configuration/hooks-guide) | `tokenjuice install droid` | `~/.factory/settings.json` |
|

| [GitHub Copilot CLI](https://github.com/github/copilot-cli) | `tokenjuice install copilot-cli` | `~/.copilot/hooks/tokenjuice-cli.json` |
|

| [OpenClaw](https://openclaw.ai/) | `openclaw config set plugins.entries.tokenjuice.enabled true` | `~/.openclaw/openclaw.json` |
|

| [OpenCode](https://opencode.ai/) | `tokenjuice install opencode` | `~/.config/opencode/plugins/tokenjuice.js` |
|

| [pi](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) | `tokenjuice install pi` | `~/.pi/agent/extensions/tokenjuice.js` |
|

| [VS Code Copilot Chat](https://code.visualstudio.com/docs/copilot/overview) | `tokenjuice install vscode-copilot` | `~/.copilot/hooks/tokenjuice-vscode.json` |
beta 集成:
| Logo | Client | Install | Hook file |
| --- | --- | --- | --- |
|

| [AdaL CLI](https://docs.sylph.ai/features/plugins-and-skills) | `tokenjuice install adal` | `AGENTS.md` |
|

| [Aether](https://aether-agent.io/) | `tokenjuice install aether` | `.aether/tokenjuice.md` / `.aether/settings.json` |
|

| [aictl](https://www.aictl.app/) | `tokenjuice install aictl` | `AICTL.md` |
|

| [AI Memory Protocol](https://github.com/bburda/ai_memory_protocol) | `tokenjuice install ai-memory-protocol` | `.memories/memory/preferences.rst` |
|

| [Aider](https://aider.chat/) | `tokenjuice install aider` | `CONVENTIONS.tokenjuice.md` |
|

| [Agent Layer](https://agent-layer.dev/docs/) | `tokenjuice install agent-layer` | `.agent-layer/instructions/tokenjuice.md`; run `al sync` after install or uninstall |
|

| [AgentInit](https://pypi.org/project/agentinit/) | `tokenjuice install agentinit` | `AGENTS.md`; run `agentinit sync` after install or uninstall |
|

| [Agentlink](https://agentlink.run/) | `tokenjuice install agentlink` | `AGENTS.md`; run `agentlink sync` after install or uninstall |
|

| [Agentloom](https://agentloom.sh/docs) | `tokenjuice install agentloom` | `.agents/rules/tokenjuice-agentloom.md`; run `agentloom sync` after install or uninstall |
|

| [agents-cli](https://agents-cli.sh/) | `tokenjuice install agents-cli` | `~/.agents/memory/AGENTS.md`; run `agents sync` after install or uninstall |
|

| [AGENTS.md](https://agents.md/) | `tokenjuice install agents-md` | `AGENTS.md` |
|

| [agents.ge](https://agents.ge/) | `tokenjuice install agentsge` | `.agents/rules/tokenjuice-agentsge.md` |
|

| [AgentsMesh](https://samplexbro.github.io/agentsmesh/) | `tokenjuice install agentsmesh` | `.agentsmesh/rules/tokenjuice.md`; run `agentsmesh generate` after install or uninstall |
|

| [Amazon Q Developer CLI / Kiro compatibility](https://kiro.dev/docs/cli/migrating-from-q/) | `tokenjuice install amazon-q` | `.amazonq/rules/tokenjuice.md` |
|

| [Amp](https://ampcode.com/manual) | `tokenjuice install amp` | `AGENTS.md` / `AGENT.md` / `CLAUDE.md` |
|

| [Google Antigravity](https://antigravity.google/) | `tokenjuice install antigravity` | `.agents/rules/tokenjuice.md` |
|

| [anywhere-agents](https://anywhere-agents.readthedocs.io/) | `tokenjuice install anywhere-agents` | `AGENTS.local.md`; run `anywhere-agents` after install or uninstall |
|

| [Augment](https://docs.augmentcode.com/cli/rules) | `tokenjuice install augment` | `.augment/rules/tokenjuice.md` |
|

| [Avante.nvim](https://github.com/yetone/avante.nvim) | `tokenjuice install avante` | `avante.md` |
|

| [Baz](https://docs.baz.co/agents/skills-and-instructions) | `tokenjuice install baz` | `.baz/skills/tokenjuice/SKILL.md` |
|

| [Bito](https://docs.bito.ai/ai-code-reviews-in-git/agent-settings/repo-level-settings) | `tokenjuice install bito` | `.bito.yaml` / `.bito/tokenjuice.md` |
|

| [Blackbox CLI](https://docs.blackbox.ai/features/blackbox-cli/skills) | `tokenjuice install blackbox` | `.blackbox/skills/tokenjuice/SKILL.md` |
|

| [Blocks](https://docs.blocks.team/using-blocks/features/skills) | `tokenjuice install blocks` | `.agents/skills/tokenjuice-blocks/SKILL.md` |
|

| [Clawdbot](https://docs.clawd.bot/skills) | `tokenjuice install clawdbot` | `skills/tokenjuice/SKILL.md` |
|

| [IBM Bob Shell](https://bob.ibm.com/docs/shell/configuration/configuring) | `tokenjuice install bob` | `AGENTS.md` |
|

| [Builder](https://www.builder.io/c/docs/projects-configuration-files) | `tokenjuice install builder` | `.builder/rules/tokenjuice.mdc` |
|

| [Charlie](https://docs.charlielabs.ai/customization/instructions) | `tokenjuice install charlie` | `AGENTS.md` |
|

| [Cline](https://docs.cline.bot/features/hooks/hook-reference) | `tokenjuice install cline` | `~/Documents/Cline/Hooks/tokenjuice-post-tool-use` |
|

| [CodeAnt](https://docs.codeant.ai/ide/review/code_review_instructions) | `tokenjuice install codeant` | `.codeant/instructions.json` |
|

| [Codebuff](https://www.codebuff.com/docs/help/quick-start) | `tokenjuice install codebuff` | `AGENTS.md` |
|

| [Codegen](https://docs.codegen.com/settings/repo-rules) | `tokenjuice install codegen` | `AGENTS.md` |
|

| [Coder Agents](https://coder.com/docs/ai-coder/agents) | `tokenjuice install coder-agents` | `.agents/skills/tokenjuice/SKILL.md` |
|

| [CodeRabbit](https://docs.coderabbit.ai/configuration/path-instructions) | `tokenjuice install coderabbit` | `.coderabbit.yaml` |
|

| [Command Code](https://commandcode.ai/docs/) | `tokenjuice install command-code` | `~/.commandcode/settings.json` / `.commandcode/settings.json` |
|

| [Continue](https://docs.continue.dev/) | `tokenjuice install continue` | `.continue/rules/tokenjuice.md` |
|

| [Crush](https://github.com/charmbracelet/crush) | `tokenjuice install crush` | `.crush/skills/tokenjuice/SKILL.md` |
|

| [Deep Agents Code](https://docs.langchain.com/oss/javascript/deepagents/code/overview) | `tokenjuice install deepagents` | `.deepagents/AGENTS.md` |
|

| [Devin for Terminal](https://cli.devin.ai/docs/extensibility/hooks/overview) | `tokenjuice install devin` | `.devin/hooks.v1.json` |
|

| [dot-agents](https://www.dot-agents.com/) | `tokenjuice install dot-agents` | `~/.agents/rules/global/rules.mdc`; run `dot-agents sync` after install or uninstall |
|

| [Docker Agent](https://docs.docker.com/ai/docker-agent/) | `tokenjuice install docker-agent` | `.docker-agent/tokenjuice.md` |
|

| [ECA](https://eca.dev/) | `tokenjuice install eca` | `.eca/skills/tokenjuice/SKILL.md` |
|

| [Elyra](https://elyracode.com/) | `tokenjuice install elyra` | `.elyra/skills/tokenjuice/SKILL.md` |
|

| [Firebase Studio](https://firebase.google.com/docs/studio/set-up-gemini) | `tokenjuice install firebase-studio` | `.idx/airules.md` |
|

| [ForgeCode](https://forgecode.dev/docs/custom-rules/) | `tokenjuice install forgecode` | `AGENTS.md` |
|

| [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `tokenjuice install gemini-cli` | `~/.gemini/settings.json` |
|

| [GitLab Duo Agent Platform](https://docs.gitlab.com/user/duo_agent_platform/customize/custom_rules/) | `tokenjuice install gitlab-duo` | `.gitlab/duo/chat-rules.md` |
|

| [Goose](https://goose-docs.ai/) | `tokenjuice install goose` | `.goosehints` |
|

| [Greptile](https://www.greptile.com/docs/code-review/greptile-config) | `tokenjuice install greptile` | `.greptile/rules.md` |
|

| [Grok Build](https://docs.x.ai/build/overview) | `tokenjuice install grok-build` | `AGENTS.md` |
|

| [Grok CLI](https://github.com/superagent-ai/grok-cli) | `tokenjuice install grok-cli` | `~/.grok/user-settings.json` |
|

| [gptme](https://gptme.org/docs/prompts.html) | `tokenjuice install gptme` | `AGENTS.md` |
|

| [GitHub Copilot coding agent](https://docs.github.com/en/copilot/using-github-copilot/coding-agent) | `tokenjuice install copilot-agent` | `.github/hooks/tokenjuice-agent.json` |
|

| [Jean2](https://jean2.ai/docs/deep-dive/agents-md) | `tokenjuice install jean2` | `AGENTS.md` |
|

| [JetBrains AI Assistant](https://www.jetbrains.com/help/ai-assistant/) | `tokenjuice install jetbrains-ai` | `.aiassistant/rules/tokenjuice.md` |
|

| [Junie](https://junie.jetbrains.com/docs/junie-cli-usage.html) | `tokenjuice install junie` | `.junie/AGENTS.md` |
|

| [Jules](https://jules.google/docs/) | `tokenjuice install jules` | `AGENTS.md` |
|

| [LeanCTL](https://leanctl.com/docs/configuration) | `tokenjuice install leanctl` | `.leanctl/instructions.md` |
|

| [Kimi Code CLI](https://moonshotai.github.io/kimi-cli/en/) | `tokenjuice install kimi` | `~/.kimi/config.toml` |
|

| [Kiro](https://kiro.dev/) | `tokenjuice install kiro` | `.kiro/steering/tokenjuice.md` |
|

| [Kilo Code](https://kilocode.ai/) | `tokenjuice install kilo` | `kilo.jsonc` or `.kilo/kilo.jsonc` + `.kilo/rules/tokenjuice.md` |
|

| [LocalCode](https://www.localcode.codes/) | `tokenjuice install localcode` | `~/.localcode/plugins/tokenjuice/` |
|

| [mcp-agent](https://docs.mcp-agent.com/) | `tokenjuice install mcp-agent` | `.mcp-agent/agents/tokenjuice.md` |
|

| [mini-SWE-agent](https://mini-swe-agent.com/) | `tokenjuice install mini-swe-agent` | `.mini-swe-agent/tokenjuice.yaml` |
|

| [SWE-agent](https://swe-agent.com/latest/) | `tokenjuice install swe-agent` | `.swe-agent/tokenjuice.yaml` |
|

| [Stagewise](https://docs.stagewise.io/agent/skills-and-context) | `tokenjuice install stagewise` | `.stagewise/skills/tokenjuice/SKILL.md` |
|

| [Mistral Vibe](https://docs.mistral.ai/mistral-vibe/agents-skills) | `tokenjuice install mistral-vibe` | `AGENTS.md` |
|

| [Mux](https://mux.coder.com/hooks/tools) | `tokenjuice install mux` | `.mux/tool_post` |
|

| [NovaKit CLI](https://www.novakit.ai/docs/cli) | `tokenjuice install novakit` | `NOVAKIT.md` |
|

| [Knowns](https://knowns.sh/) | `tokenjuice install knowns` | `KNOWNS.md` |
|

| [Ona Agent](https://ona.com/docs/ona/agents/overview) | `tokenjuice install ona` | `.ona/skills/tokenjuice/SKILL.md` |
|

| [OpenHands](https://docs.openhands.dev/) | `tokenjuice install openhands` | `.openhands/hooks.json` |
|

| [Open Interpreter](https://www.openinterpreter.com/docs/terminal/agents_md) | `tokenjuice install open-interpreter` | `AGENTS.md` |
|

| [Open WebUI](https://openwebui.com/) | `tokenjuice install openwebui` | `.openwebui/tools/tokenjuice_compact.py` |
|

| [pi-go](https://pi-go.sh/) | `tokenjuice install pi-go` | `.pi/skills/tokenjuice/SKILL.md` |
|

| [Plandex](https://docs.plandex.ai/) | `tokenjuice install plandex` | `PLANDEX.tokenjuice.md` |
|

| [Qodo Code Review](https://docs.qodo.ai/code-review/get-started/configuration-overview/configuration-file) | `tokenjuice install qodo` | `.pr_agent.toml` |
|

| [Qoder CLI](https://docs.qoder.com/cli/using-cli) | `tokenjuice install qoder` | `AGENTS.md` |
|

| [Qwen Code](https://qwenlm.github.io/qwen-code-docs/) | `tokenjuice install qwen-code` | `.qwen/settings.json` |
|

| [Replit Agent](https://docs.replit.com/references/project-setup/replit-dot-md) | `tokenjuice install replit` | `replit.md` |
|

| [Roo Code](https://roocode.com/) | `tokenjuice install roo` | `.roo/rules/tokenjuice.md` |
|

| [Rovo Dev CLI](https://support.atlassian.com/rovo/docs/use-memory-in-rovo-dev-cli/) | `tokenjuice install rovo` | `AGENTS.md` |
|

| [Ruler](https://github.com/intellectronica/ruler) | `tokenjuice install ruler` | `.ruler/tokenjuice.md` |
|

| [Tabby](https://tabby.tabbyml.com/) | `tokenjuice install tabby` | `~/.tabby/config.toml` |
|

| [Tabnine CLI](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/cli-commands) | `tokenjuice install tabnine` | `TABNINE.md` |
|

| [Trae](https://traeide.com/) | `tokenjuice install trae` | `.trae/rules/project_rules.md` |
|

| [UiPath for Coding Agents](https://www.uipath.com/developers/coding-agents) | `tokenjuice install uipath` | `AGENTS.md` |
|

| [Warp](https://docs.warp.dev/agent-platform/capabilities/rules) | `tokenjuice install warp` | `AGENTS.md` / `WARP.md` |
|

| [Windsurf](https://windsurf.com/) | `tokenjuice install windsurf` | `.windsurf/rules/tokenjuice.md` |
|

| [Zed](https://zed.dev/docs/ai/rules.html) | `tokenju install zed` | `.rules` |
|

| [Zencoder](https://docs.zencoder.ai/rules-context/zen-rules) | `tokenjuice install zencoder` | `.zencoder/rules/tokenjuice.md` |
## 安装
```
npm install -g tokenjuice
# 或
pnpm add -g tokenjuice
# 或
yarn global add tokenjuice
# 或
brew tap vincentkoc/tap
brew install tokenjuice
```
然后:
```
tokenjuice --help
tokenjuice --version
tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
tokenjuice uninstall [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
```
OpenClaw 支持已内置于 OpenClaw 中。请勿运行
`tokenjuice install openclaw`;请改为启用内置插件:
```
openclaw config set plugins.entries.tokenjuice.enabled true
```
这要求 OpenClaw 版本为 `2026.4.22` 或更高。
## 命令
```
tokenjuice --help
tokenjuice --version
tokenjuice reduce [file]
tokenjuice reduce-json [file]
tokenjuice wrap --
[args...]
tokenjuice wrap --raw -- [args...]
tokenjuice wrap --store -- [args...]
tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder] --local
tokenjuice uninstall [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
tokenjuice ls
tokenjuice cat
tokenjuice verify
tokenjuice discover
tokenjuice doctor
tokenjuice doctor hooks
tokenjuice doctor pi
tokenjuice doctor opencode
tokenjuice stats
tokenjuice stats --timezone utc
```
## 概述
tokenjuice 具有三个接口。`reduce` 用于压缩已存在的文本,`wrap` 运行命令并压缩观察到的输出,`reduce-json` 为宿主适配器提供稳定的机器协议。宿主集成的实现非常轻量:它们安装一个 hook、扩展、规则或指导文件;调用共享的压缩器;并通过宿主的原生接口返回压缩后的上下文。使用 `tokenjuice doctor hooks` 检查已安装的配置,使用 `tokenjuice doctor ` 查看单个集成,以及在发布前验证当前 repo 构建时使用 `tokenjuice install --local`。
压缩引擎是规则驱动的。内置的 JSON 规则位于 `src/rules`,用户覆盖规则位于 `~/.config/tokenjuice/rules`,项目覆盖规则位于 `.tokenjuice/rules`;后加载的层会按规则 ID 覆盖先前的层。规则会对命令输出进行分类、规范行、保留或丢弃模式、统计事实,并保留确定性的头部/尾部切片。宿主适配器还应用了严格的清单安全策略:精确的文件内容读取保持原样,独立的仓库清单命令允许压缩,而不安全的混合命令序列保持原样。
当 reducer 处理错误或任务需要原始字节时,请使用显式跳过:
```
tokenjuice wrap --raw -- pnpm --help
tokenjuice wrap --full -- git status
```
实用的维护命令:
```
tokenjuice verify --fixtures
tokenjuice discover
tokenjuice doctor hooks
tokenjuice stats --timezone utc
```
## 适配器 JSON
`reduce-json` 是面向机器的适配器命令。它从 stdin 或文件读取 JSON,并始终将 JSON 写入 stdout;有关 envelope 选项和适配器行为,请参阅[规范](docs/spec.md)。
直接 payload:
```
{
"toolName": "exec",
"command": "pnpm test",
"argv": ["pnpm", "test"],
"combinedText": "RUN v3.2.4 /repo\n...",
"exitCode": 1
}
```
## 文档
- [规范](docs/spec.md)
- [规则](docs/rules.md)
- [集成指南](docs/integration-playbook.md)
- [AdaL CLI 集成](docs/adal-integration.md)
- [Aether 集成](docs/aether-integration.md)
- [Agent Layer 集成](docs/agent-layer-integration.md)
- [AgentInit 集成](docs/agentinit-integration.md)
- [Agentlink 集成](docs/agentlink-integration.md)
- [Agentloom 集成](docs/agentloom-integration.md)
- [agents-cli 集成](docs/agents-cli-integration.md)
- [AGENTS.md 集成](docs/agents-md-integration.md)
- [agents.ge 集成](docs/agentsge-integration.md)
- [AgentsMesh 集成](docs/agentsmesh-integration.md)
- [Amp 集成](docs/amp-integration.md)
- [Amazon Q 集成](docs/amazon-q-integration.md)
- [aictl 集成](docs/aictl-integration.md)
- [AI Memory Protocol 集成](docs/ai-memory-protocol-integration.md)
- [Antigravity 集成](docs/antigravity-integration.md)
- [anywhere-agents 集成](docs/anywhere-agents-integration.md)
- [Augment 集成](docs/augment-integration.md)
- [Baz 集成](docs/baz-integration.md)
- [Bito 集成](docs/bito-integration.md)
- [Blackbox 集成](docs/blackbox-integration.md)
- [Blocks 集成](docs/blocks-integration.md)
- [Clawdbot 集成](docs/clawdbot-integration.md)
- [IBM Bob 集成](docs/bob-integration.md)
- [Builder 集成](docs/builder-integration.md)
- [Charlie 集成](docs/charlie-integration.md)
- [GitHub Copilot coding agent 集成](docs/copilot-agent-integration.md)
- [CodeAnt 集成](docs/codeant-integration.md)
- [Codebuff 集成](docs/codebuff-integration.md)
- [Codegen 集成](docs/codegen-integration.md)
- [Coder Agents 集成](docs/coder-agents-integration.md)
- [CodeRabbit 集成](docs/coderabbit-integration.md)
- [Command Code 集成](docs/command-code-integration.md)
- [Crush 集成](docs/crush-integration.md)
- [Cursor 集成](docs/cursor-integration.md)
- [CodeBuddy 集成](docs/codebuddy-integration.md)
- [Deep Agents Code 集成](docs/deepagents-integration.md)
- [Devin 集成](docs/devin-integration.md)
- [dot-agents 集成](docs/dot-agents-integration.md)
- [Docker Agent 集成](docs/docker-agent-integration.md)
- [ECA 集成](docs/eca-integration.md)
- [Elyra 集成](docs/elyra-integration.md)
- [ForgeCode 集成](docs/forgecode-integration.md)
- [Goose 集成](docs/goose-integration.md)
- [Greptile 集成](docs/greptile-integration.md)
- [Grok Build 集成](docs/grok-build-integration.md)
- [Grok CLI 集成](docs/grok-cli-integration.md)
- [gptme 集成](docs/gptme-integration.md)
- [Jean2 集成](docs/jean2-integration.md)
- [JetBrains AI Assistant 集成](docs/jetbrains-ai-integration.md)
- [LeanCTL 集成](docs/leanctl-integration.md)
- [Kimi 集成](docs/kimi-integration.md)
- [Kiro 集成](docs/kiro-integration.md)
- [Kilo Code 集成](docs/kilo-integration.md)
- [LocalCode 集成](docs/localcode-integration.md)
- [mcp-agent 集成](docs/mcp-agent-integration.md)
- [mini-SWE-agent 集成](docs/mini-swe-agent-integration.md)
- [SWE-agent 集成](docs/swe-agent-integration.md)
- [Stagewise 集成](docs/stagewise-integration.md)
- [Mistral Vibe 集成](docs/mistral-vibe-integration.md)
- [Mux 集成](docs/mux-integration.md)
- [NovaKit 集成](docs/novakit-integration.md)
- [Knowns 集成](docs/knowns-integration.md)
- [Ona 集成](docs/ona-integration.md)
- [Open Interpreter 集成](docs/open-interpreter-integration.md)
- [Open WebUI 集成](docs/openwebui-integration.md)
- [pi-go 集成](docs/pi-go-integration.md)
- [Plandex 集成](docs/plandex-integration.md)
- [Qodo 集成](docs/qodo-integration.md)
- [Qoder 集成](docs/qoder-integration.md)
- [Qwen Code 集成](docs/qwen-code-integration.md)
- [Replit 集成](docs/replit-integration.md)
- [Roo Code 集成](docs/roo-integration.md)
- [Rovo 集成](docs/rovo-integration.md)
- [Ruler 集成](docs/ruler-integration.md)
- [Tabby 集成](docs/tabby-integration.md)
- [Tabnine 集成](docs/tabnine-integration.md)
- [Trae 集成](docs/trae-integration.md)
- [UiPath 集成](docs/uipath-integration.md)
- [Warp 集成](docs/warp-integration.md)
- [Windsurf 集成](docs/windsurf-integration.md)
- [Zencoder 集成](docs/zencoder-integration.md)
- [安全性](SECURITY.md)
## 状态
具备可用于 token 缩减的基础功能,提供诊断功能和不断扩展的 reducer 集合,目前的重点在于更深层次的覆盖和调优。
💙 由 [Vincent Koc](https://github.com/vincentkoc) 构建。