py-config-ai
🧠 AI-powered configuration file generator for developers
Author: Sherin Joseph Roy
GitHub: https://github.com/Sherin-SEF-AI/py-config-ai
Email: sherin.joseph2217@gmail.com
Generate configuration files like .prettierrc, .eslintrc, pyproject.toml, black, ruff, flake8, and more using AI providers (OpenAI, Claude, Gemini, Groq). Simply describe your preferences in natural language and let AI create the perfect configuration for your project.
✨ Features
- 🤖 Multiple AI Providers: Support for OpenAI, Anthropic Claude, Google Gemini, and Groq
- 🔐 Secure Key Management: Encrypted storage of API keys using keyring
- 📝 Rich CLI Interface: Beautiful, interactive command-line interface with Rich
- 🎯 Smart Presets: Pre-built configurations for common project types (FastAPI, Django, React, etc.)
- 🔧 Extensive Config Support: 15+ configuration types including Python, JavaScript, Docker, and more
- 💬 Natural Language: Describe your needs in plain English
- 🎨 Interactive Mode: Guided setup with prompts and previews
- 🧪 Connection Testing: Verify your AI provider setup
🚀 Quick Start
1. Install the package
pip install py-config-ai
2. Add your API key
py-config-ai add-key groq your-api-key-here
3. Generate configurations using natural language!
Simple natural language commands:
# Generate a Python formatter config
py-config-ai create "I want to format Python code with 88 character line length"
# Create a React prettier config
py-config-ai create "Generate a prettier config for a React project with 2 spaces"
# Create a Docker setup
py-config-ai create "Create a dockerfile for a Python FastAPI application"
# Generate a gitignore
py-config-ai create "Create a gitignore file for a Python project with virtual environments"
Interactive guided mode:
py-config-ai generate --interactive
Traditional command-line mode:
py-config-ai generate --type black --description "100 character line length with strict formatting"
✨ Key Features
🧠 Natural Language Integration
- Describe what you want in plain English - no need to know exact config names
- Smart configuration type detection - automatically identifies the right config type
- Conversational interface - guided prompts with helpful examples
- Context-aware generation - understands your project structure
📁 Automatic File Management
- Smart file naming - automatically saves with correct extensions
- No more copy-paste - files are saved directly to disk
- Ready to edit - open files immediately in your preferred editor
- Proper file extensions -
.toml,.json,.conf, etc.
🔍 Context-Aware Generation
- Project structure analysis - understands your codebase layout
- Framework detection - recognizes Django, Flask, React, Next.js, etc.
- File type counting - knows how many Python, JS, TS files you have
- Existing config detection - builds upon your current setup
- Directory-aware patterns - includes relevant exclusions and includes
🔧 Multiple AI Providers
- OpenAI (GPT-4, GPT-3.5-turbo)
- Anthropic Claude (Claude-3-Sonnet, Claude-3-Haiku)
- Google Gemini (Gemini-1.5-Pro)
- Groq (Llama3-8b-8192)
🛡️ Security & Quality
- Secure API key storage using keyring with fallback
- Input validation for all user inputs
- Comprehensive error handling
- Type hints throughout the codebase
📋 Supported Configuration Types
Python
pyproject.toml- Python project configuration (PEP 518)black- Code formatterisort- Import sorterruff- Fast linter and formatterflake8- Style guide enforcementpylint- Static code analysismypy- Static type checker
JavaScript/TypeScript
.prettierrc- Code formatter.eslintrc- Lintertsconfig.json- TypeScript compiler
Other
markdownlint.json- Markdown linterstylelint- CSS/SCSS linterdockerfile- Docker container.env- Environment variablesdocker-compose.yml- Multi-container setupnginx.conf- Web servergitignore- Git ignore patterns
🎯 Available Presets
- fastapi - FastAPI web application with modern Python tooling
- django - Django web application with comprehensive tooling
- react - React application with modern JavaScript tooling
- node - Node.js application with modern JavaScript tooling
- python-library - Python library with comprehensive development tooling
🛠️ CLI Commands
Natural Language Generation
# Simple natural language commands
py-config-ai create "I want to format Python code with 88 character line length"
py-config-ai create "Generate a prettier config for a React project"
py-config-ai create "Create a dockerfile for a Python FastAPI application"
# With custom output file
py-config-ai create "Generate an ESLint config" --output .eslintrc.json
# With context (analyzes your project structure)
py-config-ai create "Create a gitignore for a Python project" --context .
py-config-ai create "Generate pyproject.toml for this package" --context .
py-config-ai create "Create Docker setup for this FastAPI app" --context .
Traditional Generation
# Interactive mode
py-config-ai generate --interactive
# Generate specific config
py-config-ai generate --type black --description "100 char line length, strict formatting"
# Use preset
py-config-ai generate --preset fastapi
# With context
py-config-ai generate --type .eslintrc --context ./src --description "React project with TypeScript"
# Show preview before saving
py-config-ai generate --type .prettierrc --preview --output .prettierrc.json
API Key Management
# Add API key
py-config-ai add-key openai
py-config-ai add-key anthropic
py-config-ai add-key gemini
py-config-ai add-key groq
# List configured keys
py-config-ai list-keys
# Remove key
py-config-ai remove-key openai
Information Commands
# List supported config types
py-config-ai list
# List available presets
py-config-ai presets
# Test provider connection
py-config-ai test --provider openai
🔧 Configuration Examples
Black Configuration
py-config-ai generate --type black --description "Use 100 character line length, target Python 3.9+, and exclude tests directory"
ESLint Configuration
py-config-ai generate --type .eslintrc --description "React project with TypeScript, use Airbnb style guide, and allow console.log in development"
Dockerfile
py-config-ai generate --type dockerfile --description "Python 3.11 slim image for FastAPI app, expose port 8000, use uvicorn"
🏗️ Project Structure
py-config-ai/
├── src/py_config_ai/
│ ├── core/
│ │ ├── generator.py # Main configuration generator
│ │ └── key_manager.py # Secure API key management
│ ├── providers/
│ │ ├── base.py # Abstract provider interface
│ │ ├── openai_provider.py
│ │ ├── anthropic_provider.py
│ │ ├── gemini_provider.py
│ │ └── groq_provider.py
│ ├── configs/
│ │ ├── config_types.py # Supported configuration types
│ │ └── presets.py # Pre-built configurations
│ ├── utils/
│ │ ├── file_utils.py # File operations
│ │ └── validation.py # Input validation
│ ├── templates/ # Configuration templates
│ └── cli.py # Command-line interface
├── tests/ # Test suite
├── docs/ # Documentation
└── pyproject.toml # Package configuration
🔒 Security
- API keys are stored securely using the
keyringlibrary - Fallback to encrypted local storage if keyring is unavailable
- No keys are logged or transmitted unnecessarily
- Input validation for all user-provided data
🧪 Testing
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run with coverage
pytest --cov=py_config_ai
# Run linting
black src/
isort src/
flake8 src/
mypy src/
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
# Clone the repository
git clone https://github.com/your-username/py-config-ai.git
cd py-config-ai
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author
Sherin Joseph Roy - Startup Founder & Hardware/IoT Enthusiast
- 🌐 Website: https://sherin-sef-ai.github.io/
- 📧 Email: sherin.joseph2217@gmail.com
- 🐙 GitHub: https://github.com/Sherin-SEF-AI
- 🔗 LinkedIn: Sherin Joseph Roy
About the Author
Sherin is a startup founder and hardware/IoT enthusiast passionate about building innovative solutions that bridge the gap between hardware and software. With expertise in autonomous systems, robotics, and AI, Sherin has developed multiple open-source packages on PyPI and is focused on creating intelligent machines that think and act independently.
Specializations:
- Autonomous Systems & Self-Driving Vehicles
- Robotics & Computer Vision
- IoT & Embedded Systems
- Hardware Design & Development
- AI/ML & Machine Learning
- Cybersecurity & Ethical Hacking
🙏 Acknowledgments
- Typer for the beautiful CLI framework
- Rich for the stunning terminal output
- Halo for the loading spinners
- All the AI providers for their amazing APIs
📞 Support
- 📧 Email: support@pyconfigai.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: Read the Docs
Made with ❤️ for developers who want to focus on code, not configuration.
Metadata
Release files for py-config-ai 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_config_ai-1.0.0.tar.gz | 31.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_config_ai-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.6 kB
Release files / py_config_ai-1.0.0.tar.gz
| Download URL | py_config_ai-1.0.0.tar.gz |
|---|---|
| Size | 31.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d761392ae9448fe907f18f0bcaf36f1310f9d156250d54c7109aa8b5ce5e6f8
|
|
BLAKE2b-256 checksum How to use checksums |
b0d5039b2b8ade8f2ee932375ed3c88786836cf8bb4694035316985a357955f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / py_config_ai-1.0.0-py3-none-any.whl
| Download URL | py_config_ai-1.0.0-py3-none-any.whl |
|---|---|
| Size | 32.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e983788fe9a110b3381947bb7b75b70188e2d0792fc1510107a5745e81565a0
|
|
BLAKE2b-256 checksum How to use checksums |
17f25592e6e2de66053a9ec2716a70d73102a51dea13a4065081e5ea86f98642
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|