# Autoklug - Blazing Fast AWS Lambda Build System
[](https://badge.fury.io/py/autoklug)
[](https://pypi.org/project/autoklug/)
[](https://opensource.org/licenses/MIT)
A **blazing fast**, high-performance AWS Lambda deployment system that works globally in any project with automatic context detection. Makes complex AWS infrastructure "stupid simple" with minimal configuration.
## 🚀 Core Principles
- **Unified Developer Experience**: One CLI, consistent interface
- **Build Locally, Deploy Globally**: Local development with seamless AWS deployment
- **Stupid Simple**: Complex AWS infrastructure made accessible with minimal configuration
- **Production Ready**: Enterprise-grade features with developer-friendly interfaces
```bash
# Autoklug Commands
autoklug init # Initialize project
autoklug run # Local development server
autoklug deploy # Deploy to AWS Lambda
autoklug deploy --validate # Deploy with enhanced validation
```
## 🚀 Features
- ⚡ **Parallel Processing**: Layers, functions, and APIs built simultaneously
- 🔄 **Smart Comparison**: Only updates what's changed using SHA256 hashing
- 📦 **S3 Requirements Checking**: Compares local requirements.txt with S3
- 🌐 **Public API Detection**: Automatically configures public APIs without authorizers
- 🚦 **Rate Limiting**: Built-in throttling for public APIs
- 🌍 **Global Usage**: Works in any project with auto-detection
- 🎨 **Beautiful CLI**: Click-based CLI with progress bars and colored output
- 🔧 **Zero Configuration**: Just run `autoklug build` from any project
## 📦 Installation
```bash
pip install autoklug
```
## 🎯 Quick Start
### **Zero Configuration Usage**
```bash
# Just run from any project directory - it detects everything!
autoklug build
```
### **With Explicit Configuration**
```bash
# Override auto-detection if needed
autoklug build --tool .tool.dev --env .env.dev
```
### **Individual Components**
```bash
# Build only layers
autoklug layers
# Build only functions
autoklug functions
# Build only API Gateway
autoklug api
```
### **Local Development**
```bash
# Start local development server
autoklug run
# With custom port
autoklug run --port 8080
# With authorizer simulation
autoklug run --use-authorizer
# With custom configuration
autoklug run --tool .tool.dev --env .env.dev
```
### **Project Analysis**
```bash
# See what the system detects
autoklug detect
# Show configuration
autoklug config
```
## 🔍 Project Context Detection
Autoklug automatically detects:
### **Configuration Files**
- `.tool`, `.tool.dev`, `.tool.prod`, `.tool.public`, etc.
- `.env`, `.env.dev`, `.env.prod`, etc.
- **Preference**: Uses `.tool` and `.env` over environment-specific versions
### **Project Structure**
- **API Directories**: `api/`, `api_public/`, `src/api/`, `functions/`, `lambda/`
- **Layer Directories**: `layers/`, `lambda_layers/`, `src/layers/`
### **Infrastructure Detection**
- **From File Names**: Detects `prod`, `staging`, `dev` from `.tool.*` files
- **Default**: Uses `dev` if not detected
- **Public APIs**: Detects from `api_public/` or `.tool.public.*` files
## 📊 Example Detection Output
```bash
$ autoklug detect
🔍 Project Context Detection
========================================
Current directory: /path/to/my-project
Detected infrastructure: prod
Public API detected: True
📁 Configuration Files:
Tool files found: ['.tool.public.prod', '.tool.dev', '.tool']
Env files found: ['.env.prod', '.env.dev', '.env']
Selected tool file: .tool.public.prod
Selected env file: .env.prod
📂 Project Structure:
API paths found: ['./api', './api_public']
Layer paths found: ['./layers']
```
## 🎨 CLI Commands
| Command | Description | Auto-Detection |
|---------|-------------|----------------|
| `autoklug build` | 🏗️ Build complete infrastructure | ✅ |
| `autoklug layers` | 📦 Build only Lambda layers | ✅ |
| `autoklug functions` | ⚡ Build only Lambda functions | ✅ |
| `autoklug api` | 🌐 Build only API Gateway | ✅ |
| `autoklug run` | 🚀 Start local development server | ✅ |
| `autoklug config` | ⚙️ Show configuration info | ✅ |
| `autoklug detect` | 🔍 Show project detection | ✅ |
| `autoklug demo` | 🎨 Run logging demo | ❌ |
## 🔧 Project Structure Support
Autoklug works with any of these common project structures:
### **Standard Structure**
```
my-project/
├── .tool
├── .env
├── api/
│ ├── health/
│ │ └── get.py
│ └── users/
│ ├── get.py
│ └── post.py
└── layers/
├── shared/
└── thirdparty/
└── requirements.txt
```
### **Public API Structure**
```
my-project/
├── .tool.public
├── .env
├── api_public/
│ ├── health/
│ └── catalog/
└── layers/
```
### **Environment-Specific Structure**
```
my-project/
├── .tool.dev
├── .tool.prod
├── .env.dev
├── .env.prod
├── api/
└── layers/
```
## ⚙️ Configuration Files
### **`.tool` File Example**
```bash
# AWS Configuration
AWS_PROFILE_BUILD=default
AWS_REGION=eu-west-3
AWS_ACCOUNT_ID=123456789012
# Application Configuration
APP_NAME=my-app
PUBLIC_APP_NAME=my-app-public
INFRA=dev
# Lambda Configuration
LAMBDA_RUNTIME=python3.11
LAMBDA_ROLE=arn:aws:iam::123456789012:role/lambda-execution-role
# Layer Configuration
LAYER_PATH=./layers
LAYER_COMPATIBLE_RUNTIMES=python3.11
LAYER_ARCHITECTURE=x86_64
# API Configuration
API_PATH=./api
AUTHORIZER_FUNCTION_NAME=api-my-app-dev-authorizer
# S3 Configuration for requirements.txt checking (auto-generated from APP_NAME)
# Bucket name will be: <APP_NAME>-requirements-txt-bucket
# Example: my-app-requirements-txt-bucket
```
### **`.env` File Example**
```bash
# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/my_app_dev
# External Services
UPLOADS_CDN=https://cdn.example.com
API_BASE_URL=https://api.example.com
# Feature Flags
ENABLE_FEATURE_X=true
DEBUG_MODE=true
```
## 🚀 Performance Benefits
- **Parallel Processing**: Up to 10 concurrent Lambda updates
- **Smart Comparison**: SHA256 hashing prevents unnecessary rebuilds
- **S3 Integration**: Requirements.txt comparison without local rebuilds
- **Boto3 Optimization**: Adaptive retries and connection pooling
- **Async/Await**: Non-blocking I/O operations
## 🎯 Use Cases
### **Development**
- **Local Development**: Quick builds during development
- **Feature Branches**: Deploy to dev environment
- **Testing**: Validate changes before production
### **CI/CD**
- **GitHub Actions**: Automated deployments
- **Jenkins**: Build pipeline integration
- **GitLab CI**: Continuous deployment
### **Production**
- **Blue-Green Deployments**: Zero-downtime updates
- **Rollback Support**: Quick reversion capabilities
- **Monitoring**: Health checks and validation
## 🔧 Advanced Usage
### **Force Layer Updates**
```bash
autoklug build --force-update-layers
```
### **Dry Run Mode**
```bash
autoklug build --dry-run
```
### **Verbose Logging**
```bash
autoklug build --verbose
```
### **Custom Configuration**
```bash
autoklug build --tool .tool.prod --env .env.prod
```
## 🛠️ Development
### **Install Development Dependencies**
```bash
pip install autoklug[dev]
```
### **Run Tests**
```bash
pytest
```
### **Code Formatting**
```bash
black autoklug/
```
### **Type Checking**
```bash
mypy autoklug/
```
## 📚 Documentation
- [Full Documentation](https://github.com/lewisklug/autoklug#readme)
- [API Reference](https://github.com/lewisklug/autoklug/blob/main/docs/api.md)
- [Configuration Guide](https://github.com/lewisklug/autoklug/blob/main/docs/configuration.md)
- [Examples](https://github.com/lewisklug/autoklug/blob/main/docs/examples.md)
## 🤝 Contributing
Contributions are welcome! Please see our [Contributing Guide](https://github.com/lewisklug/autoklug/blob/main/CONTRIBUTING.md) for details.
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 🙏 Acknowledgments
- Built with [Click](https://click.palletsprojects.com/) for CLI
- Uses [Boto3](https://boto3.amazonaws.com/) for AWS integration
- Inspired by modern DevOps practices
## 📞 Support
- **Issues**: [GitHub Issues](https://github.com/lewisklug/autoklug/issues)
- **Discussions**: [GitHub Discussions](https://github.com/lewisklug/autoklug/discussions)
- **Email**: luis@kluglabs.com
---
**Made with ❤️ by Luís Miguel Sousa**
*Blazing fast AWS Lambda deployments, globally!* 🚀
Raw data
{
"_id": null,
"home_page": "https://github.com/lewisklug/autoklug",
"name": "autoklug",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Lu\u00eds Miguel Sousa <luis@kluglabs.com>",
"keywords": "aws, lambda, serverless, build, deployment, api-gateway, infrastructure, devops, ci-cd",
"author": "Lu\u00eds Miguel Sousa",
"author_email": "Lu\u00eds Miguel Sousa <luis@kluglabs.com>",
"download_url": "https://files.pythonhosted.org/packages/51/cb/1394e04bc3c6984a4477f94ce24d63be424332af09e772d11cd6c6451d5f/autoklug-2.0.5.tar.gz",
"platform": null,
"description": "# Autoklug - Blazing Fast AWS Lambda Build System\n\n[](https://badge.fury.io/py/autoklug)\n[](https://pypi.org/project/autoklug/)\n[](https://opensource.org/licenses/MIT)\n\nA **blazing fast**, high-performance AWS Lambda deployment system that works globally in any project with automatic context detection. Makes complex AWS infrastructure \"stupid simple\" with minimal configuration.\n\n## \ud83d\ude80 Core Principles\n\n- **Unified Developer Experience**: One CLI, consistent interface\n- **Build Locally, Deploy Globally**: Local development with seamless AWS deployment \n- **Stupid Simple**: Complex AWS infrastructure made accessible with minimal configuration\n- **Production Ready**: Enterprise-grade features with developer-friendly interfaces\n\n```bash\n# Autoklug Commands\nautoklug init # Initialize project\nautoklug run # Local development server\nautoklug deploy # Deploy to AWS Lambda\nautoklug deploy --validate # Deploy with enhanced validation\n```\n\n## \ud83d\ude80 Features\n\n- \u26a1 **Parallel Processing**: Layers, functions, and APIs built simultaneously\n- \ud83d\udd04 **Smart Comparison**: Only updates what's changed using SHA256 hashing\n- \ud83d\udce6 **S3 Requirements Checking**: Compares local requirements.txt with S3\n- \ud83c\udf10 **Public API Detection**: Automatically configures public APIs without authorizers\n- \ud83d\udea6 **Rate Limiting**: Built-in throttling for public APIs\n- \ud83c\udf0d **Global Usage**: Works in any project with auto-detection\n- \ud83c\udfa8 **Beautiful CLI**: Click-based CLI with progress bars and colored output\n- \ud83d\udd27 **Zero Configuration**: Just run `autoklug build` from any project\n\n## \ud83d\udce6 Installation\n\n```bash\npip install autoklug\n```\n\n## \ud83c\udfaf Quick Start\n\n### **Zero Configuration Usage**\n```bash\n# Just run from any project directory - it detects everything!\nautoklug build\n```\n\n### **With Explicit Configuration**\n```bash\n# Override auto-detection if needed\nautoklug build --tool .tool.dev --env .env.dev\n```\n\n### **Individual Components**\n```bash\n# Build only layers\nautoklug layers\n\n# Build only functions \nautoklug functions\n\n# Build only API Gateway\nautoklug api\n```\n\n### **Local Development**\n```bash\n# Start local development server\nautoklug run\n\n# With custom port\nautoklug run --port 8080\n\n# With authorizer simulation\nautoklug run --use-authorizer\n\n# With custom configuration\nautoklug run --tool .tool.dev --env .env.dev\n```\n\n### **Project Analysis**\n```bash\n# See what the system detects\nautoklug detect\n\n# Show configuration\nautoklug config\n```\n\n## \ud83d\udd0d Project Context Detection\n\nAutoklug automatically detects:\n\n### **Configuration Files**\n- `.tool`, `.tool.dev`, `.tool.prod`, `.tool.public`, etc.\n- `.env`, `.env.dev`, `.env.prod`, etc.\n- **Preference**: Uses `.tool` and `.env` over environment-specific versions\n\n### **Project Structure**\n- **API Directories**: `api/`, `api_public/`, `src/api/`, `functions/`, `lambda/`\n- **Layer Directories**: `layers/`, `lambda_layers/`, `src/layers/`\n\n### **Infrastructure Detection**\n- **From File Names**: Detects `prod`, `staging`, `dev` from `.tool.*` files\n- **Default**: Uses `dev` if not detected\n- **Public APIs**: Detects from `api_public/` or `.tool.public.*` files\n\n## \ud83d\udcca Example Detection Output\n\n```bash\n$ autoklug detect\n\n\ud83d\udd0d Project Context Detection\n========================================\nCurrent directory: /path/to/my-project\nDetected infrastructure: prod\nPublic API detected: True\n\n\ud83d\udcc1 Configuration Files:\nTool files found: ['.tool.public.prod', '.tool.dev', '.tool']\nEnv files found: ['.env.prod', '.env.dev', '.env']\nSelected tool file: .tool.public.prod\nSelected env file: .env.prod\n\n\ud83d\udcc2 Project Structure:\nAPI paths found: ['./api', './api_public']\nLayer paths found: ['./layers']\n```\n\n## \ud83c\udfa8 CLI Commands\n\n| Command | Description | Auto-Detection |\n|---------|-------------|----------------|\n| `autoklug build` | \ud83c\udfd7\ufe0f Build complete infrastructure | \u2705 |\n| `autoklug layers` | \ud83d\udce6 Build only Lambda layers | \u2705 |\n| `autoklug functions` | \u26a1 Build only Lambda functions | \u2705 |\n| `autoklug api` | \ud83c\udf10 Build only API Gateway | \u2705 |\n| `autoklug run` | \ud83d\ude80 Start local development server | \u2705 |\n| `autoklug config` | \u2699\ufe0f Show configuration info | \u2705 |\n| `autoklug detect` | \ud83d\udd0d Show project detection | \u2705 |\n| `autoklug demo` | \ud83c\udfa8 Run logging demo | \u274c |\n\n## \ud83d\udd27 Project Structure Support\n\nAutoklug works with any of these common project structures:\n\n### **Standard Structure**\n```\nmy-project/\n\u251c\u2500\u2500 .tool\n\u251c\u2500\u2500 .env\n\u251c\u2500\u2500 api/\n\u2502 \u251c\u2500\u2500 health/\n\u2502 \u2502 \u2514\u2500\u2500 get.py\n\u2502 \u2514\u2500\u2500 users/\n\u2502 \u251c\u2500\u2500 get.py\n\u2502 \u2514\u2500\u2500 post.py\n\u2514\u2500\u2500 layers/\n \u251c\u2500\u2500 shared/\n \u2514\u2500\u2500 thirdparty/\n \u2514\u2500\u2500 requirements.txt\n```\n\n### **Public API Structure**\n```\nmy-project/\n\u251c\u2500\u2500 .tool.public\n\u251c\u2500\u2500 .env\n\u251c\u2500\u2500 api_public/\n\u2502 \u251c\u2500\u2500 health/\n\u2502 \u2514\u2500\u2500 catalog/\n\u2514\u2500\u2500 layers/\n```\n\n### **Environment-Specific Structure**\n```\nmy-project/\n\u251c\u2500\u2500 .tool.dev\n\u251c\u2500\u2500 .tool.prod\n\u251c\u2500\u2500 .env.dev\n\u251c\u2500\u2500 .env.prod\n\u251c\u2500\u2500 api/\n\u2514\u2500\u2500 layers/\n```\n\n## \u2699\ufe0f Configuration Files\n\n### **`.tool` File Example**\n```bash\n# AWS Configuration\nAWS_PROFILE_BUILD=default\nAWS_REGION=eu-west-3\nAWS_ACCOUNT_ID=123456789012\n\n# Application Configuration\nAPP_NAME=my-app\nPUBLIC_APP_NAME=my-app-public\nINFRA=dev\n\n# Lambda Configuration\nLAMBDA_RUNTIME=python3.11\nLAMBDA_ROLE=arn:aws:iam::123456789012:role/lambda-execution-role\n\n# Layer Configuration\nLAYER_PATH=./layers\nLAYER_COMPATIBLE_RUNTIMES=python3.11\nLAYER_ARCHITECTURE=x86_64\n\n# API Configuration\nAPI_PATH=./api\nAUTHORIZER_FUNCTION_NAME=api-my-app-dev-authorizer\n\n# S3 Configuration for requirements.txt checking (auto-generated from APP_NAME)\n# Bucket name will be: <APP_NAME>-requirements-txt-bucket\n# Example: my-app-requirements-txt-bucket\n```\n\n### **`.env` File Example**\n```bash\n# Database Configuration\nDATABASE_URL=postgresql://user:password@localhost:5432/my_app_dev\n\n# External Services\nUPLOADS_CDN=https://cdn.example.com\nAPI_BASE_URL=https://api.example.com\n\n# Feature Flags\nENABLE_FEATURE_X=true\nDEBUG_MODE=true\n```\n\n## \ud83d\ude80 Performance Benefits\n\n- **Parallel Processing**: Up to 10 concurrent Lambda updates\n- **Smart Comparison**: SHA256 hashing prevents unnecessary rebuilds\n- **S3 Integration**: Requirements.txt comparison without local rebuilds\n- **Boto3 Optimization**: Adaptive retries and connection pooling\n- **Async/Await**: Non-blocking I/O operations\n\n## \ud83c\udfaf Use Cases\n\n### **Development**\n- **Local Development**: Quick builds during development\n- **Feature Branches**: Deploy to dev environment\n- **Testing**: Validate changes before production\n\n### **CI/CD**\n- **GitHub Actions**: Automated deployments\n- **Jenkins**: Build pipeline integration\n- **GitLab CI**: Continuous deployment\n\n### **Production**\n- **Blue-Green Deployments**: Zero-downtime updates\n- **Rollback Support**: Quick reversion capabilities\n- **Monitoring**: Health checks and validation\n\n## \ud83d\udd27 Advanced Usage\n\n### **Force Layer Updates**\n```bash\nautoklug build --force-update-layers\n```\n\n### **Dry Run Mode**\n```bash\nautoklug build --dry-run\n```\n\n### **Verbose Logging**\n```bash\nautoklug build --verbose\n```\n\n### **Custom Configuration**\n```bash\nautoklug build --tool .tool.prod --env .env.prod\n```\n\n## \ud83d\udee0\ufe0f Development\n\n### **Install Development Dependencies**\n```bash\npip install autoklug[dev]\n```\n\n### **Run Tests**\n```bash\npytest\n```\n\n### **Code Formatting**\n```bash\nblack autoklug/\n```\n\n### **Type Checking**\n```bash\nmypy autoklug/\n```\n\n## \ud83d\udcda Documentation\n\n- [Full Documentation](https://github.com/lewisklug/autoklug#readme)\n- [API Reference](https://github.com/lewisklug/autoklug/blob/main/docs/api.md)\n- [Configuration Guide](https://github.com/lewisklug/autoklug/blob/main/docs/configuration.md)\n- [Examples](https://github.com/lewisklug/autoklug/blob/main/docs/examples.md)\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please see our [Contributing Guide](https://github.com/lewisklug/autoklug/blob/main/CONTRIBUTING.md) for details.\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- Built with [Click](https://click.palletsprojects.com/) for CLI\n- Uses [Boto3](https://boto3.amazonaws.com/) for AWS integration\n- Inspired by modern DevOps practices\n\n## \ud83d\udcde Support\n\n- **Issues**: [GitHub Issues](https://github.com/lewisklug/autoklug/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/lewisklug/autoklug/discussions)\n- **Email**: luis@kluglabs.com\n\n---\n\n**Made with \u2764\ufe0f by Lu\u00eds Miguel Sousa**\n\n*Blazing fast AWS Lambda deployments, globally!* \ud83d\ude80\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Blazing Fast AWS Lambda Build System with Global Project Detection",
"version": "2.0.5",
"project_urls": {
"Documentation": "https://github.com/lewisklug/autoklug#readme",
"Homepage": "https://github.com/lewisklug/autoklug",
"Issues": "https://github.com/lewisklug/autoklug/issues",
"Repository": "https://github.com/lewisklug/autoklug"
},
"split_keywords": [
"aws",
" lambda",
" serverless",
" build",
" deployment",
" api-gateway",
" infrastructure",
" devops",
" ci-cd"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9b7fc23d1ff0ea902aff89b4b0f3f4899e8aa5f073c9afbfd081f721123bcb95",
"md5": "e1db900e9486928b3c928ac5848a1057",
"sha256": "9e93104a05abb1d3640ac037d994d0abd018cb6ef57ec12c81002c4991d03cbc"
},
"downloads": -1,
"filename": "autoklug-2.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e1db900e9486928b3c928ac5848a1057",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 76416,
"upload_time": "2025-10-15T14:52:51",
"upload_time_iso_8601": "2025-10-15T14:52:51.776267Z",
"url": "https://files.pythonhosted.org/packages/9b/7f/c23d1ff0ea902aff89b4b0f3f4899e8aa5f073c9afbfd081f721123bcb95/autoklug-2.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "51cb1394e04bc3c6984a4477f94ce24d63be424332af09e772d11cd6c6451d5f",
"md5": "4c1a5a094a6c1d4c0ca4a2637c99f954",
"sha256": "69ffb6830902685acd9afbe62131981f240c3956543fdcc8db7091fc881d5c68"
},
"downloads": -1,
"filename": "autoklug-2.0.5.tar.gz",
"has_sig": false,
"md5_digest": "4c1a5a094a6c1d4c0ca4a2637c99f954",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 65044,
"upload_time": "2025-10-15T14:52:53",
"upload_time_iso_8601": "2025-10-15T14:52:53.385196Z",
"url": "https://files.pythonhosted.org/packages/51/cb/1394e04bc3c6984a4477f94ce24d63be424332af09e772d11cd6c6451d5f/autoklug-2.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-15 14:52:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lewisklug",
"github_project": "autoklug",
"github_not_found": true,
"lcname": "autoklug"
}