TOON (Token-Oriented Object Notation) is a lossless, indentation-based encoding of the JSON data model, specifically optimized for LLM context windows. This extension integrates TOON into the Gemini CLI, allowing the AI to handle large datasets while saving up to 45-60% in token usage.
- Token Efficiency: Reduces the character count of large arrays by omitting redundant brackets, braces, and property names.
- Improved Context Management: Fit more data (logs, database results, search results) into the same context window.
- Human & AI Readable: Combines YAML-style indentation with CSV-style tabular layouts.
- Clone this repository or download the source.
- Build the project:
npm install npm run build
- Link it to your Gemini CLI:
gemini extensions link .
Encodes a JSON array or object into TOON format.
- Input:
{ "data": [...] } - Output: A TOON-encoded string.
Decodes a TOON string back into a standard JSON array/object.
- Input:
{ "toon": "..." } - Output: A standard JSON structure.
Standard JSON (Verbose):
[
{"id": 1, "name": "Alice", "role": "admin"},
{"id": 2, "name": "Bob", "role": "user"}
]TOON Tabular (Compact):
[2]{id,name,role}:
1,Alice,admin
2,Bob,user
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.