Skip to main content

codetheory

A zero-dependency, multi-provider, cross-platform CLI AI agent with local GPU tuning (Ollama), native Anthropic /v1/messages & OpenAI-compatible support, isolated subagents, per-session chat history, and built-in security guardrails.

Features

  • Zero Runtime Dependencies: Pure Python 3.10+ standard library (urllib, json, subprocess, difflib).
  • 15+ Providers: Ollama (with WSL2 $\rightarrow$ Windows host auto-discovery & 4GB VRAM tuning), LM Studio, OpenAI, Anthropic (native /v1/messages), Gemini, Groq, OpenRouter, Mistral, DeepSeek, xAI, Together, Fireworks, Cerebras, NVIDIA NIM, or any custom OpenAI-compatible URL.
  • Cross-Shell & Multi-OS: Auto-detects bash, zsh, fish, sh, pwsh, powershell, and cmd, plus dnf, apt, pacman, zypper, apk, brew, winget, choco, pip, and npm.
  • Full Tooling + Subagents: read_file, write_file (atomic + diff preview), edit_file (unified diff preview), list_dir, grep_search, find_files, run_command, install_package, delete_path (recoverable trash + mandatory approval), web_search, fetch_url, and spawn_subagent.
  • Anthropic-Spec Agentic Loop: Enforces max_turns, handles end_turn / max_tokens stops, and uses LoopDetector to prevent self-repeating tool loops and error spirals.
  • Security Hardening: Automatic API key redaction in tool outputs/logs, SSRF blocking for cloud metadata/link-local IPs, protected OS path guards, and destructive/RCE command approval gates.
  • Interactive & Headless Modes:
    • Interactive REPL with /setup, /providers, /provider [name|#], /key, /models, /settings, /history, /auto, /think, /gpu, and Tab autocomplete.
    • Headless pipe/CI mode: codetheory -p "your prompt" or git diff | codetheory -p "review this".
    • Auto-loads project rules from AGENT.md or .agentrules in the current directory.

Installation

pip install -e .
# or with pipx / uv:
pipx install .
uv tool install .

Quick Start

# Interactive mode
codetheory

# Headless / pipe mode
codetheory -p "summarize TODOs in src/"
git diff | codetheory -p "review this diff for bugs"

Metadata

Release files for codetheory 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codetheory 0.1.2
File Size Uploaded Provenance Actions
codetheory-0.1.2.tar.gz 54.3 kB Without provenance Details for codetheory-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codetheory 0.1.2
File Interpreter ABI Platform Actions
codetheory-0.1.2-py3-none-any.whl Python 3 none any Details for codetheory-0.1.2-py3-none-any.whl

Total release size: 108.5 kB

Release files / codetheory-0.1.2.tar.gz

Download URL codetheory-0.1.2.tar.gz
Size 54.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0a44a7c3c9310bcef1c31ed2278098864c5118fbf1b80e6d7f6eb2f9477a1a39
BLAKE2b-256 checksum
How to use checksums
78e94635d3d8a08d844ad75eab882d1fb5f8f0e52f8f5ca33f5fff00b6c79afb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / codetheory-0.1.2-py3-none-any.whl

Download URL codetheory-0.1.2-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fadc77b010a758fa6826957674f61e7edddf9593c436325bc0035d6a5c9f2e4a
BLAKE2b-256 checksum
How to use checksums
ea071a8c377f456775df93a405c6cfe9ed4f82f1d555a3826864a028773314f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for codetheory 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page