Skip to main content

🔍 ArgusTerm

An OS-aware AI terminal copilot. ArgusTerm watches your shell for failed commands, harvests OS state, captures compiler stderr silently, analyzes blast radius, and uses Gemini 3.6 Flash to iteratively suggest and apply fixes.

Python 3.10+ Powered by Gemini License: MIT


✨ Key Features

Feature Description
🩺 OS State Harvesting Inspects active ports, top processes, git status, and directory context
💥 Blast-Radius Analysis Categorizes command danger (LOW → CRITICAL) before execution
🧠 Iterative Auto-Retry Diagnoses errors, applies fixes (sed, pip), and automatically reruns the original command until it passes
📸 Diagnostic Re-run Silently recaptures stderr for deterministic tools (g++, python) to give AI full context
🎨 Rich TUI Beautiful terminal panels, tables, and interactive prompts
🪝 Bulletproof Hooks Generates an isolated python runner script to bypass shell environment pollution

🚀 Quickstart

1. Install

pip install argus-term

2. Set API Key

export GEMINI_API_KEY="your-key-here"

Get a key at https://aistudio.google.com/app/apikey.

3. Install Shell Hook

argus install-hook
source ~/.zshrc   # or ~/.bashrc

4. Run a Health Check

argus doctor

🛠️ Commands

argus fix "<command>" <exit_code>

Manually diagnose a failed command:

argus fix "git pussh origin main" 1

This will:

  1. Harvest current OS state (ports, git, processes)
  2. Analyze blast radius of the suggested fix
  3. Call Gemini 3.6 Flash for diagnosis
  4. Display a Rich TUI panel with the explanation
  5. Prompt you to execute the fix immediately

argus doctor

Verify all dependencies and configuration:

argus doctor

argus install-hook

Append the shell hook to your rc file:

argus install-hook          # Auto-detects shell
argus install-hook --shell bash
argus install-hook --shell zsh

🪝 How Shell Hooks Work

After argus install-hook, your shell calls argus fix automatically after every failed command (exit code ≠ 0). The hook is non-blocking — it only fires when there's an error, and runs in the foreground for interactive diagnosis.

Zsh Hook (.zshrc)

# ArgusTerm hook — auto-appended
source ~/.config/argus/argus.zsh

Bash Hook (.bashrc)

# ArgusTerm hook — auto-appended
source ~/.config/argus/argus.bash

📐 Architecture

Shell Failure
     │
     ▼
argus fix "<cmd>" <exit_code>
     │
     ├──► OSHarvester.gather_context()     ← ports, git, processes, files
     │
     ├──► BlastRadiusAnalyzer.analyze()    ← danger level + affected resources
     │
     ├──► Diagnostic Re-run                ← captures stderr silently
     │
     └──► ModelRouter.diagnose()
              │
              ├── Tier 1: Rule Filter      ← typos, missing sudo (instant)
              └── Tier 2: Gemini 3.6 Flash ← structured JSON diagnosis + iterative retry loop

⚙️ Configuration

Environment Variable Purpose Default
GEMINI_API_KEY Gemini API key (required) —
ARGUS_MODEL Override Gemini model gemini-3.6-flash
ARGUS_MAX_FILES Max files to list in context 30
ARGUS_SKIP_GEMINI Skip cloud calls (rule-only mode) false

📄 License

MIT © ArgusTerm Contributors

Metadata

Release files for argus-term 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 argus-term 0.1.2
File Size Uploaded Provenance
argus_term-0.1.2.tar.gz 24.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 53.0 kB

Release files / argus_term-0.1.2.tar.gz

Download URL argus_term-0.1.2.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8a90c8d422613ee55bce751e1a6ce50ed13485196be98ebf2e7595b004ac3489
BLAKE2b-256 checksum
How to use checksums
ca34bde04b82606c42917bf76de32d4bf478842d0166c66baf5464eda52198cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

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

Download URL argus_term-0.1.2-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed00f8958fadc3a8a0d42a55eaf19fdef7dec3d3dbe34579d513e3e74f8488c0
BLAKE2b-256 checksum
How to use checksums
ff5041ecec60cf290607689ec97bb71257cd88cfbfc92429a263d50797037d41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for argus-term 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.

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