docs: revamp README with logo, badges, and structure cleanup (#371)
* docs: revamp README with logo, badges, and cleaner structure
- Add centered logo (og-image) and tagline
- Add badges: CI, release version, license, Discord, Homebrew
- Add language links placeholder (fr, zh, ja, ko, es)
- Fix Linux binary filename (gnu -> musl) — fixes #323
- Put Homebrew as recommended install method
- Simplify and reorganize all sections (871 -> ~360 lines)
- Add Discord invite link
- Remove verbose troubleshooting (link to TROUBLESHOOTING.md instead)
- Remove detailed security review section (link to SECURITY.md)
* docs: add translated READMEs (fr, zh, ja, ko, es)
Add localized README files linked from the main README language selector:
- README_fr.md (French)
- README_zh.md (Chinese)
- README_ja.md (Japanese)
- README_ko.md (Korean)
- README_es.md (Spanish)
Each translation includes: installation, quick start, commands overview,
how it works diagram, and links to documentation.
* docs: use rtk-ai org avatar as logo in all READMEs
2026-03-06 12:01:06 +01:00
|
|
|
|
<p align="center">
|
|
|
|
|
|
<img src="https://avatars.githubusercontent.com/u/258253854?v=4" alt="RTK - Rust Token Killer" width="500">
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
|
|
<strong>高性能 CLI 代理,将 LLM token 消耗降低 60-90%</strong>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
|
|
<a href="https://github.com/rtk-ai/rtk/actions"><img src="https://github.com/rtk-ai/rtk/workflows/Security%20Check/badge.svg" alt="CI"></a>
|
|
|
|
|
|
<a href="https://github.com/rtk-ai/rtk/releases"><img src="https://img.shields.io/github/v/release/rtk-ai/rtk" alt="Release"></a>
|
|
|
|
|
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
2026-03-23 10:13:44 +01:00
|
|
|
|
<a href="https://discord.gg/RySmvNF5kF"><img src="https://img.shields.io/discord/1478373640461488159?label=Discord&logo=discord" alt="Discord"></a>
|
docs: revamp README with logo, badges, and structure cleanup (#371)
* docs: revamp README with logo, badges, and cleaner structure
- Add centered logo (og-image) and tagline
- Add badges: CI, release version, license, Discord, Homebrew
- Add language links placeholder (fr, zh, ja, ko, es)
- Fix Linux binary filename (gnu -> musl) — fixes #323
- Put Homebrew as recommended install method
- Simplify and reorganize all sections (871 -> ~360 lines)
- Add Discord invite link
- Remove verbose troubleshooting (link to TROUBLESHOOTING.md instead)
- Remove detailed security review section (link to SECURITY.md)
* docs: add translated READMEs (fr, zh, ja, ko, es)
Add localized README files linked from the main README language selector:
- README_fr.md (French)
- README_zh.md (Chinese)
- README_ja.md (Japanese)
- README_ko.md (Korean)
- README_es.md (Spanish)
Each translation includes: installation, quick start, commands overview,
how it works diagram, and links to documentation.
* docs: use rtk-ai org avatar as logo in all READMEs
2026-03-06 12:01:06 +01:00
|
|
|
|
<a href="https://formulae.brew.sh/formula/rtk"><img src="https://img.shields.io/homebrew/v/rtk" alt="Homebrew"></a>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
|
|
<a href="https://www.rtk-ai.app">官网</a> •
|
|
|
|
|
|
<a href="#安装">安装</a> •
|
|
|
|
|
|
<a href="docs/TROUBLESHOOTING.md">故障排除</a> •
|
|
|
|
|
|
<a href="ARCHITECTURE.md">架构</a> •
|
2026-03-23 10:13:44 +01:00
|
|
|
|
<a href="https://discord.gg/RySmvNF5kF">Discord</a>
|
docs: revamp README with logo, badges, and structure cleanup (#371)
* docs: revamp README with logo, badges, and cleaner structure
- Add centered logo (og-image) and tagline
- Add badges: CI, release version, license, Discord, Homebrew
- Add language links placeholder (fr, zh, ja, ko, es)
- Fix Linux binary filename (gnu -> musl) — fixes #323
- Put Homebrew as recommended install method
- Simplify and reorganize all sections (871 -> ~360 lines)
- Add Discord invite link
- Remove verbose troubleshooting (link to TROUBLESHOOTING.md instead)
- Remove detailed security review section (link to SECURITY.md)
* docs: add translated READMEs (fr, zh, ja, ko, es)
Add localized README files linked from the main README language selector:
- README_fr.md (French)
- README_zh.md (Chinese)
- README_ja.md (Japanese)
- README_ko.md (Korean)
- README_es.md (Spanish)
Each translation includes: installation, quick start, commands overview,
how it works diagram, and links to documentation.
* docs: use rtk-ai org avatar as logo in all READMEs
2026-03-06 12:01:06 +01:00
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
|
|
<a href="README.md">English</a> •
|
|
|
|
|
|
<a href="README_fr.md">Francais</a> •
|
|
|
|
|
|
<a href="README_zh.md">中文</a> •
|
|
|
|
|
|
<a href="README_ja.md">日本語</a> •
|
|
|
|
|
|
<a href="README_ko.md">한국어</a> •
|
|
|
|
|
|
<a href="README_es.md">Espanol</a>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
rtk 在命令输出到达 LLM 上下文之前进行过滤和压缩。单一 Rust 二进制文件,零依赖,<10ms 开销。
|
|
|
|
|
|
|
|
|
|
|
|
## Token 节省(30 分钟 Claude Code 会话)
|
|
|
|
|
|
|
|
|
|
|
|
| 操作 | 频率 | 标准 | rtk | 节省 |
|
|
|
|
|
|
|------|------|------|-----|------|
|
|
|
|
|
|
| `ls` / `tree` | 10x | 2,000 | 400 | -80% |
|
|
|
|
|
|
| `cat` / `read` | 20x | 40,000 | 12,000 | -70% |
|
|
|
|
|
|
| `grep` / `rg` | 8x | 16,000 | 3,200 | -80% |
|
|
|
|
|
|
| `git status` | 10x | 3,000 | 600 | -80% |
|
|
|
|
|
|
| `git diff` | 5x | 10,000 | 2,500 | -75% |
|
|
|
|
|
|
| `cargo test` / `npm test` | 5x | 25,000 | 2,500 | -90% |
|
|
|
|
|
|
| **总计** | | **~118,000** | **~23,900** | **-80%** |
|
|
|
|
|
|
|
|
|
|
|
|
## 安装
|
|
|
|
|
|
|
|
|
|
|
|
### Homebrew(推荐)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
brew install rtk
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 快速安装(Linux/macOS)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Cargo
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cargo install --git https://github.com/rtk-ai/rtk
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 验证
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
rtk --version # 应显示 "rtk 0.27.x"
|
|
|
|
|
|
rtk gain # 应显示 token 节省统计
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 快速开始
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
# 1. 为 Claude Code 安装 hook(推荐)
|
|
|
|
|
|
rtk init --global
|
|
|
|
|
|
|
|
|
|
|
|
# 2. 重启 Claude Code,然后测试
|
|
|
|
|
|
git status # 自动重写为 rtk git status
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 工作原理
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
没有 rtk: 使用 rtk:
|
|
|
|
|
|
|
|
|
|
|
|
Claude --git status--> shell --> git Claude --git status--> RTK --> git
|
|
|
|
|
|
^ | ^ | |
|
|
|
|
|
|
| ~2,000 tokens(原始) | | ~200 tokens | 过滤 |
|
|
|
|
|
|
+-----------------------------------+ +------- (已过滤)-----+----------+
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
四种策略:
|
|
|
|
|
|
|
|
|
|
|
|
1. **智能过滤** - 去除噪音(注释、空白、样板代码)
|
|
|
|
|
|
2. **分组** - 聚合相似项(按目录分文件,按类型分错误)
|
|
|
|
|
|
3. **截断** - 保留相关上下文,删除冗余
|
|
|
|
|
|
4. **去重** - 合并重复日志行并计数
|
|
|
|
|
|
|
|
|
|
|
|
## 命令
|
|
|
|
|
|
|
|
|
|
|
|
### 文件
|
|
|
|
|
|
```bash
|
|
|
|
|
|
rtk ls . # 优化的目录树
|
|
|
|
|
|
rtk read file.rs # 智能文件读取
|
|
|
|
|
|
rtk find "*.rs" . # 紧凑的查找结果
|
|
|
|
|
|
rtk grep "pattern" . # 按文件分组的搜索结果
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Git
|
|
|
|
|
|
```bash
|
|
|
|
|
|
rtk git status # 紧凑状态
|
|
|
|
|
|
rtk git log -n 10 # 单行提交
|
|
|
|
|
|
rtk git diff # 精简 diff
|
|
|
|
|
|
rtk git push # -> "ok main"
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 测试
|
|
|
|
|
|
```bash
|
|
|
|
|
|
rtk test cargo test # 仅显示失败(-90%)
|
|
|
|
|
|
rtk vitest run # Vitest 紧凑输出
|
|
|
|
|
|
rtk pytest # Python 测试(-90%)
|
|
|
|
|
|
rtk go test # Go 测试(-90%)
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 构建 & 检查
|
|
|
|
|
|
```bash
|
|
|
|
|
|
rtk lint # ESLint 按规则分组
|
|
|
|
|
|
rtk tsc # TypeScript 错误分组
|
|
|
|
|
|
rtk cargo build # Cargo 构建(-80%)
|
|
|
|
|
|
rtk ruff check # Python lint(-80%)
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 容器
|
|
|
|
|
|
```bash
|
|
|
|
|
|
rtk docker ps # 紧凑容器列表
|
|
|
|
|
|
rtk docker logs <container> # 去重日志
|
|
|
|
|
|
rtk kubectl pods # 紧凑 Pod 列表
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 分析
|
|
|
|
|
|
```bash
|
|
|
|
|
|
rtk gain # 节省统计
|
|
|
|
|
|
rtk gain --graph # ASCII 图表(30 天)
|
|
|
|
|
|
rtk discover # 发现遗漏的节省机会
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 文档
|
|
|
|
|
|
|
|
|
|
|
|
- **[TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)** - 解决常见问题
|
|
|
|
|
|
- **[INSTALL.md](INSTALL.md)** - 详细安装指南
|
|
|
|
|
|
- **[ARCHITECTURE.md](ARCHITECTURE.md)** - 技术架构
|
|
|
|
|
|
|
|
|
|
|
|
## 贡献
|
|
|
|
|
|
|
|
|
|
|
|
欢迎贡献!请在 [GitHub](https://github.com/rtk-ai/rtk) 上提交 issue 或 PR。
|
|
|
|
|
|
|
2026-03-23 10:13:44 +01:00
|
|
|
|
加入 [Discord](https://discord.gg/RySmvNF5kF) 社区。
|
docs: revamp README with logo, badges, and structure cleanup (#371)
* docs: revamp README with logo, badges, and cleaner structure
- Add centered logo (og-image) and tagline
- Add badges: CI, release version, license, Discord, Homebrew
- Add language links placeholder (fr, zh, ja, ko, es)
- Fix Linux binary filename (gnu -> musl) — fixes #323
- Put Homebrew as recommended install method
- Simplify and reorganize all sections (871 -> ~360 lines)
- Add Discord invite link
- Remove verbose troubleshooting (link to TROUBLESHOOTING.md instead)
- Remove detailed security review section (link to SECURITY.md)
* docs: add translated READMEs (fr, zh, ja, ko, es)
Add localized README files linked from the main README language selector:
- README_fr.md (French)
- README_zh.md (Chinese)
- README_ja.md (Japanese)
- README_ko.md (Korean)
- README_es.md (Spanish)
Each translation includes: installation, quick start, commands overview,
how it works diagram, and links to documentation.
* docs: use rtk-ai org avatar as logo in all READMEs
2026-03-06 12:01:06 +01:00
|
|
|
|
|
|
|
|
|
|
## 许可证
|
|
|
|
|
|
|
|
|
|
|
|
MIT 许可证 - 详见 [LICENSE](LICENSE)。
|