Skip to content

nobane/tldr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tldr

Compress command output before it reaches your LLM. Save up to 99% of tokens without losing the signal.

cargo test 2>&1 | tldr "Did tests pass? Return PASS or FAIL with failing test names."
FAIL: test_auth_timeout, test_db_migration

Install

cargo install --path crates/tldr
cargo install --path crates/tldr-web

Requires Ollama running locally with a model pulled:

ollama pull gemma4:26b

Then configure:

tldr config model gemma4:26b
tldr config thinking false

Usage

Pipe any command's output through tldr with a question:

cargo build 2>&1 | tldr "Did it compile? Any errors?"
git diff 2>&1 | tldr "What changed? One-line summary per file."
cargo test 2>&1 | tldr "Which tests failed? Include expected vs actual."
npm audit 2>&1 | tldr "List vulnerabilities with severity and package name."
kubectl get pods 2>&1 | tldr "List pods with ready count, status, and restarts."

How it works

  1. Reads stdin (your command output)
  2. Strips ANSI codes, normalizes whitespace
  3. Sends it to a local LLM with your question as a compression prompt
  4. Returns only the answer — short, direct, no markdown

Configuration

tldr config                    # show all settings
tldr config model gemma4:26b   # change model
tldr config provider ollama    # change provider
tldr config thinking false     # disable thinking (recommended for 26b+)

Settings persist to ~/.config/tldr/config.json (Linux/Mac) or %APPDATA%\tldr\config.json (Windows).

CLI flags override config:

echo "..." | tldr --model gemma4:26b --provider ollama "summarize"

Environment variables override config (overridden by CLI flags):

TLDR_PROVIDER, TLDR_MODEL, TLDR_HOST,
TLDR_API_KEY, TLDR_TIMEOUT_MS, TLDR_THINKING

Providers

Provider Default Host Transport
ollama (default) http://127.0.0.1:11434 Ollama API
openai https://api.openai.com/v1 OpenAI
lmstudio http://127.0.0.1:1234/v1 OpenAI-compatible
jan http://127.0.0.1:1337/v1 OpenAI-compatible
localai http://127.0.0.1:8080/v1 OpenAI-compatible
vllm http://127.0.0.1:8000/v1 OpenAI-compatible
openai-compatible OpenAI-compatible
sglang OpenAI-compatible
llama.cpp OpenAI-compatible
mlx-lm OpenAI-compatible
docker-model-runner http://127.0.0.1:12434/engines/v1 OpenAI-compatible

Run Logging

Every invocation is logged to ~/.tldr/logs/ as a JSON file:

{
  "timestamp": "2026-04-05T10:00:00Z",
  "question": "Did tests pass?",
  "provider": "ollama",
  "model": "gemma4:26b",
  "raw_input": "running 8 tests\ntest test_add ... ok\n...",
  "raw_input_bytes": 1664,
  "summary": "FAIL: test_auth_timeout, test_db_migration",
  "summary_bytes": 42,
  "compression_ratio": 0.97,
  "duration_ms": 450,
  "exit_code": 0,
  "cwd": "/home/user/myproject"
}

Web UI

View your run history in the browser:

tldr-web                                    # serves on http://127.0.0.1:3141
tldr-web --port 8080                        # custom port
tldr-web --bind 127.0.0.1,10.0.0.5         # multi-interface

Dark-themed dashboard with stats, searchable run table, and detail views showing raw input vs summary side-by-side.

Project Structure

crates/
├── tldr/             # CLI binary
│   └── src/
│       ├── main.rs       # CLI entry + pipeline
│       ├── config.rs     # Cross-platform config, validation
│       ├── provider.rs   # Ollama + OpenAI transports
│       ├── prompt.rs     # LLM prompt template
│       ├── text.rs       # Normalization, bad distillation detection
│       ├── logging.rs    # JSON run logging
│       └── spinner.rs    # Progress indicator
└── tldr-web/         # Web UI binary
    └── src/
        ├── main.rs       # Web server entry
        ├── server.rs     # Axum API routes
        └── web/          # Embedded frontend (HTML/CSS/JS)

Acknowledgments

Inspired by distill (TypeScript) by Samuel Faj.

About

Too Long, Didn't Read: Compress command output before it reaches your LLM. Save up to 99% of tokens without losing the signal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors