yaml-cli is a command-line interface tool designed for directly interacting with YAML files, providing functionalities such as querying values, setting properties, instantiating templates, and converting between YAML and JSON formats. Currently at version 1.1.8, this project has been officially deprecated. While it offers a simple and direct approach to YAML manipulation via shell commands, its developers now recommend using `yq` as a more actively maintained and feature-rich alternative. Key differentiators of yaml-cli include its intuitive dot-notation for nested property access and array indexing, and its built-in templating engine. Users should be aware of its deprecated status and consider migrating to `yq` for new projects or ongoing maintenance to ensure continued support and access to new features.
npm install yaml-cliNo compatibility data collected yet for this library.
This quickstart demonstrates how to globally install `yaml-cli`, create a sample YAML file, then use `yaml-cli` to `get` a specific value, `set` a new value, and finally `json write` the updated YAML content to standard output in JSON format.
Migrate to `yq` which provides similar and enhanced capabilities. Update scripts and workflows to use `yq` commands instead of `yaml-cli`.
Always use spaces for indentation, maintaining a consistent number of spaces (e.g., 2 or 4) throughout the file. Utilize a YAML-aware text editor or linter to catch indentation issues early. The `yamllint` tool (available via `npm install -g yamllint`) can help validate syntax.
Enclose any ambiguous values in single or double quotes (e.g., `value: '7'`, `status: 'no'`, `country: 'NO'`) to force string interpretation.
Install the package globally using `npm install -g yaml-cli` or ensure that the `npm` global bin directory is included in your system's PATH environment variable.
Review the YAML file at the specified line and column. Correct any inconsistent indentation (use spaces, not tabs). If a string contains special characters (like `:` or spaces in a key, or `yes`/`no`/`true`/`false` values that should be strings), enclose it in single or double quotes.
No dependency data recorded yet.