Skip to content

Repository files navigation

🤖 AI Dev Copilot

Review, test and document your Python code with Google Gemini — three developer agents in one clean CLI.

CI Python Gemini License: MIT

AI Dev Copilot bundles three focused agents behind a single command:

Agent What it does
🔍 Reviewer Structured review — bugs, security, performance, style, with concrete fixes
🧪 Tester Generates a ready-to-run pytest suite (happy paths, edge cases, errors)
📝 Documenter Writes a professional README and adds Google-style docstrings

Run them individually, or run all to review + test + document a file in one pass.


✨ Why this exists

Most "AI agent" demos are single throwaway scripts, each reinventing its own LLM plumbing. AI Dev Copilot is built like a small product instead:

  • One shared Gemini client (llm.py) — consistent config, one place to change models.
  • Pure, tested helpers — AST-based structure extraction and fence-stripping are unit-tested with no API key required, so CI stays green and free.
  • Zero-setup demo — every command falls back to a bundled example file, so you can try it before wiring up your own code.
  • Proper packaging — installable, with a devcopilot entry point, ruff linting and CI across Python 3.10–3.12.

🚀 Quick Start

git clone https://github.com/Meriam-Inoubli/ai-dev-copilot.git
cd ai-dev-copilot

python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e .

cp .env.example .env        # then paste your free Gemini key

Get a free key at aistudio.google.com/app/apikey.

# Try it instantly on the bundled demo (no --file needed)
devcopilot review

# Point it at your own code
devcopilot review --file path/to/app.py
devcopilot test   --file path/to/app.py --output tests/test_app.py
devcopilot doc    --file path/to/app.py --mode readme
devcopilot all    --file path/to/app.py

🧑‍💻 Use it as a library

from ai_dev_copilot import review_code, generate_tests, generate_readme

code = open("app.py").read()

print(review_code(code))               # markdown review
open("test_app.py", "w").write(generate_tests(code, "app"))
open("README_app.md", "w").write(generate_readme(code, "app.py"))

🏗️ Architecture

src/ai_dev_copilot/
├── llm.py          # single Gemini client (system + user prompt → text)
├── utils.py        # pure helpers: AST outline, code-fence stripping  (unit-tested)
├── reviewer.py     # 🔍 review_code()
├── tester.py       # 🧪 generate_tests()
├── documenter.py   # 📄 generate_readme() + add_docstrings()
└── cli.py          # devcopilot: review | test | doc | all

Each agent is just a focused prompt over the shared client — easy to read, extend, or swap the model.


⚙️ Configuration

Variable Default Description
GEMINI_API_KEY Your Gemini API key (required for live calls)
GEMINI_MODEL gemini-2.0-flash Model override

🧪 Development

pip install -e ".[dev]"
pytest -v          # runs offline — no API key needed
ruff check .

🙏 Credits

The three agent ideas were inspired by the excellent 500 AI Agents Projects collection (MIT). This project reimplements them from scratch on Gemini, unified into one tested, installable package.

📄 License

MIT © 2026 Meriam Inoubli

About

Review, test and document Python code with Google Gemini — three dev agents (reviewer, tester, documenter) in one clean, tested CLI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages