Skip to main content

Introduction

cfv is a toolchain for configuration files. It catches syntax errors, schema violations, and formatting problems across your repo and fixes what it can. Single static binary. No runtime dependencies.

cfv check .

Validates syntax, enforces schemas, and checks formatting in one pass. Fix everything automatically:

cfv check --fix .

Preview formatting changes as a diff:

cfv format --diff .

cfv check is the single CI gate. If any file has a syntax error, a schema violation, or inconsistent formatting, it exits 1.

Supported formats​

FormatValidateFormatSchema
JSON✓✓✓
JSONC✓✓✓
YAML✓✓✓
TOML✓✓✓
XML✓✓✓
HCL✓✓
INI✓✓
Properties✓✓
ENV✓✓
HOCON✓
CSV✓
EDITORCONFIG✓
Justfile✓
KDL✓
CUE✓
PList✓
TOON✓✓
SARIF✓✓

What it replaces​

cfv covers what previously required separate tools:

  • prettier / yamlfmt — YAML and JSON formatting
  • taplo — TOML formatting
  • terraform fmt — HCL formatting
  • xmllint — XML validation and formatting
  • jsonlint — JSON validation
  • v8r — schema validation via SchemaStore

For projects that already use prettier, taplo, or yamlfmt, cfv reads those config files so formatting output matches. See Using cfv with Existing Tools.

When to use it​

  • CI pipelines — cfv check as a single gate catches syntax, schema, and formatting issues. Use JSON, JUnit, SARIF, or GitHub output for machine-readable results.
  • Pre-commit hooks — cfv check --fix validates and formats changed config files before every commit.
  • Monorepos — one tool handles all config formats in a single pass. No per-format tooling to install.
  • Schema enforcement — catch wrong field names, invalid values, and missing required keys via JSON Schema, XSD, or automatic SchemaStore lookup.

Next steps​