Skip to content

Getting started with Yamkix

This tutorial walks you through installing yamkix and formatting your first YAML file. At the end, you will know how to run yamkix on a file and read its output.

Step 1: Install yamkix

Yamkix is published on pypi.org. Install it as a standalone tool with uv:

uv tool install yamkix

Check that it works:

yamkix --version

Other installation methods (like mise) are described in the installation how-to guide.

Step 2: Create a YAML file to format

Create a file named example.yml with some inconsistently formatted YAML:

apiVersion: v1
kind: ConfigMap
metadata:
  name:   my-config
data:
  colors: [blue, green]

Step 3: Format it

Run yamkix on the file:

yamkix example.yml

yamkix rewrites the file in place with its opinionated styling rules:

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-config
data:
  colors: [blue, green]

Notice what happened:

  • An explicit document start marker (---) was added.
  • The extra spaces after name: were normalized.
  • Comments (if any) would be preserved, thanks to the default rt (round-trip) parsing mode.

Step 4: Preview without overwriting

If you prefer to review the result before touching the file, send the output to STDOUT:

yamkix --input example.yml --stdout

Where to go next