|
1 | | -# RTK for Command Code CLI |
2 | | - |
3 | | -[RTK](https://github.com/rtk-ai/rtk) (Rust Token Killer) integration for |
4 | | -[Command Code CLI](https://commandcode.ai) — the coding agent that continuously |
5 | | -learns your taste of writing code. |
6 | | - |
7 | | -**Save 60-90% LLM tokens** on every shell command your agent runs. |
8 | | - |
9 | | -## How It Works |
10 | | - |
11 | | -Command Code CLI reads `~/.commandcode/AGENTS.md` and injects it into the system |
12 | | -prompt for every session. This repository provides that AGENTS.md file, teaching |
13 | | -Command Code to prefix shell commands with `rtk` for automatic output compression. |
14 | | - |
15 | | -``` |
16 | | -Without RTK: With RTK: |
17 | | - |
18 | | -git status (2,000 tokens) rtk git status (200 tokens) |
19 | | -cargo test (25,000 tokens) rtk cargo test (2,500 tokens) |
20 | | -ls -la (800 tokens) rtk ls (150 tokens) |
21 | | -``` |
22 | | - |
23 | | -## Installation |
24 | | - |
25 | | -### Prerequisites |
26 | | - |
27 | | -- [Command Code CLI](https://commandcode.ai) — `npm install -g command-code` |
28 | | -- [RTK](https://github.com/rtk-ai/rtk#installation) — `brew install rtk` or download from releases |
29 | | - |
30 | | -### Method 1: Skill (Recommended) |
31 | | - |
32 | | -```bash |
33 | | -cmd skills add Coding-Dev-Tools/rtk-command-code |
34 | | -``` |
35 | | - |
36 | | -This installs the RTK skill which auto-injects instructions into every session. |
37 | | - |
38 | | -### Method 2: Manual AGENTS.md |
39 | | - |
40 | | -```bash |
41 | | -# macOS / Linux |
42 | | -curl -fsSL https://raw.githubusercontent.com/Coding-Dev-Tools/rtk-command-code/main/install.sh | sh |
43 | | - |
44 | | -# Windows (PowerShell) |
45 | | -iwr -Uri https://raw.githubusercontent.com/Coding-Dev-Tools/rtk-command-code/main/install.ps1 | iex |
46 | | -``` |
47 | | - |
48 | | -Or clone and run the installer: |
49 | | - |
50 | | -```bash |
51 | | -git clone https://github.com/Coding-Dev-Tools/rtk-command-code.git |
52 | | -cd rtk-command-code |
53 | | -chmod +x install.sh && ./install.sh # Linux/macOS |
54 | | -.\install.ps1 # Windows |
55 | | -``` |
56 | | - |
57 | | -### Method 3: Manual Copy |
58 | | - |
59 | | -Copy `AGENTS.md` to `~/.commandcode/AGENTS.md`: |
60 | | - |
61 | | -```bash |
62 | | -cp AGENTS.md ~/.commandcode/AGENTS.md |
63 | | -cp references/commands.md ~/.commandcode/references/commands.md |
64 | | -cp references/analytics.md ~/.commandcode/references/analytics.md |
65 | | -``` |
66 | | - |
67 | | -## What It Teaches the Agent |
68 | | - |
69 | | -Once installed, Command Code will automatically use RTK-optimized commands: |
70 | | - |
71 | | -| Category | Without RTK | With RTK | Savings | |
72 | | -|---|---|---|---| |
73 | | -| Git | `git status` | `rtk git status` | ~80% | |
74 | | -| Files | `cat file.rs` | `rtk read file.rs` | ~70% | |
75 | | -| Search | `grep -r "pattern"` | `rtk grep "pattern"` | ~80% | |
76 | | -| Tests | `cargo test` | `rtk cargo test` | ~90% | |
77 | | -| Build | `cargo build` | `rtk cargo build` | ~80% | |
78 | | -| Docker | `docker ps` | `rtk docker ps` | ~80% | |
79 | | -| GitHub | `gh pr list` | `rtk gh pr list` | ~80% | |
80 | | - |
81 | | -See [references/commands.md](references/commands.md) for the full list. |
82 | | - |
83 | | -## Verify |
84 | | - |
85 | | -```bash |
86 | | -rtk gain # Check token savings |
87 | | -rtk gain --graph # Visual savings chart |
88 | | -``` |
89 | | - |
90 | | -After running a few commands through Command Code, `rtk gain` will show the |
91 | | -accumulated savings. |
92 | | - |
93 | | -## Files |
94 | | - |
95 | | -``` |
96 | | -rtk-command-code/ |
97 | | -├── SKILL.md # Skill definition (install via cmd skills add) |
98 | | -├── AGENTS.md # Main instruction file with @import references |
99 | | -├── references/ |
100 | | -│ ├── commands.md # Full RTK command reference table |
101 | | -│ └── analytics.md # How to read rtk gain output |
102 | | -├── install.ps1 # Windows installer |
103 | | -├── install.sh # Linux/macOS installer |
104 | | -└── README.md # This file |
105 | | -``` |
106 | | - |
107 | | -## Upstream |
108 | | - |
109 | | -This integration was designed to be submitted as a PR to the |
110 | | -[rtk-ai/rtk](https://github.com/rtk-ai/rtk) repository to add Command Code CLI |
111 | | -as a supported agent. |
112 | | - |
113 | | -## License |
114 | | - |
115 | | -Apache 2.0 — same as [RTK](https://github.com/rtk-ai/rtk). |
| 1 | +# RTK for Command Code CLI |
| 2 | + |
| 3 | +[RTK](https://github.com/rtk-ai/rtk) (Rust Token Killer) integration for |
| 4 | +[Command Code CLI](https://commandcode.ai) — the coding agent that continuously |
| 5 | +learns your taste of writing code. |
| 6 | + |
| 7 | +**Save 60-90% LLM tokens** on every shell command your agent runs. |
| 8 | + |
| 9 | +## How It Works |
| 10 | + |
| 11 | +Command Code CLI reads `~/.commandcode/AGENTS.md` and injects it into the system |
| 12 | +prompt for every session. This repository provides that AGENTS.md file, teaching |
| 13 | +Command Code to prefix shell commands with `rtk` for automatic output compression. |
| 14 | + |
| 15 | +``` |
| 16 | +Without RTK: With RTK: |
| 17 | + |
| 18 | +git status (2,000 tokens) rtk git status (200 tokens) |
| 19 | +cargo test (25,000 tokens) rtk cargo test (2,500 tokens) |
| 20 | +ls -la (800 tokens) rtk ls (150 tokens) |
| 21 | +``` |
| 22 | + |
| 23 | +## Installation |
| 24 | + |
| 25 | +### Prerequisites |
| 26 | + |
| 27 | +- [Command Code CLI](https://commandcode.ai) — `npm install -g command-code` |
| 28 | +- [RTK](https://github.com/rtk-ai/rtk#installation) — `brew install rtk` or download from releases |
| 29 | + |
| 30 | +### Method 1: Skill (Recommended) |
| 31 | + |
| 32 | +```bash |
| 33 | +cmd skills add Coding-Dev-Tools/rtk-command-code |
| 34 | +``` |
| 35 | + |
| 36 | +This installs the RTK skill which auto-injects instructions into every session. |
| 37 | + |
| 38 | +### Method 2: Manual AGENTS.md |
| 39 | + |
| 40 | +```bash |
| 41 | +# macOS / Linux |
| 42 | +curl -fsSL https://raw.githubusercontent.com/Coding-Dev-Tools/rtk-command-code/main/install.sh | sh |
| 43 | + |
| 44 | +# Windows (PowerShell) |
| 45 | +iwr -Uri https://raw.githubusercontent.com/Coding-Dev-Tools/rtk-command-code/main/install.ps1 | iex |
| 46 | +``` |
| 47 | + |
| 48 | +Or clone and run the installer: |
| 49 | + |
| 50 | +```bash |
| 51 | +git clone https://github.com/Coding-Dev-Tools/rtk-command-code.git |
| 52 | +cd rtk-command-code |
| 53 | +chmod +x install.sh && ./install.sh # Linux/macOS |
| 54 | +.\install.ps1 # Windows |
| 55 | +``` |
| 56 | + |
| 57 | +### Method 3: Manual Copy |
| 58 | + |
| 59 | +Copy `AGENTS.md` to `~/.commandcode/AGENTS.md`: |
| 60 | + |
| 61 | +```bash |
| 62 | +cp AGENTS.md ~/.commandcode/AGENTS.md |
| 63 | +cp references/commands.md ~/.commandcode/references/commands.md |
| 64 | +cp references/analytics.md ~/.commandcode/references/analytics.md |
| 65 | +``` |
| 66 | + |
| 67 | +## What It Teaches the Agent |
| 68 | + |
| 69 | +Once installed, Command Code will automatically use RTK-optimized commands: |
| 70 | + |
| 71 | +| Category | Without RTK | With RTK | Savings | |
| 72 | +|---|---|---|---| |
| 73 | +| Git | `git status` | `rtk git status` | ~80% | |
| 74 | +| Files | `cat file.rs` | `rtk read file.rs` | ~70% | |
| 75 | +| Search | `grep -r "pattern"` | `rtk grep "pattern"` | ~80% | |
| 76 | +| Tests | `cargo test` | `rtk cargo test` | ~90% | |
| 77 | +| Build | `cargo build` | `rtk cargo build` | ~80% | |
| 78 | +| Docker | `docker ps` | `rtk docker ps` | ~80% | |
| 79 | +| GitHub | `gh pr list` | `rtk gh pr list` | ~80% | |
| 80 | + |
| 81 | +See [references/commands.md](references/commands.md) for the full list. |
| 82 | + |
| 83 | +## Verify |
| 84 | + |
| 85 | +```bash |
| 86 | +rtk gain # Check token savings |
| 87 | +rtk gain --graph # Visual savings chart |
| 88 | +``` |
| 89 | + |
| 90 | +After running a few commands through Command Code, `rtk gain` will show the |
| 91 | +accumulated savings. |
| 92 | + |
| 93 | +## Files |
| 94 | + |
| 95 | +``` |
| 96 | +rtk-command-code/ |
| 97 | +├── SKILL.md # Skill definition (install via cmd skills add) |
| 98 | +├── AGENTS.md # Main instruction file with @import references |
| 99 | +├── references/ |
| 100 | +│ ├── commands.md # Full RTK command reference table |
| 101 | +│ └── analytics.md # How to read rtk gain output |
| 102 | +├── install.ps1 # Windows installer |
| 103 | +├── install.sh # Linux/macOS installer |
| 104 | +└── README.md # This file |
| 105 | +``` |
| 106 | + |
| 107 | +## Upstream |
| 108 | + |
| 109 | +This integration was designed to be submitted as a PR to the |
| 110 | +[rtk-ai/rtk](https://github.com/rtk-ai/rtk) repository to add Command Code CLI |
| 111 | +as a supported agent. |
| 112 | + |
| 113 | +## License |
| 114 | + |
| 115 | +Apache 2.0 — same as [RTK](https://github.com/rtk-ai/rtk). |
0 commit comments