yini-cli 1.1.0-beta β 1.1.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -111
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,63 +1,130 @@
|
|
|
1
1
|
# YINI-CLI
|
|
2
|
-
**Command-line tool for
|
|
2
|
+
**Command-line tool for validating, inspecting, and converting YINI configuration files to JSON.**
|
|
3
3
|
|
|
4
|
-
*YINI
|
|
4
|
+
*YINI is an INI-inspired configuration format designed for clarity and predictability. It supports nesting, comments, and a formally defined syntax, so configuration files stay easy to read and reason about as they grow.*
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.com/package/yini-cli) [](https://github.com/YINI-lang/yini-cli/actions/workflows/run-all-tests.yml) [](https://github.com/YINI-lang/yini-cli/actions/workflows/run-regression-tests.yml) [](https://github.com/YINI-lang/yini-cli/actions/workflows/run-cli-test.yml)
|
|
7
7
|
|
|
8
|
+
This tool is useful if you work with human-edited configuration files and want predictable structure without indentation-based rules.
|
|
9
|
+
|
|
8
10
|
---
|
|
9
11
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
### Requirements
|
|
15
|
+
YINI CLI requires Node.js **v20 or later**.
|
|
16
|
+
|
|
17
|
+
(It has also been tested with Node.js v13+, but v20+ is recommended for best compatibility.)
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
|
|
21
|
+
1. **Install it globally from npm β (requires Node.js)**
|
|
22
|
+
Open your terminal and run:
|
|
23
|
+
```
|
|
24
|
+
npm install -g yini-cli
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
2. **Verify installation**
|
|
28
|
+
Run this in your terminal:
|
|
29
|
+
```bash
|
|
30
|
+
yini --version
|
|
31
|
+
```
|
|
32
|
+
Should print the version (e.g., 1.0.0).
|
|
17
33
|
|
|
18
|
-
|
|
34
|
+
Then you may try:
|
|
35
|
+
```bash
|
|
36
|
+
yini --help
|
|
37
|
+
```
|
|
38
|
+
Should show you the CLI help for YINI.
|
|
39
|
+
|
|
40
|
+
3. **Test functionality**
|
|
41
|
+
Create a simple test file, for example: `config.yini`:
|
|
42
|
+
```yini
|
|
43
|
+
^ App
|
|
44
|
+
name = "My App Title"
|
|
45
|
+
version = "1.2.3"
|
|
46
|
+
pageSize = 25
|
|
47
|
+
darkTheme = off
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then run:
|
|
51
|
+
```bash
|
|
52
|
+
yini parse config.yini
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Expected result, your CLI should output a parsed version of the config and output something similar to:
|
|
56
|
+
```js
|
|
57
|
+
{
|
|
58
|
+
App: {
|
|
59
|
+
name: 'My App Title',
|
|
60
|
+
version: '1.2.3',
|
|
61
|
+
pageSize: 25,
|
|
62
|
+
darkTheme: false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
β If this was useful, [star it on GitHub](https://github.com/YINI-lang/yini-cli) β it helps a lot, thank you!
|
|
19
68
|
|
|
20
69
|
---
|
|
21
70
|
|
|
22
|
-
|
|
23
|
-
YINI CLI requires Node.js **v20 or later**.
|
|
71
|
+
### Typical use cases
|
|
24
72
|
|
|
25
|
-
|
|
73
|
+
- Validating configuration files during development or CI.
|
|
74
|
+
- Inspecting and debugging structured configuration.
|
|
75
|
+
- Converting YINI files to JSON for tooling and automation.
|
|
26
76
|
|
|
27
77
|
---
|
|
28
78
|
|
|
29
|
-
##
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
-
|
|
33
|
-
- **
|
|
34
|
-
-
|
|
35
|
-
- π See [how YINI differs from JSON, YAML, INI, and TOML](https://github.com/YINI-lang/yini-parser-typescript/tree/main/examples/compare-formats.md).
|
|
36
|
-
- Want the full syntax reference? See the [YINI Specification](https://github.com/YINI-lang/YINI-spec).
|
|
79
|
+
## πββοΈ Why YINI?
|
|
80
|
+
- **Indentation-independent structure:** The YINI config format is indentation-independent, meaning any space or tab never changes meaning.
|
|
81
|
+
- **Explicit nesting:** It uses clear header markers (`^`, `^^`, `^^^`) to define hierarchy (like in Markdown), without long dotted keys.
|
|
82
|
+
- **Multiple data types:** Supports boolean literals (`true` / `false`, `Yes` / `No`, etc), numbers, arrays (lists), and JS-style objects natively, with explicit string syntax.
|
|
83
|
+
- **Comments support:** YINI supports multiple comment styles (`#`, `//`, `/* ... */`, and `;`) allowing one to document config directly in the file.
|
|
84
|
+
- **Predictable parsing rules:** Well-defined rules with optional strict and lenient modes, for different use-requirements.
|
|
37
85
|
|
|
38
86
|
---
|
|
39
87
|
|
|
40
|
-
##
|
|
88
|
+
## Usage of command `yini`
|
|
41
89
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// This is a comment in YINI
|
|
45
|
-
// YINI is a simple, human-readable configuration file format.
|
|
90
|
+
```bash
|
|
91
|
+
Usage: yini [options] [command]
|
|
46
92
|
|
|
47
|
-
|
|
48
|
-
// for readability.
|
|
93
|
+
CLI for parsing and validating YINI config files.
|
|
49
94
|
|
|
50
|
-
|
|
95
|
+
Options:
|
|
96
|
+
-v, --version Output the version number.
|
|
97
|
+
-i, --info Show extended information (details, links, etc.).
|
|
98
|
+
-s, --strict Enable strict parsing mode.
|
|
99
|
+
-f, --force Continue parsing even if errors occur.
|
|
100
|
+
-q, --quiet Reduce output (show only errors).
|
|
101
|
+
--silent Suppress all output (even errors, exit code only).
|
|
102
|
+
-h, --help Display help for command.
|
|
51
103
|
|
|
52
|
-
|
|
53
|
-
|
|
104
|
+
Commands:
|
|
105
|
+
parse [options] <file> Parse a YINI file (*.yini) and print the result.
|
|
106
|
+
validate [options] <file> Checks if the file can be parsed as valid YINI.
|
|
107
|
+
info Deprecated: Use `yini --info` or `yini -i` instead.
|
|
108
|
+
help [command] Display help for command.
|
|
54
109
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
110
|
+
Examples:
|
|
111
|
+
$ yini parse config.yini
|
|
112
|
+
$ yini validate --strict config.yini
|
|
113
|
+
$ yini parse config.yini --pretty --output out.json
|
|
114
|
+
|
|
115
|
+
For help with a specific command, use -h or --help. For example:
|
|
116
|
+
$ yini validate --help
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Quick Look at YINI
|
|
122
|
+
|
|
123
|
+
Here's a small example showing YINI structure and comments:
|
|
124
|
+
```yini
|
|
125
|
+
// This is a comment in YINI
|
|
59
126
|
|
|
60
|
-
^ App //
|
|
127
|
+
^ App // Defines section (group) "App"
|
|
61
128
|
name = 'My Title' // Keys and values are written as key = value
|
|
62
129
|
items = 25
|
|
63
130
|
darkMode = true // "ON" and "YES" works too
|
|
@@ -66,6 +133,8 @@ YINI code looks like this:
|
|
|
66
133
|
^^ Special
|
|
67
134
|
primaryColor = #336699 // Hex number format
|
|
68
135
|
isCaching = false // "OFF" and "NO" works too
|
|
136
|
+
|
|
137
|
+
# This is a comment too.
|
|
69
138
|
```
|
|
70
139
|
|
|
71
140
|
**The above YINI converted to a JS object:**
|
|
@@ -105,65 +174,6 @@ That's it!
|
|
|
105
174
|
|
|
106
175
|
---
|
|
107
176
|
|
|
108
|
-
## Bigger Intro into YINI Config Format
|
|
109
|
-
**YINI** is a simple and readable configuration format. Sections are defined with `^ SectionName`, and values are assigned using `key = value`. The format supports common data types (same as those found in JSON), including strings, numbers, booleans, nulls, and lists.
|
|
110
|
-
|
|
111
|
-
To learn more, see the [Getting Started: Intro to YINI Config Format](https://github.com/YINI-lang/YINI-spec/blob/develop/Docs/Intro-to-YINI-Config-Format.md) tutorial.
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
## Usage
|
|
116
|
-
|
|
117
|
-
### Installation
|
|
118
|
-
|
|
119
|
-
1. **Install it globally from npm β (requires Node.js)**
|
|
120
|
-
Open your terminal and run:
|
|
121
|
-
```
|
|
122
|
-
npm install -g yini-cli
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
2. **Verify installation**
|
|
126
|
-
Run this in your terminal:
|
|
127
|
-
```bash
|
|
128
|
-
yini --version
|
|
129
|
-
```
|
|
130
|
-
Should print the version (e.g., 1.0.0).
|
|
131
|
-
|
|
132
|
-
Then you may try:
|
|
133
|
-
```bash
|
|
134
|
-
yini --help
|
|
135
|
-
```
|
|
136
|
-
Should show you the CLI help for YINI.
|
|
137
|
-
|
|
138
|
-
3. **Test functionality**
|
|
139
|
-
Create a simple test file, for example: `config.yini`:
|
|
140
|
-
```yini
|
|
141
|
-
^ App
|
|
142
|
-
name = "My App Title"
|
|
143
|
-
version = "1.2.3"
|
|
144
|
-
pageSize = 25
|
|
145
|
-
darkTheme = off
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Then run:
|
|
149
|
-
```bash
|
|
150
|
-
yini parse config.yini
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Expected result, your CLI should output a parsed version of the config and output something similar to:
|
|
154
|
-
```js
|
|
155
|
-
{
|
|
156
|
-
App: {
|
|
157
|
-
name: 'My App Title',
|
|
158
|
-
version: '1.2.3',
|
|
159
|
-
pageSize: 25,
|
|
160
|
-
darkTheme: false
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
177
|
## π€ Output Modes for `yini parse`
|
|
168
178
|
|
|
169
179
|
The `parse` command supports multiple output styles:
|
|
@@ -180,27 +190,29 @@ The `parse` command supports multiple output styles:
|
|
|
180
190
|
|
|
181
191
|
---
|
|
182
192
|
|
|
183
|
-
##
|
|
184
|
-
|
|
185
|
-
|
|
193
|
+
## π Roadmap
|
|
194
|
+
Areas of planned and possible future expansion:
|
|
195
|
+
|
|
196
|
+
1. **Improve existing commands** β Continued functionality improvements, better diagnostics, and expanded QA for `parse` and `validate` and their options.
|
|
197
|
+
2. Command `format`: Pretty-print or normalize a `.yini` file.
|
|
198
|
+
3. Command `lint`: Stricter stylistic checks (like `validate`, but opinionated).
|
|
199
|
+
4. Command `diff`: Compare two YINI files and show structural/config differences.
|
|
200
|
+
5. Command `convert`: Convert a `JSON` or `XML` file into YINI format.
|
|
201
|
+
|
|
202
|
+
---
|
|
186
203
|
|
|
204
|
+
## Links
|
|
187
205
|
- β‘οΈ [YINI Parser on npm](https://www.npmjs.com/package/yini-parser)
|
|
188
206
|
*Install and view package details.*
|
|
189
207
|
|
|
190
|
-
- β‘οΈ [
|
|
191
|
-
*
|
|
192
|
-
|
|
193
|
-
- β‘οΈ [YINI Parser on GitHub](https://github.com/YINI-lang/yini-parser-typescript)
|
|
194
|
-
*TypeScript source code, issue tracker, and contributing guide.*
|
|
208
|
+
- β‘οΈ [YINI Project](https://github.com/YINI-lang)
|
|
209
|
+
*YINI home on gitHub.*
|
|
195
210
|
|
|
196
|
-
|
|
197
|
-
*How does YINI differ: comparison with INI, YAML, and JSON.*
|
|
198
|
-
|
|
199
|
-
- β‘οΈ [Why YINI? (Project Rationale)](https://github.com/YINI-lang/YINI-spec/blob/release/RATIONALE.md)
|
|
200
|
-
*Learn about the motivations and design decisions behind YINI.*
|
|
211
|
+
---
|
|
201
212
|
|
|
202
|
-
|
|
203
|
-
|
|
213
|
+
## Contribution & Involvement
|
|
214
|
+
Interested in contributing or trying ideas?
|
|
215
|
+
Issues, feedback, and experiments are welcome β even small ones.
|
|
204
216
|
|
|
205
217
|
---
|
|
206
218
|
|
|
@@ -211,4 +223,9 @@ In this project on GitHub, the `libs` directory contains third party software an
|
|
|
211
223
|
|
|
212
224
|
---
|
|
213
225
|
|
|
214
|
-
|
|
226
|
+
If you found this useful, a GitHub star helps the project a lot β
|
|
227
|
+
|
|
228
|
+
**^YINI β‘**
|
|
229
|
+
> YINI β Clear, Structured Configuration Files.
|
|
230
|
+
|
|
231
|
+
[yini-lang.org](https://yini-lang.org) Β· [YINI on GitHub](https://github.com/YINI-lang)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yini-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1-beta",
|
|
4
4
|
"description": "CLI for parsing and validating YINI config files: type-safe values, nested sections, comments, minimal syntax noise, and optional strict mode.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yini",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"bin": {
|
|
30
30
|
"yini": "./dist/index.js"
|
|
31
31
|
},
|
|
32
|
-
"homepage": "https://
|
|
32
|
+
"homepage": "https://yini-lang.org/",
|
|
33
33
|
"license": "Apache-2.0",
|
|
34
34
|
"files": [
|
|
35
35
|
"dist/",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"test:debug": "cross-env isDebug=1 vitest run --reporter=verbose",
|
|
58
58
|
"test:general:debug": "cross-env isDebug=1 npm run test:general",
|
|
59
59
|
"test:watch": "vitest --watch",
|
|
60
|
+
"test:cov": "nyc npm test",
|
|
60
61
|
"ci:test": "vitest run --reporter=verbose",
|
|
61
62
|
"ci:test:smoke": "vitest run tests/smoke --reporter=verbose",
|
|
62
63
|
"lint": "eslint src --ext .ts",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"author": "Marko K. SeppΓ€nen",
|
|
71
72
|
"dependencies": {
|
|
72
73
|
"commander": "^14.0.1",
|
|
73
|
-
"yini-parser": "^1.3.
|
|
74
|
+
"yini-parser": "^1.3.2-beta"
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
76
77
|
"@eslint/js": "^9.31.0",
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
"execa": "^9.6.0",
|
|
86
87
|
"husky": "^9.1.7",
|
|
87
88
|
"lint-staged": "^16.0.0",
|
|
89
|
+
"nyc": "^17.1.0",
|
|
88
90
|
"prettier": "^3.5.3",
|
|
89
91
|
"tsx": "^4.7.0",
|
|
90
92
|
"typescript": "^5.8.3",
|