Rtk Compressor
Intelligently compress CLI outputs by removing comments, blanks, and redundancies to reduce token usage by 60-90% while preserving key info.
Latest: v0.1.0
- Initial release of rtk-compressor.
- Compresses CLI command outputs to reduce token usage by 60-90%.
- Removes comments, blank lines, and boilerplate code.
- Aggregates similar items and preserves core information.
- Supports multiple output types: ls/tree commands, file contents, test results, and JSON/logs.
- Usable both as a CLI tool and as a Python module.
RTK Compressor Skill
智能压缩 CLI 命令输出,降低 token 消耗 60-90%。
功能
- 移除注释、空行、样板代码
- 聚合相似项
- 保留核心信息
- 支持多种输出类型:ls/tree、cat/read、测试输出、JSON/日志
使用方式
# 直接压缩输出
echo "输出内容" | rtk-compressor
# 或在代码中调用
python3 -m rtk_compressor compress "原始输出"
压缩效果
| 命令类型 | 原始 tokens | 压缩后 | 节省 |
|---|---|---|---|
| ls/tree | 2000 | 400 | 80% |
| cat/read | 40000 | 12000 | 70% |
| 测试输出 | 25000 | 2500 | 90% |
安装
pip install rtk-compressor
