Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pandastrike/yaml-cli
A simple CLI for querying and updating YAML files
https://github.com/pandastrike/yaml-cli
Last synced: about 1 month ago
JSON representation
A simple CLI for querying and updating YAML files
- Host: GitHub
- URL: https://github.com/pandastrike/yaml-cli
- Owner: pandastrike
- License: isc
- Created: 2016-02-28T02:33:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-11T05:17:23.000Z (almost 4 years ago)
- Last Synced: 2024-10-28T14:27:41.329Z (about 2 months ago)
- Language: Shell
- Size: 33.2 KB
- Stars: 86
- Watchers: 7
- Forks: 5
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-cli-apps - yaml-cli - Query/update YAML. (Data Manipulation / Processors)
- fucking-awesome-cli-apps - yaml-cli - Query/update YAML. (Data Manipulation / Processors)
- jimsghstars - pandastrike/yaml-cli - A simple CLI for querying and updating YAML files (Shell)
README
# yaml-cli
> **Important** This project has been deprecated. We recommend [yq](https://github.com/mikefarah/yq).
A simple CLI for working with YAML files.
## Installation
```bash
$ npm install -g yaml-cli
```## Shell Completion
You can set up shell completion like this:
```bash
$ eval $(yaml env -)
```## Examples
Given the following `test.yml` file:
```yaml
foo:
bar: 7
baz:
- 17
- "hello world"
```### get
You can get properties:
```bash
$ yaml get test.yaml foo.bar
7
```or array accessors:
```bash
$ yaml get test.yaml foo.baz.1
hello world
```### set
You can set values, too.
```bash
$ yaml set test.yaml foo.baz.1 goodbye
foo:
bar: 7
baz:
- 17
- "goodbye"
```### template
You can instantiate template files, too. Given the following template:
```
I would like to say {{foo.baz.1}}
```you can instantiate it like this:
```bash
$ yaml t test.yaml test.template
I would like to say hello world
```### json
You can read and write JSON.
To convert from JSON to YAML:
```tty
$ yaml json read test.json
foo:
bar: 7
baz:
- 17
- "hello world"
```To convert from YAML to JSON:
```tty
$ yaml json write test.yaml
{
"foo": {
"bar": 7,
"baz": [
17,
"hello world"
]
}
}
```You can get more help by just typing `yaml`.
```bash
$ yaml
Usage: yaml []Some useful yaml commands are:
commands List all yaml commands
get Get a value from a YAML file
set Set a value in a YAML file
template Instantiate a template file with a YAML file.See 'yaml help ' for information on a specific command.
```## Limitations
See the [issues list](https://github.com/pandastrike/yaml-cli/issues)—and please open your own or `+1` your favorites.