Quick Tutorial: YINI Basics

YINI makes configs readable for humans and consistent for machines — like INI, but with real structure, arrays, objects, and comments.

A quick tutorial with the basics of the YINI format and how to validate it.

1) What is YINI (in one line)?

A human-friendly config format (like INI) with real structure: sections, clear nested sections, arrays, objects, and unambiguous, predictable rules.


2) Create your first file

Make a file named config3.yini and paste:

^ App
name = "Demo"
version = "1.0.0"
features = ["search", "dark-mode"]  // comments are allowed

^ Server
host = "0.0.0.0"
port = 8080

^^ Logging
enabled = false

💡 What’s happening


3) Validate your config (in CLI)

In your terminal (from the same folder as your file), run:

npx yini-cli validate ./config3.yini

You should see something like:

 Validation passed 0 errors, 0 warnings.

If YINI reports 0 errors, 0 warnings, everything’s fine. A non-zero exit code means something went wrong.

More commands and options

To explore more commands and options, run:

npx yini-cli --help

5) npm script

Use this in CI to catch config mistakes early:

{
  "scripts": {
    "config:check": "npx yini-cli validate ./config3.yini"
  }
}

Run with:

npm run config:check

⚠️ Common Questions

Does indentation matter?

No — indentation is only for readability.
Structure is determined by section markers (^, ^^, etc.), not spaces.

Can I mix comment styles?

Yes — YINI supports both // and # for inline comments.
For consistency, use just one style per file.


✅ You just wrote and validated your first YINI config!

That’s the basics.

Next Steps

YINI is simple by design — experiment, break things, and have fun exploring!