yo

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

GitHub Actions Status codebeat badge

InstallationUsageBuild StatusContributingLicense


Yo is a command-line YAML processor.

Installation

From source

To build the Yo from scratch, make sure you have a working Go 1.19+ workspace (instructions), then:

go install github.com/essentialkaos/yo@latest

From ESSENTIAL KAOS Public Repository

sudo yum install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm
sudo yum install yo

Prebuilt binaries

You can download prebuilt binaries for Linux and macOS from EK Apps Repository:

bash <(curl -fsSL https://apps.kaos.st/get) yo

Usage

Usage: yo {options} query

Options

  --from-file, -f filename    Read data from file
  --no-color, -nc             Disable colors in output
  --help, -h                  Show this help message
  --version, -v               Show version

Examples

  cat file.yml | yo '.foo'
  Return value for key foo

  yo -f file.yml '.foo'
  Return value for key foo

  yo -f file.yml '.foo | length'
  Print value length

  yo -f file.yml '.foo[]'
  Return all items from array

  yo -f file.yml '.bar[2:]'
  Return subarray started from item with index 2

  yo -f file.yml '.bar[1,2,5]'
  Return items with index 1, 2 and 5 from array

  yo -f file.yml '.bar[] | length'
  Print array size

  yo -f file.yml '.xyz | keys'
  Print hash map keys

  yo -f file.yml '.xyz | keys | length'
  Print number of hash map keys

  yo -f file.yml '.xyz | keys | sort'
  Print sorted list of keys

Build Status

Branch Status
master CI
develop CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

License

Apache License, Version 2.0

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL