{"id":18017,"library":"yaml-cli","title":"YAML Command Line Interface (CLI)","description":"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.","status":"deprecated","version":"1.1.8","language":"javascript","source_language":"en","source_url":"https://github.com/pandastrike/yaml-cli","tags":["javascript","yaml","cli"],"install":[{"cmd":"npm install yaml-cli","lang":"bash","label":"npm"},{"cmd":"yarn add yaml-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add yaml-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[],"quickstart":{"code":"# Install the CLI globally\nnpm install -g yaml-cli\n\n# Create a sample YAML file\ncat << EOF > mydata.yaml\nuser:\n  name: Alice\n  settings:\n    theme: dark\n    notifications: true\nitems:\n  - id: 1\n    name: Item A\n  - id: 2\n    name: Item B\nEOF\n\necho \"Original YAML:\"\ncat mydata.yaml\necho \"\\n\"\n\n# Get a value\necho \"Getting user name:\"\nyaml get mydata.yaml user.name\necho \"\\n\"\n\n# Set a value\necho \"Setting user theme to light:\"\nyaml set mydata.yaml user.settings.theme light\necho \"\\n\"\n\necho \"Updated YAML:\"\ncat mydata.yaml\necho \"\\n\"\n\n# Convert to JSON\necho \"Converting to JSON:\"\nyaml json write mydata.yaml","lang":"bash","description":"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."},"warnings":[{"fix":"Migrate to `yq` which provides similar and enhanced capabilities. Update scripts and workflows to use `yq` commands instead of `yaml-cli`.","message":"This `yaml-cli` project (pandastrike/yaml-cli) has been officially deprecated by its maintainers. It is no longer under active development and new features or bug fixes should not be expected. Users are strongly encouraged to migrate to `yq` (https://github.com/mikefarah/yq) for robust and actively maintained YAML processing functionality.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"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.","message":"YAML files are highly sensitive to indentation. Using tabs instead of spaces, or inconsistent spacing, will lead to parsing errors and unexpected behavior, often resulting in obscure error messages or malformed output.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Enclose any ambiguous values in single or double quotes (e.g., `value: '7'`, `status: 'no'`, `country: 'NO'`) to force string interpretation.","message":"Values in YAML files can be interpreted differently based on their content (e.g., 'true' might be a boolean, '7' an integer). Strings containing special characters or what might look like boolean/numeric values (e.g., 'no', 'on', '0.1') should be explicitly quoted to ensure they are parsed as strings.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"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.","cause":"The `yaml-cli` package was not installed globally or its executable is not in the system's PATH.","error":"yaml: command not found"},{"fix":"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.","cause":"This error typically indicates an indentation problem or a missing quote around a string value that contains special characters or is being misinterpreted by the YAML parser.","error":"(<unknown>): mapping values are not allowed in this context at line X column Y"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}