Skip to content

MukundaKatta/ConfigAI

Repository files navigation

ConfigAI

CI Python 3.10+ License: MIT Code style: black

Smart config file generator — A Python CLI that generates configuration files (YAML, TOML, JSON, .env) from templates with smart defaults based on project type detection.


How It Works

flowchart LR
    A[Project Directory] --> B[Detect Project Type]
    B --> C{Project Type}
    C -->|Python| D[Python Templates]
    C -->|Node| E[Node Templates]
    C -->|Docker| F[Docker Templates]
    C -->|CI| G[CI Templates]
    D --> H[Generate Config]
    E --> H
    F --> H
    G --> H
    H --> I{Output Format}
    I -->|YAML| J[.yaml]
    I -->|TOML| K[.toml]
    I -->|JSON| L[.json]
    I -->|ENV| M[.env]
Loading

Quickstart

Installation

pip install configai

Or install from source:

git clone https://github.com/officethree/ConfigAI.git
cd ConfigAI
pip install -e .

Usage

Auto-detect project type and generate config:

configai generate .

Generate a specific format:

configai generate . --format yaml
configai generate . --format toml
configai generate . --format json
configai generate . --format env

Specify project type manually:

configai generate . --project-type python
configai generate . --project-type node

Merge configs:

configai merge base.yaml override.yaml -o merged.yaml

Validate a config against a schema:

configai validate config.yaml --schema schema.json

List available templates:

configai templates

Python API

from configai import ConfigAI

ai = ConfigAI()

# Auto-detect project type
project_type = ai.detect_project("/path/to/project")

# Generate configs
env_config = ai.generate_env(project_type)
yaml_config = ai.generate_yaml({"app": {"name": "myapp", "port": 8080}})

# Export to file
ai.export(yaml_config, format="yaml", path="config.yaml")

Features

  • Auto-detection of Python, Node.js, Docker, and CI projects
  • Built-in templates with smart defaults for each project type
  • Support for YAML, TOML, JSON, and .env output formats
  • Config merging with deep override support
  • Config validation against JSON schemas
  • Extensible template system
  • Clean CLI powered by Typer

Development

make install    # Install in dev mode
make test       # Run tests
make lint       # Run linter
make format     # Format code

Inspired by developer tooling and configuration management trends.


Built by Officethree Technologies | Made with love and AI

About

Smart config file generator — auto-detect projects, generate YAML/TOML/JSON/.env with smart defaults

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors