diff --git a/README.md b/README.md index a027938..82930fc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,109 @@ -# configforge +# ConfigForge -A CLI tool for validating, converting, and generating schemas for configuration files. Supports JSON, YAML, TOML, and ENV formats. \ No newline at end of file +![Python Version](https://img.shields.io/badge/python-3.8%2B-blue) +![License](https://img.shields.io/badge/License-MIT-green) +![Version](https://img.shields.io/badge/Version-1.0.0-orange) + +A powerful CLI tool for validating, converting, and generating schemas for configuration files. Supports JSON, YAML, TOML, and ENV formats with JSON Schema validation, format conversion, TypeScript interface generation, and an interactive schema wizard. + +## Features + +- **Validate** configuration files against JSON Schema with detailed error reporting +- **Convert** between configuration formats (JSON, YAML, TOML, ENV) +- **Generate** TypeScript interfaces from JSON Schema or sample data +- **Interactive Schema Wizard** for creating schemas without writing JSON +- **Multiple Output Formats** - JSON, YAML, table, and colored terminal output +- **Dry Run Mode** - Preview validation errors without failing + +## Installation + +```bash +pip install -e . +``` + +## Quick Start + +```bash +# Validate a configuration file +configforge validate config.json schema.json + +# Convert between formats +configforge convert config.yaml --format toml + +# Generate TypeScript interfaces +configforge generate schema.json --interface-name AppConfig + +# Create a new schema interactively +configforge schema --output schema.json +``` + +## Commands + +### validate + +Validate a configuration file against a JSON Schema: + +```bash +configforge validate config.json schema.json +configforge validate config.yaml schema.json --format table +configforge validate config.toml schema.json --dry-run +``` + +### convert + +Convert a configuration file between formats: + +```bash +configforge convert config.json --format yaml +configforge convert app.yaml --output app.toml +configforge convert config.toml --format env +``` + +### generate + +Generate TypeScript interfaces from JSON Schema or config data: + +```bash +configforge generate schema.json --interface-name AppConfig +configforge generate config.json --from-data --output types.ts +``` + +### schema + +Interactively generate a JSON Schema: + +```bash +configforge schema --output schema.json +configforge schema --format yaml +configforge schema --from-config config.json +``` + +## Supported Formats + +| Format | Extensions | Read | Write | +|--------|------------|------|-------| +| JSON | .json | ✓ | ✓ | +| YAML | .yaml, .yml| ✓ | ✓ | +| TOML | .toml | ✓ | ✓ | +| ENV | .env | ✓ | ✓ | + +## Development + +```bash +pip install -e ".[dev]" +pytest tests/ +ruff check . +mypy configforge/ +``` + +## Contributing + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Run tests +5. Submit a pull request + +## License + +MIT License - see LICENSE file for details.