AI-powered configuration file generator for developers with natural language processing and context-aware generation
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_config_ai-1.0.0.tar.gz.
File metadata
- Download URL: py_config_ai-1.0.0.tar.gz
- Upload date:
- Size: 31.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d761392ae9448fe907f18f0bcaf36f1310f9d156250d54c7109aa8b5ce5e6f8
|
|
| MD5 |
eae6b53f823f4f3e1facc2c8fc68f181
|
|
| BLAKE2b-256 |
b0d5039b2b8ade8f2ee932375ed3c88786836cf8bb4694035316985a357955f5
|
File details
Details for the file py_config_ai-1.0.0-py3-none-any.whl.
File metadata
- Download URL: py_config_ai-1.0.0-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e983788fe9a110b3381947bb7b75b70188e2d0792fc1510107a5745e81565a0
|
|
| MD5 |
f1e91d82a2ee4e19dce3a8031905a0f5
|
|
| BLAKE2b-256 |
17f25592e6e2de66053a9ec2716a70d73102a51dea13a4065081e5ea86f98642
|