Get Started with YINI
Welcome! This guide helps you create your first working .yini file in
under 2 minutes using the terminal.
YINI is a human-friendly configuration file format. It is inspired by INI, but adds nested sections, arrays, objects, and comments.
If you want to try YINI without installing anything, use the YINI Playground. This page focuses on the YINI CLI, which is the simplest starting point for local files and automation.
Prerequisite: Node.js
You need Node.js to run the YINI command-line (CLI) tool.
You can check if Node.js is already installed by running:
node -vIf Node.js is not installed, download it from: https://nodejs.org ↗
It’s recommended to use Node.js 20 or later.
1) Install yini-cli (or just use npx)
Option A - use without installing
npx yini-cli --helpOption B - install yini as a command
npm i -g yini-cliOption C - add the CLI to your Node.js project
npm i -D yini-cliBy default, yini parse prints formatted (easy-to-read) JSON to the terminal.
If you want a fuller introduction, examples, and common commands, see the YINI CLI page.
2) Create your first .yini file
Save this as config.yini:
^ App
name = "Demo"
version = "1.0.0"
features = [ "search", "dark-mode" ] // Comments are allowed
^ Database
host = "localhost"
port = 5432
auth = { user: "admin", pass: "secret" } // Object literalNotes:
- Sections: start with
^. Add more carets for nested sections (sub-sections): (^,^^,^^^, …). - Settings: written as
key = valuepairs. - Comments: Use
//or#for comments on the same line. You do not need a space after#. - Arrays:
[1, 2, 'three'] - Objects:
{ key: 'value', n: 1 } - Strings: must be quoted
'like this'or"like this". - For more details, see: Learn the YINI format.
Coming from INI? YINI keeps the same familiar key-value style, but adds nested sections, lists, and objects.
3) Parse your .yini file
Once your file is saved, parse it with the CLI.
If you used option A with npx in step 1:
npx yini-cli parse config.yiniOr, if you used option B or C (using npm) in step 1:
yini parse config.yiniBy default, parse outputs formatted (easy-to-read) JSON:
{
"App": {
"name": "Demo",
"version": "1.0.0",
"features": ["search", "dark-mode"]
},
"Database": {
"host": "localhost",
"port": 5432,
"auth": { "user": "admin", "pass": "secret" }
}
}Now you have a working YINI file
You have now created a .yini file and parsed it to JSON.
The basic steps are:
- Create a
.yinifile with sections and settings. - Run
yini parseornpx yini-cli parse. - Use the JSON output in tools, scripts, or applications.
💡 Common tips:
- Keys and section names are case-sensitive:
Appandappare different names. - Strings must always be quoted, either
'or".
More CLI options
Once the basic parse works, you can change the output style or write the result to a file.
Compact JSON
To output minified JSON with no extra spaces or line breaks:
yini parse config.yini --compactJavaScript-style output
To output a JavaScript-style object instead of JSON, use the --js flag.
yini parse config.yini --jsExplicit JSON output
Formatted (easy-to-read) JSON is the default, but you can also request it with a flag:
yini parse config.yini --jsonWrite output to a file
To save the result:
yini parse config.yini -o output.jsonBy default, YINI CLI does not replace a newer output file by mistake. For the full list of output and file-writing options, see the YINI CLI page.
Use YINI in other ways
You can use YINI after this first CLI flow:
- Try examples in the YINI Playground without installing anything.
- Load
.yinifiles in Node.js with the YINI Parser. - Try the beta Python parser.
- Use YINI for configuration, data files, tooling, and CI workflows.
You can explore more tools on the Get YINI Tools page.
Summary
You have just created and parsed your first YINI configuration file.
Next steps
-
➡️ Quick Tutorial
Walk through the core YINI ideas in a few minutes.
-
➡️ YINI Examples
Study practical YINI files from small to larger configs.
-
➡️ YINI CLI
Learn the command-line options after the first parse.
