yamlfmt is an extensible formatter that makes YAML files consistent and easy to read across large repositories. It focuses on practical concerns unique to YAML—multi-document streams, anchors and aliases, comments, and block scalars—so a reformat doesn’t destroy semantics or helpful annotations. The tool ships as a single, distributable binary and can also be used as a library, making it simple to drop into CI and editor workflows. Configuration is file-based, allowing teams to pin indentation, line wrapping, and other house-style choices repo-wide. By normalizing structure while preserving meaning, it reduces diff noise and merge friction in configs, Kubernetes manifests, and automation playbooks. The project is intentionally extensible, so organizations can add custom formatters or rules without forking.

Features

  • Opinionated yet configurable formatting of YAML files
  • Safe handling of comments, anchors, aliases, and block scalars
  • Multi-document stream support for real-world manifests
  • Single static binary and library API for flexible integration
  • Repo-scoped config to enforce consistent house style
  • CI-friendly exit codes for check and fix workflows

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow yamlfmt

yamlfmt Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of yamlfmt!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Command Line Tools

Registered

2025-10-10