semvec/pypi-packages huggingface dataset:
yaml-doctor 0.1.2
A CLI tool to detect and auto-fix common issues in Home Assistant YAML files.
License: MIT
Requires Python: >=3.9

# YAML-Doctor 🩺📄  
[![PyPI version](https://badge.fury.io/py/yaml-doctor.svg)](https://pypi.org/project/yaml-doctor/)
[![CI](https://github.com/thisguy022/yaml-doctor/actions/workflows/ci.yml/badge.svg)](https://github.com/thisguy022/yaml-doctor/actions/workflows/ci.yml)

Validate – and automatically **fix duplicate keys** – in Home-Assistant-style YAML files.  
No more mysterious “duplicated mapping key” errors breaking your automations!

---

## ✨ Features
- **Fast validation** of any YAML file (Home Assistant, ESPHome, CI pipelines, etc.)
- **Smart auto-fix** `--fix` flag renames duplicate keys in-place (optionally backs up originals)
- **Colorful Rich output** for quick at-a-glance feedback
- **Zero-config CLI** – just run `yaml-doctor your_file.yaml`
- Works on **Windows, macOS, and Linux** (Python ≥ 3.9)

---

## 📦 Installation

### User install (from PyPI – easiest)

```bash
pip install yaml-doctor

🚀 Usage
Goal	Command
Validate only	yaml-doctor ENTER YOUR FILE.yaml
Validate & auto-fix duplicates	yaml-doctor path/to/file.yaml --fix
Show full CLI help	yaml-doctor --help


## EXAMPLE
yaml-doctor secrets.yaml --fix
# 🔍 Running validation before fix…
# ❌ Duplicate key “sensor” found at line 12 – renaming to sensor_1
# 🎉 File fixed successfully.

📄 License
MIT © Jason Clark – use it, ship it, enjoy fewer YAML headaches!