1.1.8 • Published 9 years ago

yaml-cli v1.1.8

Weekly downloads
3,125
License
ISC
Repository
github
Last release
9 years ago

yaml-cli

A simple CLI for working with YAML files.

Installation

$ npm install -g yaml-cli

Shell Completion

You can set up shell completion like this:

$ eval $(yaml env -)

Examples

Given the following test.yml file:

foo:
  bar: 7
  baz:
    - 17
    - "hello world"

get

You can get properties:

$ yaml get test.yaml foo.bar
7

or array accessors:

$ yaml test.yaml foo.baz.1
hello world

set

You can set values, too.

$ 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:

$ 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:

$ yaml json read test.json
foo:
  bar: 7
  baz:
    - 17
    - "hello world"

To convert from YAML to JSON:

$ yaml json write test.yaml
{
  "foo": {
    "bar": 7,
    "baz": [
      17,
      "hello world"
    ]
  }
}

You can get more help by just typing yaml.

$ yaml
Usage: yaml <command> [<args>]

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 <command>' for information on a specific command.

Limitations

See the issues list—and please open your own or +1 your favorites.

1.1.8

9 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago