Skip to main content

JugaadAgent 🔧

जुगाड़ (joo-gaad) - the Indian art of resourceful problem-solving.

Type what you want in plain English. JugaadAgent generates the shell command, checks the risk, and retries with real diagnostics when it fails. Runs entirely on your machine via Ollama - no cloud, no API costs.


Install

pip install jugaad-agent
ollama pull qwen2.5-coder:latest

Or use pipx install jugaad-agent if you prefer isolated CLI tools.

Requirements: Linux (Ubuntu recommended), Python 3.10+, Ollama


Usage

jugaad "free port 8080"
jugaad "find files larger than 100MB in /var/log"
jugaad "install and start nginx" --dry-run
jugaad "something is eating my disk - figure out what"

Short alias: jaa works everywhere jugaad does.


How it works

memory → generator → guardrail → executor
           ↑                         │
           └───── fail + diagnose ───┘

When a command fails, JugaadAgent doesn't retry blindly. It runs lsof, checks for missing binaries, reads permission errors - then sends that context back to the model before retrying.

Module What it does
state.py Pydantic state + history accumulator
nodes.py LLM generation + shell execution
guardrails.py Risk scan + human approval (HITL)
diagnostics.py Enriches stderr with Ubuntu telemetry
memory.py Loads .agent_rules.md from working directory
graph.py LangGraph state machine

Safety

JugaadAgent runs real shell commands on your machine.

Risk level Behavior
LOW Runs automatically
MEDIUM / HIGH Stops and asks [Y]es / [N]o / [E]dit before executing

Flags:

  • --dry-run - generate without executing
  • --yes / -y - skip approval prompts (use carefully)
  • --max-retries - hard cap on self-heal loops (default: 3)

Options

jugaad "task" -m llama3.2:3b      # set model (saved for future runs)
jugaad "task" --max-retries 5
jugaad "task" --dry-run
jugaad "task" --yes
jugaad --version

Model selection priority

  1. -m / --model flag (persisted to ~/.config/jugaad-agent/)
  2. JUGAAD_MODEL env (one-time override, not saved)
  3. Saved preference from a previous -m
  4. Built-in default: qwen2.5-coder:latest

Environment variables

Variable Default Purpose
JUGAAD_MODEL (unset) Override model for this run only
JUGAAD_BASE_URL http://127.0.0.1:11434 Ollama API endpoint
JUGAAD_MAX_RETRIES 3 Self-heal retry ceiling

Workspace rules

Add .agent_rules.md to any project directory - JugaadAgent reads it on every run. Use it for preferred tools, things to avoid, or project-specific context.

Example:

- Prefer `rg` over `grep` when searching code
- Use `uv` instead of `pip` for Python installs
- Never delete anything in `/data/production`

See .agent_rules.md.example for more ideas.


Development

git clone https://github.com/dhruva3223/jugaad-agent.git
cd jugaad-agent
pip install -e ".[dev]"

Build for PyPI:

rm -rf dist/ build/ src/*.egg-info
python -m build
twine check dist/*
twine upload dist/*

License

MIT - see LICENSE


Contributing

Issues and PRs welcome at github.com/dhruva3223/jugaad-agent

Metadata

Release files for jugaad-agent 0.1.4

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

Source distribution (sdist)

Source distribution for jugaad-agent 0.1.4
File Size Uploaded
jugaad_agent-0.1.4.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jugaad-agent 0.1.4
File Interpreter ABI Platform
jugaad_agent-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 27.5 kB

Release files / jugaad_agent-0.1.4.tar.gz

Download URL jugaad_agent-0.1.4.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
eb8cb9574c20bc2c7be60249ce723f1f0cca94e816fa20f9b02e7e514172586a
BLAKE2b-256 checksum
How to use checksums
a29d3513ddd888db58854378118942c5cf0e5b5b5ddf682661727fd3b9b32057
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0rc1

Release files / jugaad_agent-0.1.4-py3-none-any.whl

Download URL jugaad_agent-0.1.4-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85e582875a8d82198af220976eedb8770cee118b791d8f2b8e339cfae1619522
BLAKE2b-256 checksum
How to use checksums
6e4842115ca4f9bf87a11baaedd7eca615453151eedcd3502673db26e2d82458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0rc1

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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