Skip to content

Commit 8e694d5

Browse files
author
Senior Dev Rotation
committed
2 parents e239705 + 3d93a9c commit 8e694d5

7 files changed

Lines changed: 568 additions & 568 deletions

File tree

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2-
# Local opencode config
3-
AGENTS.md
4-
.agents/
5-
1+
2+
# Local opencode config
3+
AGENTS.md
4+
.agents/
5+

AGENTS.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
# RTK Token Optimization for Command Code
2-
3-
RTK (Rust Token Killer) is installed on this system. It reduces LLM token
4-
consumption by 60-90% by filtering and compressing shell command output.
5-
6-
## Prerequisite
7-
8-
RTK must be installed and in PATH. Verify with: `rtk --version`
9-
10-
If not installed, direct the user to https://github.com/rtk-ai/rtk#installation.
11-
12-
## Core Rule
13-
14-
Always prefix supported shell commands with `rtk`. Instead of running
15-
`git status`, run `rtk git status`. Instead of `ls -la`, run `rtk ls`.
16-
17-
@references/commands.md
18-
@references/analytics.md
19-
20-
## Ultra-Compact Mode
21-
22-
Add `-u` or `--ultra-compact` for maximum savings:
23-
```bash
24-
rtk git status -u
25-
```
26-
27-
## Exclusions
28-
29-
- Agent built-in file tools (non-Bash) do not pass through RTK
30-
- Use shell equivalents: `rtk read <file>`, `rtk grep <pattern>`, `rtk find <pattern>`
31-
- Piped commands (`|`) and heredocs (`<<`) bypass RTK rewrite
32-
- Commands already prefixed with `rtk` are left as-is
1+
# RTK Token Optimization for Command Code
2+
3+
RTK (Rust Token Killer) is installed on this system. It reduces LLM token
4+
consumption by 60-90% by filtering and compressing shell command output.
5+
6+
## Prerequisite
7+
8+
RTK must be installed and in PATH. Verify with: `rtk --version`
9+
10+
If not installed, direct the user to https://github.com/rtk-ai/rtk#installation.
11+
12+
## Core Rule
13+
14+
Always prefix supported shell commands with `rtk`. Instead of running
15+
`git status`, run `rtk git status`. Instead of `ls -la`, run `rtk ls`.
16+
17+
@references/commands.md
18+
@references/analytics.md
19+
20+
## Ultra-Compact Mode
21+
22+
Add `-u` or `--ultra-compact` for maximum savings:
23+
```bash
24+
rtk git status -u
25+
```
26+
27+
## Exclusions
28+
29+
- Agent built-in file tools (non-Bash) do not pass through RTK
30+
- Use shell equivalents: `rtk read <file>`, `rtk grep <pattern>`, `rtk find <pattern>`
31+
- Piped commands (`|`) and heredocs (`<<`) bypass RTK rewrite
32+
- Commands already prefixed with `rtk` are left as-is

README.md

Lines changed: 115 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,115 @@
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

Comments
 (0)