跳至主要内容
小龙虾小龙虾AI
🤖

Toon

Token-saving utilities for agents: Read JSON, list directories, search code, and fetch APIs in the compact TOON format. Reduces token usage by 30-50% for structured data.

下载1.8k
星标2
版本3.0.0
general
安全通过
🔗API

技能说明

TOON (Token-Oriented Object Notation) Skill

This skill provides instructions for reducing token usage by 30-60% when dealing with structured data (JSON, directory structures, API responses).

Setup & Installation

To minimize command overhead and save tokens, you MUST install the official TOON CLI globally before usage:

# Check if toon is installed, install if missing
toon --version || npm install -g @toon-format/cli

Guidelines for Agents

  • Always optimize JSON: Convert JSON output to TOON before including it in your context.
  • Minimize Command Length: Use the direct toon command instead of npx to keep your own prompt usage low.
  • Prefer pipes: Use standard Unix pipes to send data directly to the toon converter.

Commands & Usage

1. Reading JSON Files

Instead of reading raw JSON, pipe it to toon.

cat data.json | toon

2. Fetching APIs

Pipe external API responses directly into toon.

curl -s https://api.example.com/data | toon

Supports all curl flags (e.g., -X POST, -H "Authorization: ...").

3. Listing Directory Structures

Use tree -J or any JSON-outputting tool and pipe to toon.

tree -J path/to/dir | toon

4. Converting In-Line Data

To compress a JSON string for your context:

echo '{"key":"value"}' | toon

Why install TOON?

  • Command Token Savings: toon is shorter than npx @toon-format/cli, saving tokens every time you run a command.
  • Execution Speed: Local installation is significantly faster than on-demand fetching.
  • Readability: TOON is designed to be highly readable for LLMs.

如何使用「Toon」?

  1. 打开小龙虾AI(Web 或 iOS App)
  2. 点击上方「立即使用」按钮,或在对话框中输入任务描述
  3. 小龙虾AI 会自动匹配并调用「Toon」技能完成任务
  4. 结果即时呈现,支持继续对话优化

相关技能