The official command-line tool for reading, validating, and converting YINI configuration files. YINI supports nested sections, strings, numbers, booleans, lists, and comments.
Useful links:
Requires Node.js 22 or later. Install the CLI:
npm install -g yini-cli
yini --versionSave this as config.yini:
^ App
name = "My App"
enabled = true
ports = [8080, 8081]
Then try the three main commands:
yini get config.yini App.name
yini validate config.yini
yini parse config.yiniget prints My App without quotes. validate reports whether the file is valid. parse prints the complete document as formatted JSON. Parsing is lenient by default. Strict mode (--strict) requires exactly one top-level section and an /END line at the end of the file, along with other syntax checks.
Editor support: For syntax highlighting in .yini files, install the
YINI Syntax Highlighting extension for VS Code.
For Notepad++ or an editor that supports TextMate grammars, see the
manual installation instructions.
| Command | What it does |
|---|---|
yini get config.yini App.name |
Read one value. Omit the path to print the complete document as JSON. peek is an alias. |
yini validate config.yini |
Check a file or directory. Includes subdirectories by default. check is an alias. |
yini parse config.yini |
Convert a file to formatted JSON by default. |
yini info |
Show CLI and parser information. |
yini get config.yini App.name --format jsonprints"My App"with JSON quotes. Other choices aretextandjson-compact.yini parse config.yini --compactprints JSON without extra spaces or line breaks. Other formats use--js,--yaml, or--xml;-o out.jsonwrites to a file.yini validate config.yini --strict --format json --warnings-as-errorsprints a JSON report and treats warnings as failures.--quiethides optional messages while keeping command results and errors visible.--silentsuppresses command output. Runyini help <command>for help with a specific command.
See the get command reference for paths, stdin, and output details, and the validate command reference for directory and reporting options.
When parse writes to a file, it skips an output file newer than the input file by default and avoids rewriting unchanged output. Use --overwrite to replace an existing output file even if it is newer, or --no-overwrite to fail if the output file exists.
This version uses yini-parser 2.0. Large integers, such as 9007199254740993, are stored as JavaScript bigint values to keep them exact. JSON output currently fails if the selected value or document contains one of these integers. Use yini get config.yini App.value to print one such integer as text, or yini parse config.yini --js to print the document as JavaScript.
From this repository's root directory:
npm ci
npm run build
npm test
npm run start:dev -- --helpSee project setup, contributing, and the changelog for more details.
YINI uses section markers such as ^ and ^^ for explicit nesting. It supports strings, numbers, booleans, lists, inline objects, and comments. Indentation does not define structure. See the basic sample, larger sample, or their basic and larger previews.
The YINI specification has the full syntax rules. This CLI uses yini-parser; the demo apps show complete examples.
Report problems in GitHub Issues or use Discussions. For parser issues, include the YINI input, command, expected result, and actual result.
This project is licensed under the Apache License 2.0; see LICENSE.
^YINI ≡
YINI is a human-readable configuration format designed for clarity, readability, explicit structure, predictability, and deterministic parsing.
See the specification for syntax and format details.