Metadata-Version: 2.4
Name: autodevops-ai
Version: 0.1.0
Summary: AI-powered DevOps automation CLI — scan, deploy, diagnose, and document any project.
Author-email: Akash Hugar <akashhugar2015@gmail.com>
License: MIT
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
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"

# 🤖 AutoDevOps AI

> **A production-ready, AI-powered DevOps automation CLI tool — distributed as a global Python package via PyPI.**

[![Python](https://img.shields.io/badge/Python-3.12%2B-blue?logo=python)](https://python.org)
[![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
[![PyPI](https://img.shields.io/badge/PyPI-autodevops--ai-orange?logo=pypi)](https://pypi.org/project/autodevops-ai)
[![Status](https://img.shields.io/badge/Status-In%20Development-yellow)]()

---

## 📖 Table of Contents

- [Overview](#-overview)
- [Features](#-features)
- [Architecture](#-architecture)
- [Tech Stack](#-tech-stack)
- [Installation](#-installation)
- [CLI Commands](#-cli-commands)
- [Phase-wise Roadmap](#-phase-wise-roadmap)
- [Project Structure](#-project-structure)
- [Contributing](#-contributing)
- [License](#-license)

---

## 🌟 Overview

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

- 🔍 **Scans** your repository to detect languages, frameworks, databases, and infrastructure
- 🧠 **Plans** deployment strategies using AI
- 🔗 **Integrates** with GitHub (auth, repos, secrets, Actions)
- 🚀 **Deploys** to local environments, AWS, Azure, and GCP
- 🔧 **Diagnoses** and fixes CI/CD and deployment failures
- 📄 **Generates** full documentation, runbooks, and API docs
- 🛡️ **Secures** pipelines with secret detection and dependency scanning
- 💰 **Optimizes** cloud costs with actionable recommendations

---

## ✨ Features

| Feature | Description |
|---|---|
| 🔍 **Project Scanner** | Detects languages, frameworks, Docker, K8s, Terraform, DBs, 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 |
| 🔗 **GitHub Integration** | Full GitHub automation: auth, repos, branches, PRs, secrets, Actions |
| 🤖 **AI Developer Assistant** | Ask, explain, generate, refactor, and review code via CLI |
| 📝 **Smart Commit Generator** | AI-generated commit messages, PR titles/descriptions, release notes |
| ⚙️ **CI/CD Generator** | Generate pipelines for GitHub Actions, GitLab CI, Jenkins, Azure DevOps |
| 🖥️ **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 security checks |
| 💰 **Cost Optimizer** | Analyze and reduce AWS, Azure, and GCP resource costs |

---

## 🏗️ Architecture

AutoDevOps AI follows a **Multi-Agent Architecture** where each agent has a clear responsibility and a well-defined communication interface:

```
+-------------------------------------------------------------+
|                      AutoDevOps CLI                         |
|              (Typer-based, global `autodevops` command)     |
+------------------------------+------------------------------+
                               |
               +---------------v---------------+
               |         Planner Agent         |
               |  (Orchestrates all agents)     |
               +---------------+---------------+
                               |
       +-----------------------+-----------------------+
       |               |               |               |
+------v-----+  +------v-----+  +------v-----+  +-----v------+
|Scanner Agt |  |Context Agt |  |Developer   |  |  Git Agent |
|(rule-based)|  |            |  |   Agent    |  | (PyGithub) |
+------------+  +------------+  +------------+  +------------+
       |               |               |               |
+------v-----+  +------v-----+  +------v-----+  +-----v------+
|  CI/CD Agt |  |Deploy Agt  |  |Troubleshoot|  |   Doc Agt  |
|            |  |local+cloud |  |   Agent    |  |            |
+------------+  +------------+  +------------+  +------------+
                               |
               +---------------v---------------+
               |    Security + Cost Agents     |
               +-------------------------------+
```

### Agent Responsibilities

| Agent | Responsibility |
|---|---|
| **Planner Agent** | Orchestrates task decomposition and agent delegation |
| **Scanner Agent** | Rule-based project scanning (no AI) |
| **Context Agent** | Builds and optimizes AI context from multiple sources |
| **Developer Agent** | Code generation, explanation, refactoring, review |
| **Git Agent** | Full GitHub API operations |
| **CI/CD Agent** | Pipeline generation for all major platforms |
| **Deployment Agent** | Local and cloud deployment automation |
| **Documentation Agent** | Generates all project documentation |
| **Troubleshooting Agent** | Root-cause analysis and fix generation |
| **Security Agent** | Secret detection and security scanning |
| **Cost Optimization Agent** | Cloud cost analysis and recommendations |

---

## 🛠️ Tech Stack

| Category | Libraries |
|---|---|
| **CLI Framework** | `typer`, `rich` |
| **Data Validation** | `pydantic` |
| **AI / LLM** | `openai`, `anthropic`, `google-generativeai`, `ollama`, `langchain` (optional) |
| **Vector Store** | `faiss-cpu` or `chromadb` |
| **Git / GitHub** | `gitpython`, `pygithub` |
| **Containers** | `docker` (Docker SDK) |
| **Kubernetes** | `kubernetes` |
| **AWS** | `boto3` |
| **Azure** | `azure-mgmt-*`, `azure-identity` |
| **GCP** | `google-cloud-*` |
| **Database** | `sqlite3` (built-in) |
| **Templating** | `jinja2` |
| **Testing** | `pytest`, `pytest-cov` |
| **Packaging** | `hatch`, `setuptools`, `twine` |

---

## 📦 Installation

```bash
# Install globally from PyPI (once published)
pip install autodevops-ai

# Verify installation
autodevops --version

# Initialize in your project
autodevops init
```

---

## ⚙️ Initial Configuration

After installing, configure your AI provider and optional integrations:

### 1. Set AI Provider API Key
```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
```

### 2. Connect Local Offline Model (Ollama Network Scan)
If you prefer running local models (e.g., Llama3) offline:
1. Ensure Ollama is running on your machine or any host on your local network (defaults to port `11434`).
2. When you set Ollama as the provider, AutoDevOps scans your host/network, pings active Ollama endpoints to discover available models, and locks in the configuration:
   ```bash
   autodevops config set default_provider ollama
   autodevops config set ollama.model llama3
   ```

### 3. Connect GitHub
Authorize the CLI to interact with your repositories (pull, commit, branch, create PRs, manage secrets):
```bash
autodevops github connect
```
*Prompts for your GitHub Personal Access Token (PAT) with `repo`, `workflow`, and `admin:repo_hook` scopes, automatically verifying authentication.*

---

## 💻 CLI Commands

```bash
autodevops init               # Initialize AutoDevOps in current project
autodevops scan               # Scan project and detect stack
autodevops ask "question"     # Ask AI about your project
autodevops explain            # Explain project architecture
autodevops generate           # Generate code, configs, or pipelines
autodevops github connect     # Connect to GitHub
autodevops deploy             # Deploy project (local or cloud)
autodevops deploy local       # Deploy locally
autodevops diagnose           # Diagnose and fix failures
autodevops docs               # Generate documentation
autodevops config             # Manage configuration
autodevops status             # Check deployment/service status
```

---

## 🗺️ Phase-wise Roadmap

---

### Phase 0 — Project Bootstrap and PyPI Packaging Setup
**Goal:** Create a proper Python package skeleton ready for PyPI submission.

#### Tasks:
- [ ] Initialize project with `hatch` or `setuptools`
- [ ] Create `pyproject.toml` with proper metadata
- [ ] Define package name: `autodevops-ai`
- [ ] Set up `src/autodevops/` package layout
- [ ] Create entry point: `autodevops` command
- [ ] Add `README.md`, `LICENSE` (MIT), `CHANGELOG.md`
- [ ] Set up `.gitignore`, `.editorconfig`
- [ ] Set up `pytest` with `tests/` directory
- [ ] Configure GitHub Actions for CI (lint + test + publish)
- [ ] Create `CONTRIBUTING.md` and `CODE_OF_CONDUCT.md`

#### Deliverables:
- Working `pip install -e .` local install
- `autodevops --help` outputs usage
- Publish to TestPyPI first, then PyPI

---

### Phase 1 — Project Scanner (Rule-Based, No AI)
**Goal:** Build a deterministic scanner that deeply understands any repository.

#### Tasks:
- [ ] Implement `ScannerAgent` class
- [ ] Detect Programming Languages (by file extensions)
- [ ] Detect Frameworks (Django, Flask, FastAPI, React, Next.js, Spring, etc.)
- [ ] Detect Package Managers (requirements.txt, package.json, pom.xml, etc.)
- [ ] Detect Databases (Postgres, MySQL, MongoDB, Redis via config/env files)
- [ ] Detect Docker (Dockerfile, docker-compose.yml)
- [ ] Detect Kubernetes (*.yaml with kind: Deployment/Service/etc.)
- [ ] Detect Terraform (*.tf, terraform.tfvars)
- [ ] Detect CI/CD (.github/workflows/, .gitlab-ci.yml, Jenkinsfile)
- [ ] Detect Cloud SDKs (boto3, azure-sdk, google-cloud imports)
- [ ] Detect Testing Frameworks (pytest, jest, junit, etc.)
- [ ] Analyze repository structure (depth, main dirs, entry points)
- [ ] Output structured project_scan.txt / JSON

#### CLI:
```bash
autodevops scan
autodevops scan --output json
```

---

### Phase 2 — Project Chunking and Context Engine
**Goal:** Handle large repositories efficiently without hitting LLM token limits.

#### Tasks:
- [ ] Implement ChunkingEngine
  - [ ] Split files by size/complexity
  - [ ] Generate per-chunk summaries
  - [ ] Store in project_chunks.txt
- [ ] Implement ContextEngine
  - [ ] Load user_request.txt
  - [ ] Load project_scan.txt
  - [ ] Load project_chunks.txt
  - [ ] Merge and optimize into deployment_plan.txt
  - [ ] Context token budget management
- [ ] Implement Vector Store (FAISS or ChromaDB)
  - [ ] Embed and store file summaries
  - [ ] Semantic search for relevant context

---

### Phase 3 — AI Provider Abstraction and Developer Assistant
**Goal:** Unified AI interface supporting multiple LLM providers + ask/explain/generate commands.

#### Tasks:
- [ ] Create AIProvider abstract base class
- [ ] Implement providers:
  - [ ] OpenAIProvider (GPT-4o, GPT-4 Turbo)
  - [ ] AnthropicProvider (Claude 3.5 Sonnet/Haiku)
  - [ ] GoogleProvider (Gemini 1.5 Pro/Flash)
  - [ ] OllamaProvider (local Llama3, Mistral, etc.)
- [ ] Implement DeveloperAgent
  - [ ] autodevops ask "question" — general Q&A
  - [ ] autodevops explain — architecture explanation
  - [ ] autodevops generate — code/config generation
  - [ ] Code refactoring
  - [ ] Code review with suggestions
  - [ ] Implementation plan generation
- [ ] Implement autodevops config for managing API keys and provider selection

---

### Phase 4 — GitHub Integration
**Goal:** Full GitHub automation from the CLI.

#### Tasks:
- [ ] Implement GitAgent using PyGithub + gitpython
- [ ] autodevops github connect — OAuth / PAT authentication
- [ ] Repository operations:
  - [ ] Create repository
  - [ ] Clone repository
  - [ ] Branch creation
  - [ ] Commit creation
  - [ ] Push / Pull
  - [ ] Pull Request creation
- [ ] GitHub Secrets management
- [ ] GitHub Actions workflow integration
- [ ] Repository analysis (stars, issues, PRs, contributors)
- [ ] Smart Commit Generator:
  - [ ] Analyze changed files with AI
  - [ ] Generate commit message
  - [ ] Generate PR title and description
  - [ ] Generate release notes
  - [ ] Impact and risk analysis

---

### Phase 5 — CI/CD Pipeline Generator
**Goal:** Auto-generate CI/CD pipelines for all major platforms.

#### Tasks:
- [ ] Implement CICDAgent with Jinja2 templating
- [ ] Generate pipelines for:
  - [ ] GitHub Actions (.github/workflows/)
  - [ ] GitLab CI (.gitlab-ci.yml)
  - [ ] Jenkins (Jenkinsfile)
  - [ ] Azure DevOps (azure-pipelines.yml)
  - [ ] CircleCI (.circleci/config.yml)
  - [ ] Bitbucket Pipelines (bitbucket-pipelines.yml)
- [ ] Pipeline stages: Build, Test, Package, Deploy, Rollback, Notifications

---

### Phase 6 — Local Deployment Agent
**Goal:** Fully automated local development environment setup and deployment.

#### Tasks:
- [ ] Implement LocalDeploymentAgent
- [ ] Detect local environment (Windows/Linux/macOS/WSL)
- [ ] Auto-install dependencies (with user approval)
- [ ] Create virtual environments / containers
- [ ] Configure databases (Postgres, MySQL, MongoDB, Redis)
- [ ] Start services (Docker Compose, native)
- [ ] Verify health checks
- [ ] Support: Native, Docker Desktop, Minikube / Local Kubernetes

---

### Phase 7 — Cloud Deployment Agent
**Goal:** Deploy to AWS, Azure, and GCP from a single CLI command.

#### Tasks:
- [ ] Implement CloudDeploymentAgent
- [ ] AWS: Lambda, ECS, EKS, EC2, Elastic Beanstalk, S3+CloudFront
- [ ] Azure: App Service, Azure Functions, AKS
- [ ] GCP: Cloud Run, Cloud Functions, GKE, Compute Engine
- [ ] On-premises deployment support
- [ ] Environment validation, automated rollback, post-deploy verification

---

### Phase 8 — Troubleshooting Agent
**Goal:** AI-powered root-cause analysis and automated fix generation.

#### Tasks:
- [ ] Implement TroubleshootingAgent
- [ ] Collect: build logs, GitHub Actions, Docker, app logs, K8s, cloud logs
- [ ] AI: root cause, fix suggestions, remediation plans, auto-apply

---

### Phase 9 — Documentation Agent
**Goal:** Auto-generate complete project documentation.

#### Tasks:
- [ ] Generate: README, architecture docs, developer guides, API docs, runbooks
- [ ] Output formats: Markdown, HTML, PDF

---

### Phase 10 — Security Agent
**Goal:** Proactive security scanning and recommendations.

#### Tasks:
- [ ] Secret detection (API keys, tokens in code, .env, git history)
- [ ] Dependency vulnerability scanning (Python, Node.js, Java)
- [ ] Pipeline security checks and cloud security recommendations

---

### Phase 11 — Cost Optimization Agent
**Goal:** Analyze and reduce cloud spending.

#### Tasks:
- [ ] AWS Cost Explorer, Azure Cost Management, GCP Billing API integration
- [ ] Idle resource detection, right-sizing, reserved capacity recommendations

---

### Phase 12 — PyPI Publication and Community Launch
**Goal:** Publish to PyPI and prepare for open-source community adoption.

#### Tasks:
- [ ] Final QA and integration testing
- [ ] Complete documentation (MkDocs or Sphinx)
- [ ] Configure hatch / twine for automated publishing
- [ ] GitHub Actions: CI on push + PyPI release on tag
- [ ] Publish to TestPyPI -> validate -> PyPI
- [ ] GitHub Releases with CHANGELOG, community files

---

## 📁 Project Structure

```
autodevops-ai/
├── src/
│   └── autodevops/
│       ├── __init__.py
│       ├── cli.py                    # Main Typer CLI entry point
│       ├── config.py                 # Configuration management
│       ├── agents/
│       │   ├── planner.py            # Orchestrator Agent
│       │   ├── scanner.py            # Scanner Agent (rule-based)
│       │   ├── context.py            # Context Engine
│       │   ├── developer.py          # Developer Assistant
│       │   ├── git.py                # Git/GitHub Agent
│       │   ├── cicd.py               # CI/CD Generator
│       │   ├── deployment.py         # Deployment Agent
│       │   ├── troubleshoot.py       # Troubleshooting Agent
│       │   ├── documentation.py      # Documentation Agent
│       │   ├── security.py           # Security Agent
│       │   └── cost.py               # Cost Optimization Agent
│       ├── providers/
│       │   ├── base.py               # Abstract AI Provider
│       │   ├── openai_provider.py
│       │   ├── anthropic_provider.py
│       │   ├── google_provider.py
│       │   └── ollama_provider.py
│       ├── core/
│       │   ├── chunker.py            # Chunking Engine
│       │   ├── vector_store.py       # FAISS / ChromaDB
│       │   └── models.py             # Pydantic models
│       ├── integrations/
│       │   ├── github.py
│       │   ├── docker.py
│       │   ├── kubernetes.py
│       │   ├── aws.py
│       │   ├── azure.py
│       │   └── gcp.py
│       └── templates/
│           ├── github_actions/
│           ├── gitlab_ci/
│           ├── jenkins/
│           ├── azure_devops/
│           └── docs/
├── tests/
│   ├── unit/
│   ├── integration/
│   └── conftest.py
├── docs/
│   ├── architecture.md
│   ├── getting-started.md
│   └── api-reference.md
├── pyproject.toml                    # Package metadata + build config
├── README.md
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── LICENSE
└── .github/
    └── workflows/
        ├── ci.yml                    # Test on every PR
        └── publish.yml               # Publish to PyPI on tag
```

---

## 🤝 Contributing

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

```bash
git clone https://github.com/yourusername/autodevops-ai.git
pip install -e ".[dev]"
pytest tests/
ruff check src/
```

---

## 📄 License

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

---

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