Skip to content

rossmacarthur/aq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aq

Crates.io Version Build Status

Extend jq for any data format. Currently supports JSON, TOML, and YAML.

📦 Installation

Homebrew

aq can be installed from my personal tap which includes pre-built binaries.

brew install rossmacarthur/tap/aq

Cargo

aq can be installed from Crates.io using Cargo, the Rust package manager.

cargo install aq-cli

In some circumstances this can fail due to the fact that Cargo does not use Cargo.lock file by default. You can force Cargo to use it using the --locked option.

cargo install aq-cli --locked

Pre-built binaries

Pre-built binaries for macOS (aarch64) are provided. These can be downloaded directly from the the releases page.

Alternatively, the following script can be used to automatically detect your host system, download the required artifact, and extract the aq binary to the given directory.

curl --proto '=https' -fLsS https://rossmacarthur.github.io/install/crate.sh \
    | bash -s -- --repo rossmacarthur/aq --to ~/.local/bin

🤸 Usage

By default aq behaves just like jq and operates on JSON.

$ echo '{"foo":{"bar": 1337}}' | aq .foo
{
  "bar": 1337
}

But it also accepts options to specify the input and output format. For example with a TOML input and a JSON output:

$ echo '[foo]\nbar = 1337' | aq -i toml -o json .foo
{
  "bar": 1337
}

If not provided, the output format defaults to the input format. Additionally, you can use j for JSON, t for TOML, and y for YAML for maximum brevity.

$ echo '[foo]\nbar = 1337' | aq -it .foo
bar = 1337

License

This project is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

About

Extend jq for any data format

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages