Metadata-Version: 2.4
Name: autodevops-ai
Version: 0.1.1
Summary: AI-powered DevOps automation CLI — scan, deploy, diagnose, and document any project.
Author-email: Akash Hugar <akashhugar2015@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Akash Hugar
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/akashhugar2015/AutoDevOps_AI
Project-URL: Documentation, https://github.com/akashhugar2015/AutoDevOps_AI#readme
Project-URL: Repository, https://github.com/akashhugar2015/AutoDevOps_AI
Project-URL: Issues, https://github.com/akashhugar2015/AutoDevOps_AI/issues
Keywords: devops,ai,automation,cli,deployment,cicd,github
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer[all]>=0.12.0
Requires-Dist: rich>=13.7.0
Requires-Dist: pydantic>=2.6.0
Requires-Dist: pydantic-settings>=2.2.0
Requires-Dist: openai>=1.30.0
Requires-Dist: anthropic>=0.28.0
Requires-Dist: google-generativeai>=0.7.0
Requires-Dist: gitpython>=3.1.40
Requires-Dist: PyGithub>=2.3.0
Requires-Dist: docker>=7.0.0
Requires-Dist: jinja2>=3.1.4
Requires-Dist: httpx>=0.27.0
Requires-Dist: requests>=2.31.0
Requires-Dist: pathspec>=0.12.1
Requires-Dist: tinydb>=4.8.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: tiktoken>=0.7.0
Requires-Dist: keyring>=24.0.0
Requires-Dist: prompt_toolkit>=3.0.0
Provides-Extra: cloud
Requires-Dist: boto3>=1.34.0; extra == "cloud"
Requires-Dist: azure-identity>=1.15.0; extra == "cloud"
Requires-Dist: azure-mgmt-resource>=23.0.0; extra == "cloud"
Requires-Dist: azure-mgmt-web>=7.2.0; extra == "cloud"
Requires-Dist: google-cloud-run>=0.10.0; extra == "cloud"
Provides-Extra: vector
Requires-Dist: chromadb>=0.5.0; extra == "vector"
Provides-Extra: langchain
Requires-Dist: langchain>=0.2.0; extra == "langchain"
Requires-Dist: langchain-community>=0.2.0; extra == "langchain"
Provides-Extra: kubernetes
Requires-Dist: kubernetes>=29.0.0; extra == "kubernetes"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: mypy>=1.9.0; extra == "dev"
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.7.0; extra == "dev"
Provides-Extra: all
Requires-Dist: autodevops-ai[cloud,kubernetes,langchain,vector]; extra == "all"
Dynamic: license-file

# 🤖 AutoDevOps AI

> **An AI-powered DevOps automation CLI — scan, deploy, diagnose, and document any project. Now live on PyPI.**

[![Python](https://img.shields.io/badge/Python-3.10%2B-blue?logo=python)](https://python.org)
[![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
[![PyPI](https://img.shields.io/pypi/v/autodevops-ai?logo=pypi&color=orange)](https://pypi.org/project/autodevops-ai)
[![PyPI Downloads](https://img.shields.io/pypi/dm/autodevops-ai?color=blue)](https://pypi.org/project/autodevops-ai)
[![Status](https://img.shields.io/badge/Status-Alpha%20Released-brightgreen)]()

---

## 📖 Table of Contents

- [Overview](#-overview)
- [What's New in v0.1.0](#-whats-new-in-v010)
- [Features](#-features)
- [Architecture](#️-architecture)
- [Tech Stack](#️-tech-stack)
- [Installation](#-installation)
- [Initial Configuration](#️-initial-configuration)
- [CLI Commands](#-cli-commands)
- [Interactive Shell (REPL)](#-interactive-shell-repl)
- [Project Structure](#-project-structure)
- [Phase-wise Roadmap](#️-phase-wise-roadmap)
- [Contributing](#-contributing)
- [License](#-license)

---

## 🌟 Overview

**AutoDevOps AI** is an intelligent, multi-agent DevOps automation platform distributed as a global Python CLI. It scans your project, understands your tech stack, and autonomously:

- 🔍 **Scans** your repository to detect languages, frameworks, databases, and infrastructure
- 🧠 **Plans** deployment strategies using AI (multi-agent Planner)
- 🔗 **Integrates** deeply with GitHub (auth, repos, commits, PRs, secrets, releases)
- 🚀 **Deploys** to local environments, AWS, Azure, and GCP
- 🔧 **Diagnoses** CI/CD and deployment failures with root-cause AI analysis
- 📄 **Generates** full documentation, runbooks, and API docs
- 🛡️ **Secures** pipelines with secret detection and dependency scanning
- 💰 **Optimizes** cloud costs with actionable recommendations
- 🩺 **Doctor** mode scores your project across 5 health dimensions
- 🗺️ **Roadmap** mode generates a prioritized improvement plan

---

## 🆕 What's New in v0.1.1

- ✅ **Published to PyPI** — `pip install autodevops-ai` works globally
- ✅ **Interactive REPL Shell** — Claude/Gemini-style shell with slash commands, tab-completion, and persistent history
- ✅ **`autodevops doctor`** — project health scoring across Code, Security, Tests, Docs, and Deployment Readiness
- ✅ **`autodevops roadmap`** — AI-generated step-by-step improvement roadmap with time estimates
- ✅ **`autodevops undo`** — restore files from the last backup session
- ✅ **`autodevops run`** — multi-agent planner for high-level natural-language goals
- ✅ **`autodevops security`** — full secret detection, dependency scanning, `.env` auditing
- ✅ **`autodevops cost`** — cloud cost analysis and optimization recommendations
- ✅ **GitHub sub-commands** — `commit`, `push`, `pull`, `pr`, `branch`, `release`, `review-pr`, `git-status`, `secrets`
- ✅ **Generate sub-commands** — `pipeline`, `dockerfile`, `code`
- ✅ **AI Providers** — OpenAI, Anthropic, Google Gemini, Ollama (local) with exponential-backoff retry
- ✅ **Core Engine** — Chunker, Context, Memory, Streaming, Audit, Backup, Next-Actions

---

## ✨ Features

| Feature | Description |
|---|---|
| 🔍 **Project Scanner** | Detects languages, frameworks, Docker, K8s, Terraform, DBs, CI/CD, and cloud SDKs |
| 🧩 **Chunking Engine** | Splits large repos into LLM-processable chunks with summaries |
| 🧠 **Context Engine** | Builds rich AI context from scan + user request + chunks |
| 💬 **AI Memory** | Maintains conversational context across shell session turns |
| 🔗 **GitHub Integration** | Full GitHub automation: auth, repos, branches, commits, PRs, secrets, releases, reviews |
| 🤖 **AI Developer Assistant** | Ask, explain, generate, refactor, and review code via CLI |
| 📝 **Smart Commit Generator** | AI-generated commit messages, PR titles/descriptions, branch names, release notes |
| ⚙️ **CI/CD Generator** | Generate pipelines for GitHub Actions, GitLab CI, Jenkins, Azure DevOps, CircleCI, Bitbucket |
| 🖥️ **Local Deployment** | Deploy to Windows/Linux/macOS, Docker Desktop, Minikube |
| ☁️ **Cloud Deployment** | Deploy to AWS (Lambda/ECS/EKS), Azure (App Service/AKS), GCP (Cloud Run/GKE) |
| 🔧 **Troubleshooting Agent** | Diagnose failures from build, Docker, K8s, GitHub Actions, and cloud logs |
| 📄 **Documentation Agent** | Generate README, architecture docs, API docs, runbooks |
| 🛡️ **Security Agent** | Secret detection, dependency scanning, pipeline and `.env` file checks |
| 💰 **Cost Optimizer** | Analyze and reduce AWS, Azure, and GCP resource costs |
| 🩺 **Doctor** | Health score report across Code Quality, Security, Testing, Docs, Deployment Readiness |
| 🗺️ **Roadmap** | Prioritized, actionable improvement roadmap with commands and time estimates |
| ↩️ **Undo** | Rollback any AutoDevOps-generated file change via backup sessions |
| 🖥️ **Interactive REPL Shell** | Persistent shell with slash commands, tab-completion, and AI chat |

---

## 🏗️ Architecture

AutoDevOps AI follows a **Multi-Agent Architecture** where each agent has a clear responsibility:

```
+──────────────────────────────────────────────────────────────+
│                      AutoDevOps CLI                          │
│          (Typer-based, global `autodevops` command)          │
│        + Interactive REPL Shell (slash commands)             │
+──────────────────────────┬───────────────────────────────────+
                           │
               ┌───────────▼───────────┐
               │      Planner Agent    │
               │  (Multi-agent router) │
               └───────────┬───────────┘
                           │
    ┌──────────┬───────────┼───────────┬──────────┐
    │          │           │           │          │
┌───▼───┐ ┌───▼───┐ ┌─────▼────┐ ┌───▼───┐ ┌───▼────┐
│Scanner│ │Context│ │Developer │ │  Git  │ │CI/CD   │
│ Agent │ │Engine │ │  Agent   │ │ Agent │ │ Agent  │
└───────┘ └───────┘ └──────────┘ └───────┘ └────────┘
    │          │           │           │          │
┌───▼───┐ ┌───▼───┐ ┌─────▼────┐ ┌───▼───┐ ┌───▼────┐
│Deploy │ │Trouble│ │   Doc    │ │Securit│ │  Cost  │
│ Agent │ │-shoot │ │  Agent   │ │  y    │ │ Agent  │
└───────┘ └───────┘ └──────────┘ └───────┘ └────────┘
                           │
           ┌───────────────▼──────────────┐
           │   Core Engine                │
           │  Chunker · Context · Memory  │
           │  Streaming · Audit · Backup  │
           │  NextActions · Models        │
           └──────────────────────────────┘
```

### Agent Responsibilities

| Agent | Responsibility |
|---|---|
| **Planner Agent** | Orchestrates task decomposition, intent classification, and agent delegation |
| **Scanner Agent** | Rule-based project scanning — detects stack, infra, CI/CD, cloud SDKs (no AI) |
| **Context Engine** | Builds and optimizes AI context from scan results + chunked files |
| **Developer Agent** | Code generation, explanation, refactoring, review |
| **Git Agent** | Full GitHub API operations via PyGithub + gitpython |
| **CI/CD Agent** | Jinja2-based pipeline generation for 6 platforms |
| **Deployment Agent** | Local (native/Docker/Minikube) and cloud (AWS/Azure/GCP) automation |
| **Documentation Agent** | Generates README, architecture docs, API docs, runbooks |
| **Troubleshooting Agent** | Root-cause analysis and fix generation from logs |
| **Security Agent** | Secret detection, dependency scanning, pipeline and env file checks |
| **Cost Optimization Agent** | Cloud cost analysis (AWS/Azure/GCP) and right-sizing recommendations |

---

## 🛠️ Tech Stack

| Category | Libraries |
|---|---|
| **CLI Framework** | `typer`, `rich` |
| **Interactive Shell** | `prompt_toolkit` (REPL with autocomplete + history) |
| **Data Validation** | `pydantic`, `pydantic-settings` |
| **AI / LLM** | `openai`, `anthropic`, `google-generativeai` + Ollama (local) |
| **Git / GitHub** | `gitpython`, `PyGithub` |
| **Containers** | `docker` (Docker SDK) |
| **Cloud (Optional)** | `boto3` (AWS), `azure-mgmt-*` + `azure-identity`, `google-cloud-run` |
| **Kubernetes (Optional)** | `kubernetes` |
| **Templating** | `jinja2` (CI/CD pipeline templates) |
| **Storage** | `tinydb` (project memory/history) |
| **HTTP** | `httpx`, `requests` |
| **File Analysis** | `pathspec` |
| **Token Counting** | `tiktoken` |
| **Secret Storage** | `keyring` (OS keychain) |
| **Config** | `python-dotenv` |
| **Testing** | `pytest`, `pytest-cov`, `pytest-asyncio` |
| **Packaging** | `setuptools`, `build`, `twine` |

---

## 📦 Installation

```bash
# Install globally from PyPI
pip install autodevops-ai

# Verify installation
autodevops --version

# Run the first-time setup wizard
autodevops setup

# Initialize in your project
autodevops init
```

---

## ⚙️ Initial Configuration

After installing, run the setup wizard or configure manually:

### 1. First-Time Setup Wizard (Recommended)

```bash
autodevops setup
```

Interactive wizard that configures AI provider keys, GitHub authentication, and project settings in one guided flow.

### 2. Set AI Provider API Key Manually

```bash
# OpenAI (Default)
autodevops config set openai_api_key sk-xxxxxxxxxxxxxxxxxxxx

# Anthropic Claude
autodevops config set anthropic_api_key sk-ant-xxxxxxxxxxxx
autodevops config set default_provider anthropic

# Google Gemini
autodevops config set google_api_key AIzaSy-xxxxxxxxxxxxxxxx
autodevops config set default_provider google

# Local Ollama (no API key needed)
autodevops config set default_provider ollama
autodevops config set ollama_model llama3
```

### 3. Connect GitHub

```bash
autodevops github connect
# Prompts for your GitHub Personal Access Token (PAT)
# Required scopes: repo, workflow, admin:repo_hook
```

---

## 💻 CLI Commands

### Core Commands

```bash
autodevops                        # Launch the interactive REPL shell (default)
autodevops setup                  # First-time setup wizard
autodevops init [--name <n>]      # Initialize AutoDevOps in current project
autodevops scan [--output table|json|file] [--save]   # Scan project stack
autodevops ask "<question>"       # Ask AI about your project
autodevops explain [architecture|code|deployment]     # Explain project via AI
autodevops diagnose               # AI root-cause analysis of failures
autodevops docs [--type all|readme|api|runbook|architecture|deployment]  # Generate docs
autodevops config <show|set|reset> [key] [value]      # Manage configuration
autodevops status [--env local|aws|azure|gcp|all]     # Check deployment status
autodevops doctor                 # Project health score report
autodevops roadmap                # AI-generated improvement roadmap
autodevops security [--checks all|secrets|dependencies|pipeline|env_files]  # Security scan
autodevops cost [--cloud aws|azure|gcp|all] [--days 30]  # Cloud cost analysis
autodevops run "<goal>"           # Multi-agent planner for natural-language goals
autodevops undo                   # Restore files from last backup session
autodevops shell                  # Explicitly launch interactive shell
autodevops --version              # Show version
```

### GitHub Sub-Commands

```bash
autodevops github connect [--token <pat>]                     # Connect to GitHub
autodevops github status                                       # Enhanced git status + AI tip
autodevops github commit [-m "<msg>"] [--no-push] [-b <branch>]  # AI smart commit
autodevops github push [-b <branch>] [--force] [-u]           # Push to remote
autodevops github pull [-b <branch>] [--rebase]               # Pull from remote
autodevops github pr [--title "<t>"] [--base main] [--draft]  # Create pull request
autodevops github branch [description]                         # AI branch name generator
autodevops github secrets <list|set|delete> [name] [value]    # Manage GitHub secrets
autodevops github release [--tag v1.2.0]                      # AI release notes + CHANGELOG
autodevops github review-pr [<number>]                         # AI code review of a PR
```

### Deploy Sub-Commands

```bash
autodevops deploy local [--env development] [--docker]        # Deploy locally
autodevops deploy [--cloud aws|azure|gcp] [--service <svc>] [--dry-run]  # Cloud deploy
```

### Generate Sub-Commands

```bash
autodevops generate pipeline [--platform github-actions|gitlab|jenkins|azure-devops|circleci|bitbucket]
autodevops generate dockerfile
autodevops generate code "<description>" [--lang <language>] [-o <output>]
```

### `autodevops run` Examples (Multi-Agent Planner)

```bash
autodevops run "deploy my FastAPI app to AWS ECS"
autodevops run "generate a GitHub Actions pipeline and create a PR"
autodevops run "scan project, fix security issues, and generate documentation"
autodevops run "create a release v1.0.0 with changelog" --dry-run
```

---

## 🖥️ Interactive Shell (REPL)

Run `autodevops` (no arguments) or `autodevops shell` to enter the interactive REPL — a Claude CLI/Gemini CLI-style session.

**Features:**
- Slash command execution with tab-completion
- Persistent command history across sessions (`~/.autodevops/shell_history`)
- Plain text → streamed AI answer with full project context
- AI session memory (multi-turn conversation within the session)
- Arrow key history navigation
- `Ctrl+C` cancels the current line (does NOT exit)
- `Ctrl+D` or `/exit` exits cleanly

**Available slash commands:**

| Command | Description |
|---|---|
| `/help` | Show all available commands |
| `/init` | Initialize AutoDevOps in this project |
| `/scan` | Scan project stack |
| `/doctor` | Project health score report |
| `/roadmap` | Generate improvement roadmap |
| `/undo` | Restore files from last backup |
| `/ask <question>` | Ask AI (same as plain text) |
| `/commit` | AI smart commit + push |
| `/push` | Push to remote |
| `/pull` | Pull from remote |
| `/pr` | Create a pull request |
| `/branch [description]` | AI branch name generator |
| `/release [--tag v1.0.0]` | AI release notes + CHANGELOG |
| `/review-pr [number]` | AI code review of a PR |
| `/git-status` | Enhanced git status with AI recommendation |
| `/secrets` | Manage GitHub secrets |
| `/security` | Run security scan |
| `/docs` | Generate documentation |
| `/deploy` | Deploy project |
| `/diagnose` | Diagnose failures |
| `/cost` | Analyze cloud costs |
| `/generate` | Generate files (pipeline, dockerfile, code) |
| `/run <goal>` | Multi-agent planner goal |
| `/connect` | Connect to GitHub |
| `/status` | Check deployment status |
| `/config` | Manage configuration |
| `/history` | Show recent shell history |
| `/session clear` | Clear AI conversation session |
| `/clear` | Clear the screen |
| `/exit` or `/quit` | Exit the AutoDevOps shell |

---

## 📁 Project Structure

```
autodevops-ai/
├── src/
│   └── autodevops/
│       ├── __init__.py                 # Package version (0.1.0)
│       ├── cli.py                      # Main Typer CLI entry point (578 lines)
│       ├── config.py                   # ConfigManager — keys, keychain, dotenv
│       ├── agents/
│       │   ├── planner.py              # Multi-agent orchestrator + intent classifier
│       │   ├── scanner.py              # Rule-based project scanner (29 KB)
│       │   ├── cicd.py                 # CI/CD pipeline generator
│       │   ├── deployment.py           # Local + cloud deployment agent
│       │   ├── documentation.py        # Documentation generator agent
│       │   ├── troubleshoot.py         # Root-cause analysis agent
│       │   ├── security.py             # Security scanning agent (22 KB)
│       │   └── cost.py                 # Cloud cost analysis agent
│       ├── commands/
│       │   ├── ask.py                  # `autodevops ask` handler
│       │   ├── config.py               # `autodevops config` handler
│       │   ├── deploy.py               # `autodevops deploy` handler
│       │   ├── diagnose.py             # `autodevops diagnose` handler
│       │   ├── docs.py                 # `autodevops docs` handler
│       │   ├── doctor.py               # `autodevops doctor` health check
│       │   ├── explain.py              # `autodevops explain` handler
│       │   ├── generate.py             # `autodevops generate` handler
│       │   ├── github.py               # GitHub sub-command handlers
│       │   ├── handlers.py             # Shared command handler utilities
│       │   ├── init.py                 # `autodevops init` handler
│       │   ├── roadmap.py              # `autodevops roadmap` handler
│       │   ├── scan.py                 # `autodevops scan` handler
│       │   ├── setup.py                # `autodevops setup` wizard
│       │   ├── status.py               # `autodevops status` handler
│       │   └── undo.py                 # `autodevops undo` handler
│       ├── core/
│       │   ├── chunker.py              # LLM-safe file chunking engine
│       │   ├── context.py              # Context building + token budget management
│       │   ├── memory.py               # AI conversation memory (TinyDB)
│       │   ├── models.py               # Pydantic data models
│       │   ├── next_actions.py         # Next-action recommendation engine
│       │   ├── repl.py                 # Interactive REPL shell (734 lines)
│       │   ├── streaming.py            # Streaming AI response helper
│       │   ├── audit.py                # Operation audit trail
│       │   └── backup.py               # File backup + restore for undo
│       ├── providers/
│       │   └── base.py                 # Unified AI provider (OpenAI/Anthropic/Gemini/Ollama)
│       ├── integrations/
│       │   └── github.py               # Deep GitHub integration (45 KB, PyGithub + gitpython)
│       └── templates/
│           ├── github_actions/         # GitHub Actions pipeline templates
│           ├── gitlab_ci/              # GitLab CI templates
│           ├── jenkins/                # Jenkinsfile templates
│           ├── azure_devops/           # Azure Pipelines templates
│           ├── circleci/               # CircleCI config templates
│           ├── bitbucket/              # Bitbucket Pipelines templates
│           └── docs/                   # Documentation templates
├── tests/
│   ├── unit/
│   │   ├── test_scanner.py
│   │   ├── test_chunker.py
│   │   ├── test_planner.py
│   │   └── test_security.py
│   ├── integration/                    # (planned)
│   └── conftest.py
├── docs/                               # (planned — MkDocs)
├── pyproject.toml                      # Package metadata + build config
├── README.md
└── USER_GUIDE.md                       # Detailed user guide
```



## 🤝 Contributing

Contributions are welcome! Please read `CONTRIBUTING.md` for guidelines.

```bash
git clone https://github.com/akashhugar2015/AutoDevOps_AI.git
cd AutoDevOps_AI
pip install -e ".[dev]"
pytest tests/
ruff check src/
```

---

## 📄 License

This project is licensed under the **MIT License** — see `LICENSE` for details.

---

*Built with ❤️ to make DevOps intelligent, automated, and accessible to every developer.*
