rtk

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package rtk is an in-process port of RTK (Rust Token Killer). It intercepts tool output from BashTool and compresses it before the agent sees it, saving 60-90% of tokens on common dev operations.

Architecture mirrors RTK's Rust source at /Volumes/Engineering/Icehunter/rtk/src/:

  • registry.go — command classification (ports discover/registry.rs)
  • filters/ — per-category output transformers (ports cmds/*)
  • ansi.go — ANSI escape stripping (ports core/utils.rs)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClassified

func IsClassified(cmd string) bool

IsClassified returns true if the command is handled by a RTK filter rule. Used by /rtk discover to find unhandled commands.

Types

type Result

type Result struct {
	Original   string
	Filtered   string
	SavedBytes int
	SavingsPct float64
	Category   string
}

Result is returned by Filter.

func Filter

func Filter(cmd, output string) Result

Filter applies RTK compression to the output of the given shell command. cmd is the full command string; output is its combined stdout+stderr. Returns the (possibly compressed) output and metadata.

Directories

Path Synopsis
Package track records RTK filter statistics in a SQLite database.
Package track records RTK filter statistics in a SQLite database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL