Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added 0 .env.example
Empty file.
2 changes: 1 addition & 1 deletion 2 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
Expand Down
130 changes: 128 additions & 2 deletions 130 README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,128 @@
# devops-agent
Agent team for DevOps that solves Kubernetes, Docker, Terraform, and monitoring challenges through intelligent automation.
# DevOps Agent

An AI-powered CLI tool to assist with DevOps tasks, log analysis, and infrastructure code generation.

## Features

- 📊 **Log Analysis**: Analyze log files and get actionable insights
- 💬 **Query Interface**: Ask questions about DevOps best practices, Terraform, Kubernetes, etc.
- 🛠️ **Template Generation**: Generate infrastructure code templates
- 🤖 **AI-Powered**: Leverages Claude AI for intelligent responses

## Installation

```bash
# Clone the repository
git clone https://github.com/yourusername/devops-agent.git
cd devops-agent

# Install in development mode
pip install -e .

# Or install from PyPI (when published)
pip install devops-agent
```

## Configuration

Create a `.env` file in the project root:

```env
ANTHROPIC_API_KEY=your_api_key_here
```

## Usage

### Analyze Log Files

```bash
devops-agent run --log-file /path/to/app.log
```

### Ask Questions

```bash
devops-agent run --query "I need terraform script to spin up Azure blob storage"
devops-agent run --query "How to increase my pod memory and CPU in k8s"
```

### Generate Templates

```bash
devops-agent template terraform
devops-agent template kubernetes
devops-agent template docker
```

### Configuration

```bash
devops-agent config
```

## Examples

```bash
# Analyze application logs
devops-agent run --log-file ./logs/app.log --format json

# Get Terraform help
devops-agent run --query "terraform script for AWS S3 bucket with versioning"

# Kubernetes troubleshooting
devops-agent run --query "pod is in CrashLoopBackOff status, how to debug?"

# Save output to file
devops-agent run --query "docker-compose for nginx and postgres" --output docker-compose.yml
```

## Development

```bash
# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black devops_agent/
isort devops_agent/

# Lint
flake8 devops_agent/
```

## Project Structure

```
devops-agent/
├── devops_agent/ # Main package
│ ├── cli.py # CLI interface
│ ├── core/ # Core functionality
│ ├── templates/ # Template generators
│ ├── utils/ # Utilities
│ └── prompts/ # LLM prompts
└── docs/ # Documentation
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

Apache2.0 License - see LICENSE file for details

## Roadmap

- [ ] Implement log analysis with pattern detection
- [ ] Add support for multiple LLM providers
- [ ] Create template library for common infrastructure patterns
- [ ] Add interactive mode
- [ ] Support for custom plugins
- [ ] Integration with CI/CD pipelines

## Support

For issues and questions, please open an issue on GitHub.
Empty file added 0 devops_agent/__init__.py
Empty file.
61 changes: 61 additions & 0 deletions 61 devops_agent/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import click
from rich.console import Console
from rich.panel import Panel
from pathlib import Path

console = Console()

@click.group()
@click.version_option(version="0.1.0")
def cli():
"""DevOps Agent - Your AI-powered DevOps assistant"""
pass

@cli.command()
@click.option('--log-file', type=click.Path(exists=True), help='Path to log file to analyze')
@click.option('--query', type=str, help='Query to ask the DevOps agent')
@click.option('--output', type=click.Path(), help='Output file path (optional)')
@click.option('--format', type=click.Choice(['text', 'json', 'markdown']), default='text', help='Output format')
def run(log_file, query, output, format):
"""Run the DevOps agent with specified options"""

if not log_file and not query:
console.print("[red]Error: You must provide either --log-file or --query[/red]")
raise click.Abort()

if log_file and query:
console.print("[red]Error: Cannot use both --log-file and --query simultaneously[/red]")
raise click.Abort()

console.print(Panel.fit(
"[bold cyan]DevOps Agent[/bold cyan]\n[dim]Initializing...[/dim]",
border_style="cyan"
))

if log_file:
console.print(f"[yellow]Analyzing log file:[/yellow] {log_file}")
console.print("[green]✓[/green] Log analysis will be implemented here")

if query:
console.print(f"[yellow]Processing query:[/yellow] {query}")
console.print("[green]✓[/green] Query processing will be implemented here")

if output:
console.print(f"[blue]Output will be saved to:[/blue] {output}")

@cli.command()
def config():
"""Configure the DevOps agent"""
console.print("[yellow]Configuration interface will be implemented here[/yellow]")

@cli.command()
@click.argument('template_type', type=click.Choice(['terraform', 'kubernetes', 'docker']))
def template(template_type):
"""Generate templates for various DevOps tools"""
console.print(f"[yellow]Generating {template_type} template...[/yellow]")

def main():
cli()

if __name__ == '__main__':
main()
Empty file added 0 devops_agent/core/__init__.py
Empty file.
Empty file.
Empty file.
Empty file added 0 devops_agent/utils/__init__.py
Empty file.
1 change: 1 addition & 0 deletions 1 playground.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('playground!')
55 changes: 55 additions & 0 deletions 55 pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "devops-agent"
version = "0.1.0"
description = "AI-powered DevOps CLI assistant"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "MIT"}
authors = [
{name = "M K Pavan Kumar", email = "manthapavankumar11@gamil.com"}
]
keywords = ["devops", "cli", "ai", "automation", "terraform", "kubernetes", "docker"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: Apache2.0 License",
"Programming Language :: Python :: 3",
]

dependencies = [
"click>=8.3.0",
"rich>=14.1.0",
"anthropic>=0.69.0",
"pyyaml>=6.0.3",
"python-dotenv>=1.1.1",
"requests>=2.32.5",
"colorama>=0.4.6",
"agno>=2.1.0",
"poml>=0.0.8"
]

[project.scripts]
devops-agent = "devops_agent.cli:main"

[project.optional-dependencies]
dev = [
"black>=25.9.0",
"isort>=6.1.0",
"flake8>=7.3.0",
]

[tool.setuptools]
packages = ["devops_agent", "devops_agent.core", "devops_agent.templates", "devops_agent.utils", "devops_agent.prompts"]

[tool.black]
line-length = 100
target-version = ['py38', 'py39', 'py310', 'py311']

[tool.isort]
profile = "black"
line_length = 100
25 changes: 25 additions & 0 deletions 25 requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Agentic framework
poml==0.0.8
agno==2.1.0

# CLI Framework
click>=8.1.0
rich>=13.0.0

# LLM Integration
anthropic>=0.18.0

# File Processing
pyyaml>=6.0
python-dotenv>=1.0.0

# Utilities
requests>=2.31.0
colorama>=0.4.6

# Development
pytest>=7.4.0
pytest-cov>=4.1.0
black>=23.0.0
isort>=5.12.0
flake8>=6.0.0
37 changes: 37 additions & 0 deletions 37 setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from setuptools import setup, find_packages

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

with open("requirements.txt", "r", encoding="utf-8") as fh:
requirements = [line.strip() for line in fh if line.strip() and not line.startswith("#")]

setup(
name="devops-agent",
version="0.1.0",
author="Your Name",
author_email="your.email@example.com",
description="AI-powered DevOps CLI assistant",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/yourusername/devops-agent",
packages=find_packages(),
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
python_requires=">=3.8",
install_requires=requirements,
entry_points={
"console_scripts": [
"devops-agent=devops_agent.cli:main",
],
},
)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.