Skip to content

rohan3008/erabot-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

erabot

Find LLM cost waste in any codebase. Open source.

erabot is a command-line tool that scans your code for LLM API call sites, audits them against pricing + downgrade heuristics, and writes an agent-instructions.md your coding agent can apply in one command.

pip install erabot

# Scan a file or directory locally — no network
erabot scan ./src

# Run the full audit (uploads to api.erabot.ai, returns agent-instructions.md)
export ERABOT_API_KEY="erabot_..."   # free at https://erabot.ai
erabot audit ./src

# Apply via Claude Code
erabot apply

What it detects

Tree-sitter based static analysis. Detects LLM SDK call sites with the model, provider, streaming flag, tools, and token usage hints. Across:

Languages Providers / Frameworks
Python OpenAI, Anthropic, Google Gemini, LangChain, LlamaIndex, LiteLLM
TypeScript OpenAI, Anthropic, Google, Vercel AI SDK
JavaScript OpenAI, Anthropic, Google

F1=1.00 across 105 OSS repos in our eval corpus on detection accuracy.

What's open vs. closed

Component Status Where
Tree-sitter scanner Open (MIT) packages/scanner/
erabot CLI Open (MIT) packages/cli/
Audit engine (Gemini + RAG) Closed api.erabot.ai
Pricing tables + downgrade map Closed api.erabot.ai
Dashboard, billing, team features Closed erabot.ai
Helicone / Langfuse runtime importers Closed api.erabot.ai

The split is intentional: the scanner is commodity infrastructure (tree-sitter patterns) and benefits from open contribution. The audit prompts + RAG knowledge base are the IP, and they stay in the cloud service so we can fund ongoing development without subscriptions for hobbyists.

Install

pip install erabot

Or install the scanner alone (no CLI, no API key):

pip install erabot-scanner

Usage

erabot scan

Local-only, no network. Prints a table by default; pass --format json for machine-readable output:

erabot scan ./src
erabot scan ./app.py --format json | jq

erabot audit

Uploads detected call sites to api.erabot.ai, runs the full Gemini-backed audit, and writes agent-instructions.md to the current directory:

export ERABOT_API_KEY="erabot_..."   # https://erabot.ai/signup
erabot audit ./src
# → ✓ Wrote 8,432 bytes to agent-instructions.md

erabot apply

Wraps claude-code apply agent-instructions.md:

erabot apply

Requires the claude-code CLI in your PATH. See docs.claude.com/claude-code.

Use the scanner directly (Python)

from erabot_scanner import scan_files

findings = scan_files([
    {"path": "app.py", "content": open("app.py").read()},
])
for f in findings:
    print(f["file_path"], f["line"], f.get("provider"), f.get("model"))

Contributing

See CONTRIBUTING.md. Check the "good first issue" label for starter tasks.

License

MIT.


Built by @rohan3008 and contributors. Questions: github.com/rohan3008/erabot-cli/issues.

About

Open-source LLM cost scanner. Finds token waste in any codebase.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages