Skip to content

voska/pi-rtk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

pi-rtk

RTK (Rust Token Killer) integration for Pi — reduces LLM token consumption by 60-90% on common dev commands.

RTK compresses CLI output before it reaches your AI agent's context window, enabling better reasoning, longer sessions, and lower costs.

Install

pi install npm:pi-rtk

Or via git:

pi install git:github.com/voska/pi-rtk

Prerequisites

RTK must be installed on your system:

cargo install rtk
# or
brew install rtk-ai/tap/rtk

Requires rtk >= 0.23.0.

How it works

The extension hooks into Pi's tool_call event. When the model invokes the bash tool, the command is passed through rtk rewrite — RTK's built-in command rewriter. If RTK has a compressed equivalent (e.g. git statusrtk git status), the command is transparently replaced before execution.

All rewrite logic lives in the RTK binary. This extension is a thin shim — no rules to maintain, always in sync with the latest RTK release.

What gets rewritten

RTK handles 40+ commands including:

  • Git: status, diff, log, show, branch, stash
  • GitHub CLI: pr, issue, run, release
  • JS/TS: pnpm, npm, vitest, tsc, eslint, prettier, playwright, prisma
  • Rust: cargo test, build, clippy, check
  • Python: pytest, ruff, mypy, pip
  • Go: go build, test, vet, golangci-lint
  • Containers: docker, kubectl
  • Infrastructure: aws, psql, terraform
  • File ops: ls, tree, find, grep, curl, wget

Run rtk --help for the full list.

Token savings

Run rtk gain in your terminal to see cumulative savings:

$ rtk gain
  Total commands: 3,241
  Tokens saved:   24.6M (83.7%)

Uninstall

pi remove npm:pi-rtk

License

MIT

About

RTK (Rust Token Killer) integration for Pi — reduces LLM token consumption by 60-90%

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors