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
^starts a section. More carets = nested section (^^ Loggingis insideServer).key = valuedefines a setting.- Arrays (lists):
[1, 2, 3], objects:{ key: value }. - Comments:
//or#(include a space after#for inline comments). - Want more of YINI’s syntax and structure? Read Intro to YINI format.
3) Validate your config (in CLI)
In your terminal (from the same folder as your file), run:
npx yini-cli validate ./config3.yiniYou 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 --help5) 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
- ➡️ Get Started
Installation and CLI usage overview. - ➡️ Specification
Full details on YINI syntax and format.
YINI is simple by design — experiment, break things, and have fun exploring!
