Extract, filter, and transform anything

One tool to replace jq, yq, grep, awk, and cut. Pipes, filters, mutations, output conversion, and JSONL streaming.

cargo install pick-cli
macOS, Linux, Windows · MIT License · all install methods
Terminal
# Extract from JSON $ curl -s api.github.com/users/octocat | pick login octocat # Pipe through filters $ cat data.json | pick 'users | select(age > 21) | name' Alice Charlie # Array slicing $ cat items.json | pick 'items[0:3] | name' first second third # Mutate and convert output format $ cat config.json | pick 'set(env, "prod")' -o yaml env: prod port: 8080 # Stream JSONL logs $ cat events.jsonl | pick --stream 'select(level == "error") | message' connection timeout disk full # Recursive descent $ cat package.json | pick '..name' my-app lodash express

8 formats, zero config

JSON

Objects, arrays, nested structures

YAML

Config files, Kubernetes manifests

TOML

Cargo.toml, pyproject.toml

.env

Environment variable files

HTTP Headers

curl -I output, response headers

logfmt

Structured log lines

CSV / TSV

Tabular data with headers

Plain text

Key-value fallback and substring search

Selector syntax

fooTop-level key
foo.barNested key
foo[0]Array index
foo[-1]Last element
foo[1:3]Array slice (elements 1, 2)
foo[:2]First two elements
foo[-2:]Last two elements
foo[*].namePluck field from all elements
..keyRecursive descent — find key anywhere
name, ageMultiple selectors (union)
[0]Index into root array
"dotted.key".subQuoted key for dots in names

Pipes & Filters

Chain operations with the pipe operator. Filter arrays with select() using comparison operators, regex, and boolean logic.

# Chain operations with pipes $ echo '{"users":[{"name":"Alice","age":30},{"name":"Bob","age":17}]}' \ | pick 'users | select(age >= 18) | name' Alice # Regex matching $ echo '{"items":[{"id":"abc-123"},{"id":"def-456"},{"id":"abc-789"}]}' \ | pick 'items | select(id ~ "^abc") | id' abc-123 abc-789 # Boolean logic $ echo '{"users":[{"name":"Alice","active":true,"role":"admin"}]}' \ | pick 'users | select(active == true and role == "admin") | name' Alice

Filter operators

==, !=Equality / inequality
>, <, >=, <=Numeric comparisons
~Regex match
and, or, notBoolean combinators

Builtins

Built-in functions for introspection and aggregation, usable anywhere in a pipeline.

keys()Object keys as array
values()Object values as array
length()Length of array, object, or string
$ echo '{"a":1,"b":2,"c":3}' | pick 'keys()' a b c $ echo '{"a":1,"b":2,"c":3}' | pick 'keys() | length()' 3

Mutation

Immutable tree operations — set() adds or replaces keys, del() removes them. Both return the full modified document.

# Set a value $ echo '{"name":"Alice"}' | pick 'set(role, "admin")' --json {"name":"Alice","role":"admin"} # Delete a key $ echo '{"name":"Alice","tmp":true}' | pick 'del(tmp)' --json {"name":"Alice"} # Chain mutations in a pipeline $ echo '{"a":1}' | pick 'set(b, 2) | del(a)' --json {"b":2}

Output formats

Convert between formats on the fly with -o / --output. Input format is auto-detected; output format is your choice.

# JSON to YAML $ echo '{"name":"Alice","age":30}' | pick -o yaml age: 30 name: Alice # YAML to TOML $ cat config.yaml | pick server -o toml host = "localhost" port = 8080 # Any format to JSON $ cat .env | pick -o json {"DATABASE_URL":"postgres://...","PORT":"3000"}

JSONL streaming

Process newline-delimited JSON line by line with --stream. Each line is parsed and queried independently — perfect for log files and event streams.

$ cat events.jsonl | pick --stream 'select(status >= 400) | url' /api/broken-endpoint /api/timeout $ cat metrics.jsonl | pick --stream 'select(cpu > 90) | host' server-3 server-7

Flags

-i, --input <format>

Force input format

-o, --output <format>

Output as json, yaml, or toml

-f, --file <path>

Read from file instead of stdin

--stream

JSONL line-by-line mode

--json

Output as JSON

--lines

One element per line

-1, --first

Only first result

-d, --default <val>

Fallback value

-e, --exists

Exit code only (0/1)

-c, --count

Count matches

-r, --raw

No quotes on strings

-q, --quiet

Suppress errors

Install

Cargo

Rust ecosystem

cargo install pick-cli

Homebrew

macOS & Linux

brew install aryanbhosale/pick/pick

npm

Node.js ecosystem

npm install -g @aryanbhosale/pick

Snap

Linux

snap install pick-cli

Chocolatey

Windows

choco install pick

WinGet

Windows

winget install aryanbhosale.pick

Docker

Any platform

docker run -i ghcr.io/aryanbhosale/pick

GitHub Releases

Pre-built binaries

Download →
Copied!