llm-tools

module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT

README ΒΆ

llm-tools

The missing standard library for Agentic Workflows. Native Go. Single Binary. 100x Faster than Python.

Go Version License Build Status Release

⚑ Why this exists

LLM Agents need to be fast. Waiting 400ms for a Python script to spin up just to read a file kills the flow of an autonomous loop.

llm-tools is a suite of high-performance, statically compiled tools designed to be the "hands" of your AI agent. It includes a native MCP Server for instant integration with Claude Desktop and Gemini.

The "Rewrite it in Go" Effect

I benchmarked this against my original Python implementation on a real-world codebase (21k files). The difference was massive.

Operation Action Go (Native) Python Speedup
MCP Handshake Server Initialization 4ms 408ms πŸš€ 102x
Startup CLI Help 6ms 113ms 19x
Multigrep Search 5 keywords (150k hits) 1.47s 20.7s 14x
Hash SHA256 Verification 6ms 65ms 10.8x

Benchmarks run on M4 Pro 64gb macOS Darwin (arm64), 2025-12-26.

🚫 No Python Venv Hell

Deploying Python-based agent tools is painful. You have to manage virtual environments, pip install dependencies, and worry about version conflicts. llm-tools is a single static binary. It works instantly on any machineβ€”no setup required.

πŸ€– Standardized LLM Orchestration

llm-tools isn't just for reading files; it's a reliability layer for your agent's cognitive functions.

The prompt command acts as a Universal Adapter for almost any LLM CLI (gemini, claude, ollama, openai, octo). It wraps them with:

  • Retries & Backoff: Automatically retries failed API calls.
  • Caching: Caches expensive results to disk (--cache-ttl 3600).
  • Validation: Ensures output meets criteria (--min-length, --must-contain) or fails fast.
# Reliable, cached, validated prompt execution
llm-support prompt \
  --prompt "Analyze this error log" \
  --llm gemini \
  --retries 3 \
  --cache \
  --min-length 50

⚑ Advanced Workflows

Parallel Batch Processing (foreach)

Run prompts across thousands of files in parallel without writing a loop script. Perfect for migrations, code reviews, or documentation generation.

# Review all Go files in parallel (4 concurrent workers)
llm-support foreach \
  --glob "src/**/*.go" \
  --template templates/code-review.md \
  --llm claude \
  --parallel 4 \
  --output-dir ./reviews

πŸš€ Quick Start

Pre-built Binaries

Recommended: Download the latest binary for your OS. No dependencies required.

Platform Download
macOS (Apple Silicon) llm-tools-darwin-arm64.tar.gz
macOS (Intel) llm-tools-darwin-amd64.tar.gz
Linux (AMD64) llm-tools-linux-amd64.tar.gz
Windows llm-tools-windows-amd64.zip
Installation (Go)
go install github.com/samestrin/llm-tools/cmd/llm-support@latest
go install github.com/samestrin/llm-tools/cmd/llm-clarification@latest

πŸ’‘ Common Recipes

See what's possible with a single line of code:

# Find all TODOs and FIXMEs (Fast grep)
llm-support grep "TODO|FIXME" . -i -n

# Show project structure (3 levels deep)
llm-support tree --path . --depth 3

# Search for multiple definitions in parallel (Token optimized)
llm-support multigrep --path src/ --keywords "handleSubmit,validateForm" -d

# Extract data from JSON without jq
llm-support json query response.json ".users[0]"

# Calculate values safely
llm-support math "round(42/100 * 75, 2)"

# Generate config from template
llm-support template config.tpl --var domain=example.com --var port=8080

# Hash all Go files (Integrity check)
llm-support hash internal/**/*.go -a sha256

# Count completed tasks in a sprint plan
llm-support count --mode checkboxes --path sprint/plan.md -r

# Detect project stack
llm-support detect --path .

# Extract only relevant context (AI-filtered)
llm-support extract-relevant --path docs/ --context "Authentication Config"

# Summarize directory content for context window (Token optimized)
llm-support summarize-dir src/ --format outline --max-tokens 2000

# Batch process files with a template (LLM-driven)
llm-support foreach --files "*.ts" --template refactor.md --parallel 4

πŸ“š Documentation

Detailed references for all 40+ commands:

🧠 How It Works

The Loop:

  1. Agent receives a task.
  2. llm-support provides fast codebase context (files, structure, search results).
  3. llm-clarification recalls past decisions ("Use Jest, not Mocha") to prevent regression.
  4. Agent generates code with full context.
sequenceDiagram
    participant U as πŸ‘€ User
    participant A as πŸ€– Agent
    participant S as ⚑ Support
    participant M as 🧠 Memory

    U->>A: /execute-sprint
    
    rect rgb(30, 30, 30)
        note right of A: Fast Context
        A->>S: multiexists, count, report
        S-->>A: βœ“ Context Loaded (22ms)
    end
    
    rect rgb(50, 20, 20)
        note right of A: Long-Term Memory
        A->>M: match-clarification
        M-->>A: ⚠ RECALL: "Use Jest"
    end

License

MIT License

Directories ΒΆ

Path Synopsis
cmd
llm-clarification command
Package main is the entry point for the llm-clarification CLI tool.
Package main is the entry point for the llm-clarification CLI tool.
llm-support command
llm-support-mcp command
internal
clarification/commands
Package commands implements CLI commands for llm-clarification.
Package commands implements CLI commands for llm-clarification.
clarification/tracking
Package tracking implements data types and operations for clarification tracking files.
Package tracking implements data types and operations for clarification tracking files.
support/testhelpers
Package testhelpers provides testing utilities for golden file testing.
Package testhelpers provides testing utilities for golden file testing.
pkg
llmapi
Package llmapi provides an OpenAI-compatible API client with retry logic, system message support, and concurrent request handling.
Package llmapi provides an OpenAI-compatible API client with retry logic, system message support, and concurrent request handling.

Jump to

Keyboard shortcuts

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