# SnapInfra
[](https://badge.fury.io/py/snapinfra)
[](https://pepy.tech/project/snapinfra)
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/Apache-2.0)
**AI-powered infrastructure code generation from natural language**
Transform plain English into production-ready infrastructure code. Generate Terraform, Kubernetes manifests, Docker configurations, and architectural diagrams using state-of-the-art AI models.
```bash
pip install snapinfra
snapinfra "Create a 3-tier AWS architecture with load balancer and RDS"
```
## Key Features
- **Multi-Provider AI**: OpenAI, Groq, AWS Bedrock, Ollama support
- **Production-Ready**: Security best practices and scalability built-in
- **Interactive Chat**: Refine and iterate on your infrastructure
- **Architecture Diagrams**: Auto-generated Mermaid diagrams
- **Cross-Platform**: Works on Windows, macOS, and Linux
## Quick Start
**Install**
```bash
pip install snapinfra
```
**Set API Key**
```bash
# Free Groq API (recommended)
export GROQ_API_KEY="your-api-key"
# Or OpenAI
export OPENAI_API_KEY="your-api-key"
```
**Generate Infrastructure**
```bash
# AWS Infrastructure
snapinfra "terraform for AWS VPC with public/private subnets"
# Kubernetes
snapinfra "k8s deployment for nginx with ingress"
# Docker
snapinfra "docker-compose for React app with PostgreSQL"
# With specific AI provider
snapinfra -b groq "serverless architecture with API Gateway and Lambda"
```
## Supported Infrastructure
| Platform | Templates | Features |
|----------|-----------|----------|
| **Terraform** | AWS, Azure, GCP | Multi-cloud, modules, best practices |
| **Kubernetes** | Deployments, Services, Ingress | RBAC, security policies, monitoring |
| **Docker** | Dockerfiles, Compose | Multi-stage, optimization, security |
| **CloudFormation** | Serverless, Containers | AWS native, nested stacks |
| **Ansible** | Configuration, Deployment | Automation, orchestration |
| **Helm** | Charts, Values | Kubernetes package management |
## AI Providers
| Provider | Speed | Cost | Best For |
|----------|-------|------|----------|
| **Groq** | Ultra-fast | Free tier | Development, prototyping |
| **OpenAI** | Fast | Pay-per-use | Production, complex scenarios |
| **AWS Bedrock** | Fast | Enterprise | AWS environments |
| **Ollama** | Variable | Free | Privacy, offline usage |
### Setup Examples
**Groq (Recommended)**
```bash
export GROQ_API_KEY="gsk_..."
snapinfra -b groq "terraform for EKS cluster"
```
**OpenAI**
```bash
export OPENAI_API_KEY="sk-..."
snapinfra -b openai -m gpt-4 "complex microservices architecture"
```
**Local with Ollama**
```bash
# No API key needed
snapinfra -b ollama "docker setup for development"
```
## Common Use Cases
**Cloud Infrastructure**
```bash
# Complete AWS setup
snapinfra "3-tier architecture: ALB, ECS, RDS with monitoring"
# Multi-cloud
snapinfra "hybrid setup: AWS primary, Azure DR"
# Serverless
snapinfra "event-driven architecture with Lambda and SQS"
```
**Container Orchestration**
```bash
# Microservices
snapinfra "k8s platform: ingress, services, deployments, monitoring"
# Development environment
snapinfra "docker-compose: app, database, redis, monitoring"
# Production setup
snapinfra "helm chart for multi-tier application"
```
**Development Workflows**
```bash
# CI/CD
snapinfra "GitHub Actions: test, build, deploy to EKS"
# Infrastructure as Code
snapinfra "Terraform modules for reusable VPC patterns"
# Security
snapinfra "k8s network policies and RBAC for microservices"
```
## Advanced Features
**Interactive Chat Mode**
```bash
snapinfra "basic AWS setup"
# SnapInfra generates initial code
# Continue refining: "add monitoring", "make it multi-region", "add security groups"
```
**Architecture Diagrams**
```bash
# Auto-generates Mermaid diagrams
snapinfra "AWS infrastructure with architecture diagram"
# Creates both code and visual representation
```
**Multiple Output Formats**
```bash
# Save to files
snapinfra -o main.tf "terraform VPC setup"
# With documentation
snapinfra -o main.tf -r README.md "EKS cluster with docs"
# Copy to clipboard
snapinfra --clipboard "docker setup"
```
**Batch Processing**
```bash
# Multiple environments
snapinfra "terraform modules for dev, staging, prod"
# Different cloud providers
snapinfra "same app architecture for AWS, Azure, GCP"
```
## Configuration
**Environment Variables (Simple)**
```bash
# Choose your AI provider
export GROQ_API_KEY="gsk_..."
export OPENAI_API_KEY="sk_..."
```
**TOML Config (Advanced)**
```toml
# ~/.config/snapinfra/config.toml
default_backend = "groq"
[backends.groq]
type = "groq"
api_key = "$GROQ_API_KEY"
default_model = "llama-4-scout-17b"
[backends.openai]
type = "openai"
api_key = "$OPENAI_API_KEY"
default_model = "gpt-4"
[backends.bedrock]
type = "bedrock"
aws_profile = "default"
aws_region = "us-east-1"
```
## CLI Reference
**Basic Usage**
```bash
snapinfra [OPTIONS] "your infrastructure description"
```
**Common Options**
```bash
-b, --backend TEXT AI provider (groq, openai, bedrock, ollama)
-m, --model TEXT Specific model to use
-o, --output FILE Save code to file
-r, --readme FILE Save documentation to file
-q, --quiet Non-interactive mode
--clipboard Copy output to clipboard
--list-models Show available models
```
**Examples**
```bash
snapinfra -b groq "k8s setup"
snapinfra -o main.tf "terraform VPC"
snapinfra --clipboard "docker compose"
```
## Why Choose SnapInfra?
**For Developers**
- Generate infrastructure faster than manual coding
- Learn best practices through AI-generated examples
- Consistent, documented infrastructure code
- Works with your existing tools and workflows
**For Teams**
- Standardize infrastructure patterns across projects
- Reduce knowledge silos with documented code
- Faster onboarding with readable, explained infrastructure
- Multi-environment consistency (dev/staging/prod)
**For Enterprises**
- Security best practices built into every template
- Compliance-ready configurations
- Cost-optimized resource specifications
- Integration with existing CI/CD pipelines
## Enterprise Support
**Professional Services**
- Custom AI model integration
- Enterprise template development
- Team training and onboarding
- Architecture review and optimization
**Support Channels**
- GitHub Issues: Bug reports and feature requests
- Enterprise Support: Priority support and SLA
- Community: Discussions and examples
**Compliance & Security**
- SOC 2 compliant infrastructure templates
- CIS benchmarks integration
- Security scanning and validation
- Audit logging and compliance reporting
## Development
**From Source**
```bash
git clone https://github.com/manojmaheshwarjg/rhinoback.git
cd snapinfracli
pip install -e ".[dev]"
```
**Testing**
```bash
pytest
pytest --cov=snapinfra
```
**Contributing**
1. Fork the repository
2. Create a feature branch
3. Add tests for new functionality
4. Ensure all tests pass
5. Submit a pull request
**Project Structure**
```
src/snapinfra/
├── cli/ # Command-line interface
├── backends/ # AI provider implementations
├── config/ # Configuration management
├── types/ # Data models and types
└── utils/ # Utility functions
```
## License
**Apache License 2.0**
SnapInfra is open-source software licensed under the Apache License 2.0. This means:
- ✅ Commercial use allowed
- ✅ Modification and distribution permitted
- ✅ Patent protection provided
- ✅ Private use permitted
- ⚠️ Must include license and copyright notice
- ⚠️ Must state changes made to the code
---
**Built with ❤️ by developers, for developers**
[GitHub](https://github.com/manojmaheshwarjg/rhinoback) • [PyPI](https://pypi.org/project/snapinfra/) • [Issues](https://github.com/manojmaheshwarjg/rhinoback/issues) • [Discussions](https://github.com/manojmaheshwarjg/rhinoback/discussions)
Raw data
{
"_id": null,
"home_page": null,
"name": "snapinfra",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ai, infrastructure, iac, terraform, kubernetes, docker, architecture, cloudformation, llm, openai, groq, bedrock, ollama, code-generation, devops, automation, cli-tool, infrastructure-automation, cloud, aws, azure, gcp, diagrams, mermaid, chat-based, natural-language, ai-powered, production-ready",
"author": null,
"author_email": "Manoj Maheshwar Jagadeesan <manojmaheshwarjg@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/fc/7b/f9a6b64d5f6afcf2434ed042871917a1a90b7edebf5d0d1341dd6031fba0/snapinfra-1.0.3.tar.gz",
"platform": null,
"description": "# SnapInfra\r\n\r\n[](https://badge.fury.io/py/snapinfra)\r\n[](https://pepy.tech/project/snapinfra)\r\n[](https://www.python.org/downloads/)\r\n[](https://opensource.org/licenses/Apache-2.0)\r\n\r\n**AI-powered infrastructure code generation from natural language**\r\n\r\nTransform plain English into production-ready infrastructure code. Generate Terraform, Kubernetes manifests, Docker configurations, and architectural diagrams using state-of-the-art AI models.\r\n\r\n```bash\r\npip install snapinfra\r\nsnapinfra \"Create a 3-tier AWS architecture with load balancer and RDS\"\r\n```\r\n\r\n## Key Features\r\n\r\n- **Multi-Provider AI**: OpenAI, Groq, AWS Bedrock, Ollama support\r\n- **Production-Ready**: Security best practices and scalability built-in\r\n- **Interactive Chat**: Refine and iterate on your infrastructure\r\n- **Architecture Diagrams**: Auto-generated Mermaid diagrams\r\n- **Cross-Platform**: Works on Windows, macOS, and Linux\r\n\r\n## Quick Start\r\n\r\n**Install**\r\n```bash\r\npip install snapinfra\r\n```\r\n\r\n**Set API Key**\r\n```bash\r\n# Free Groq API (recommended)\r\nexport GROQ_API_KEY=\"your-api-key\"\r\n\r\n# Or OpenAI\r\nexport OPENAI_API_KEY=\"your-api-key\"\r\n```\r\n\r\n**Generate Infrastructure**\r\n```bash\r\n# AWS Infrastructure\r\nsnapinfra \"terraform for AWS VPC with public/private subnets\"\r\n\r\n# Kubernetes\r\nsnapinfra \"k8s deployment for nginx with ingress\"\r\n\r\n# Docker\r\nsnapinfra \"docker-compose for React app with PostgreSQL\"\r\n\r\n# With specific AI provider\r\nsnapinfra -b groq \"serverless architecture with API Gateway and Lambda\"\r\n```\r\n\r\n## Supported Infrastructure\r\n\r\n| Platform | Templates | Features |\r\n|----------|-----------|----------|\r\n| **Terraform** | AWS, Azure, GCP | Multi-cloud, modules, best practices |\r\n| **Kubernetes** | Deployments, Services, Ingress | RBAC, security policies, monitoring |\r\n| **Docker** | Dockerfiles, Compose | Multi-stage, optimization, security |\r\n| **CloudFormation** | Serverless, Containers | AWS native, nested stacks |\r\n| **Ansible** | Configuration, Deployment | Automation, orchestration |\r\n| **Helm** | Charts, Values | Kubernetes package management |\r\n\r\n## AI Providers\r\n\r\n| Provider | Speed | Cost | Best For |\r\n|----------|-------|------|----------|\r\n| **Groq** | Ultra-fast | Free tier | Development, prototyping |\r\n| **OpenAI** | Fast | Pay-per-use | Production, complex scenarios |\r\n| **AWS Bedrock** | Fast | Enterprise | AWS environments |\r\n| **Ollama** | Variable | Free | Privacy, offline usage |\r\n\r\n### Setup Examples\r\n\r\n**Groq (Recommended)**\r\n```bash\r\nexport GROQ_API_KEY=\"gsk_...\"\r\nsnapinfra -b groq \"terraform for EKS cluster\"\r\n```\r\n\r\n**OpenAI**\r\n```bash\r\nexport OPENAI_API_KEY=\"sk-...\"\r\nsnapinfra -b openai -m gpt-4 \"complex microservices architecture\"\r\n```\r\n\r\n**Local with Ollama**\r\n```bash\r\n# No API key needed\r\nsnapinfra -b ollama \"docker setup for development\"\r\n```\r\n\r\n## Common Use Cases\r\n\r\n**Cloud Infrastructure**\r\n```bash\r\n# Complete AWS setup\r\nsnapinfra \"3-tier architecture: ALB, ECS, RDS with monitoring\"\r\n\r\n# Multi-cloud\r\nsnapinfra \"hybrid setup: AWS primary, Azure DR\"\r\n\r\n# Serverless\r\nsnapinfra \"event-driven architecture with Lambda and SQS\"\r\n```\r\n\r\n**Container Orchestration**\r\n```bash\r\n# Microservices\r\nsnapinfra \"k8s platform: ingress, services, deployments, monitoring\"\r\n\r\n# Development environment\r\nsnapinfra \"docker-compose: app, database, redis, monitoring\"\r\n\r\n# Production setup\r\nsnapinfra \"helm chart for multi-tier application\"\r\n```\r\n\r\n**Development Workflows**\r\n```bash\r\n# CI/CD\r\nsnapinfra \"GitHub Actions: test, build, deploy to EKS\"\r\n\r\n# Infrastructure as Code\r\nsnapinfra \"Terraform modules for reusable VPC patterns\"\r\n\r\n# Security\r\nsnapinfra \"k8s network policies and RBAC for microservices\"\r\n```\r\n\r\n## Advanced Features\r\n\r\n**Interactive Chat Mode**\r\n```bash\r\nsnapinfra \"basic AWS setup\"\r\n# SnapInfra generates initial code\r\n# Continue refining: \"add monitoring\", \"make it multi-region\", \"add security groups\"\r\n```\r\n\r\n**Architecture Diagrams**\r\n```bash\r\n# Auto-generates Mermaid diagrams\r\nsnapinfra \"AWS infrastructure with architecture diagram\"\r\n# Creates both code and visual representation\r\n```\r\n\r\n**Multiple Output Formats**\r\n```bash\r\n# Save to files\r\nsnapinfra -o main.tf \"terraform VPC setup\"\r\n\r\n# With documentation\r\nsnapinfra -o main.tf -r README.md \"EKS cluster with docs\"\r\n\r\n# Copy to clipboard\r\nsnapinfra --clipboard \"docker setup\"\r\n```\r\n\r\n**Batch Processing**\r\n```bash\r\n# Multiple environments\r\nsnapinfra \"terraform modules for dev, staging, prod\"\r\n\r\n# Different cloud providers\r\nsnapinfra \"same app architecture for AWS, Azure, GCP\"\r\n```\r\n\r\n## Configuration\r\n\r\n**Environment Variables (Simple)**\r\n```bash\r\n# Choose your AI provider\r\nexport GROQ_API_KEY=\"gsk_...\"\r\nexport OPENAI_API_KEY=\"sk_...\"\r\n```\r\n\r\n**TOML Config (Advanced)**\r\n```toml\r\n# ~/.config/snapinfra/config.toml\r\ndefault_backend = \"groq\"\r\n\r\n[backends.groq]\r\ntype = \"groq\"\r\napi_key = \"$GROQ_API_KEY\"\r\ndefault_model = \"llama-4-scout-17b\"\r\n\r\n[backends.openai]\r\ntype = \"openai\"\r\napi_key = \"$OPENAI_API_KEY\"\r\ndefault_model = \"gpt-4\"\r\n\r\n[backends.bedrock]\r\ntype = \"bedrock\"\r\naws_profile = \"default\"\r\naws_region = \"us-east-1\"\r\n```\r\n\r\n## CLI Reference\r\n\r\n**Basic Usage**\r\n```bash\r\nsnapinfra [OPTIONS] \"your infrastructure description\"\r\n```\r\n\r\n**Common Options**\r\n```bash\r\n-b, --backend TEXT AI provider (groq, openai, bedrock, ollama)\r\n-m, --model TEXT Specific model to use\r\n-o, --output FILE Save code to file\r\n-r, --readme FILE Save documentation to file \r\n-q, --quiet Non-interactive mode\r\n--clipboard Copy output to clipboard\r\n--list-models Show available models\r\n```\r\n\r\n**Examples**\r\n```bash\r\nsnapinfra -b groq \"k8s setup\"\r\nsnapinfra -o main.tf \"terraform VPC\"\r\nsnapinfra --clipboard \"docker compose\"\r\n```\r\n\r\n## Why Choose SnapInfra?\r\n\r\n**For Developers**\r\n- Generate infrastructure faster than manual coding\r\n- Learn best practices through AI-generated examples\r\n- Consistent, documented infrastructure code\r\n- Works with your existing tools and workflows\r\n\r\n**For Teams**\r\n- Standardize infrastructure patterns across projects\r\n- Reduce knowledge silos with documented code\r\n- Faster onboarding with readable, explained infrastructure\r\n- Multi-environment consistency (dev/staging/prod)\r\n\r\n**For Enterprises**\r\n- Security best practices built into every template\r\n- Compliance-ready configurations\r\n- Cost-optimized resource specifications\r\n- Integration with existing CI/CD pipelines\r\n\r\n## Enterprise Support\r\n\r\n**Professional Services**\r\n- Custom AI model integration\r\n- Enterprise template development\r\n- Team training and onboarding\r\n- Architecture review and optimization\r\n\r\n**Support Channels**\r\n- GitHub Issues: Bug reports and feature requests\r\n- Enterprise Support: Priority support and SLA\r\n- Community: Discussions and examples\r\n\r\n**Compliance & Security**\r\n- SOC 2 compliant infrastructure templates\r\n- CIS benchmarks integration\r\n- Security scanning and validation\r\n- Audit logging and compliance reporting\r\n\r\n## Development\r\n\r\n**From Source**\r\n```bash\r\ngit clone https://github.com/manojmaheshwarjg/rhinoback.git\r\ncd snapinfracli\r\npip install -e \".[dev]\"\r\n```\r\n\r\n**Testing**\r\n```bash\r\npytest\r\npytest --cov=snapinfra\r\n```\r\n\r\n**Contributing**\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Add tests for new functionality\r\n4. Ensure all tests pass\r\n5. Submit a pull request\r\n\r\n**Project Structure**\r\n```\r\nsrc/snapinfra/\r\n\u251c\u2500\u2500 cli/ # Command-line interface\r\n\u251c\u2500\u2500 backends/ # AI provider implementations \r\n\u251c\u2500\u2500 config/ # Configuration management\r\n\u251c\u2500\u2500 types/ # Data models and types\r\n\u2514\u2500\u2500 utils/ # Utility functions\r\n```\r\n\r\n## License\r\n\r\n**Apache License 2.0**\r\n\r\nSnapInfra is open-source software licensed under the Apache License 2.0. This means:\r\n\r\n- \u2705 Commercial use allowed\r\n- \u2705 Modification and distribution permitted \r\n- \u2705 Patent protection provided\r\n- \u2705 Private use permitted\r\n- \u26a0\ufe0f Must include license and copyright notice\r\n- \u26a0\ufe0f Must state changes made to the code\r\n\r\n---\r\n\r\n**Built with \u2764\ufe0f by developers, for developers**\r\n\r\n[GitHub](https://github.com/manojmaheshwarjg/rhinoback) \u2022 [PyPI](https://pypi.org/project/snapinfra/) \u2022 [Issues](https://github.com/manojmaheshwarjg/rhinoback/issues) \u2022 [Discussions](https://github.com/manojmaheshwarjg/rhinoback/discussions)\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Revolutionary AI-powered CLI that generates production-ready infrastructure code, architectural diagrams, and comprehensive documentation from natural language descriptions. Supports Terraform, Kubernetes, Docker, CloudFormation, and more with multi-provider AI backends including OpenAI, Groq, AWS Bedrock, and Ollama.",
"version": "1.0.3",
"project_urls": {
"Bug Reports": "https://github.com/manojmaheshwarjg/rhinoback/issues",
"Documentation": "https://github.com/manojmaheshwarjg/rhinoback#readme",
"Homepage": "https://github.com/manojmaheshwarjg/rhinoback",
"Repository": "https://github.com/manojmaheshwarjg/rhinoback.git"
},
"split_keywords": [
"ai",
" infrastructure",
" iac",
" terraform",
" kubernetes",
" docker",
" architecture",
" cloudformation",
" llm",
" openai",
" groq",
" bedrock",
" ollama",
" code-generation",
" devops",
" automation",
" cli-tool",
" infrastructure-automation",
" cloud",
" aws",
" azure",
" gcp",
" diagrams",
" mermaid",
" chat-based",
" natural-language",
" ai-powered",
" production-ready"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f3dc61e3b101d4851a58f158028324235e03b6e6f7a2412e881c5e6d8e9a2cbc",
"md5": "9a0ed75730632cfd0a492359c5db37a0",
"sha256": "be3e04ac76d2f54d6d4706d2c0b3e26721e22d89690af43422a157bdc8d231d6"
},
"downloads": -1,
"filename": "snapinfra-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9a0ed75730632cfd0a492359c5db37a0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 163781,
"upload_time": "2025-10-13T23:50:06",
"upload_time_iso_8601": "2025-10-13T23:50:06.845286Z",
"url": "https://files.pythonhosted.org/packages/f3/dc/61e3b101d4851a58f158028324235e03b6e6f7a2412e881c5e6d8e9a2cbc/snapinfra-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fc7bf9a6b64d5f6afcf2434ed042871917a1a90b7edebf5d0d1341dd6031fba0",
"md5": "55d922c0a3f08a5045e6c14a9dc44e66",
"sha256": "f5e92da34ab2df6e357b18ae06cd26c124300eb9d83d68299da5a5b04acc8179"
},
"downloads": -1,
"filename": "snapinfra-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "55d922c0a3f08a5045e6c14a9dc44e66",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 153882,
"upload_time": "2025-10-13T23:50:07",
"upload_time_iso_8601": "2025-10-13T23:50:07.830717Z",
"url": "https://files.pythonhosted.org/packages/fc/7b/f9a6b64d5f6afcf2434ed042871917a1a90b7edebf5d0d1341dd6031fba0/snapinfra-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-13 23:50:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "manojmaheshwarjg",
"github_project": "rhinoback",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "snapinfra"
}