# yves-cli

> CLI JSON inspector with jorisroling/yves.js

Latest version **1.1.1** (published 2026-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install yves-cli
pnpm add yves-cli
yarn add yves-cli
bun add yves-cli
```

Provides the command `yves`.

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2026-02-19 |
| First published | 2018-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 5 |
| Unpacked size | 46.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joris Röling |
| Maintainers | jorisroling |
| Keywords | yves, cli, json, inspector, debug, inspect, print |

## Links

- npm: https://www.npmjs.com/package/yves-cli
- Repository: https://github.com/jorisroling/yves-cli
- Issues: https://github.com/jorisroling/yves-cli/issues
- npm.io page: https://npm.io/package/yves-cli

## Dependencies (5)

- [sift](https://npm.io/package/sift.md) ^17.1.3
- [yves](https://npm.io/package/yves.md) ^1.1.0
- [jsonic](https://npm.io/package/jsonic.md) ^2.18.0
- [commander](https://npm.io/package/commander.md) ^14.0.3
- [picocolors](https://npm.io/package/picocolors.md) ^1.1.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.1 (latest) — 2026-02-19
- 1.1.0 — 2026-02-19
- 1.0.85 — 2026-01-22
- 1.0.84 — 2025-12-04
- 1.0.83 — 2023-10-31
- 1.0.82 — 2023-03-25
- 1.0.81 — 2022-07-13
- 1.0.80 — 2022-05-02
- 1.0.79 — 2022-01-27
- 1.0.78 — 2022-01-02
- 1.0.77 — 2021-11-23
- 1.0.76 — 2021-09-29
- 1.0.75 — 2021-07-07
- 1.0.74 — 2021-05-27
- 1.0.73 — 2021-05-13
- … 17 more at https://npm.io/package/yves-cli/versions

## README

# yves-cli

> CLI JSON inspector with [yves][yves] from [Joris Röling][jorisroling]. Pretty colors!

## Install

```shell
$ npm install -g yves-cli
```

## Usage

```shell
$ yves --help
Usage: yves [options] [files...]

Options:
  -V, --version          output the version number
  --no-pretty            no pretty formatting
  --no-color             no color
  -m, --max-length <n>   max length
  -r, --root <path>      set dot notated root field
  -f, --fields <fields>  comma separated fields
  -q, --query <expr>     query data with expr (ala mongo)
  --no-json              disable JSON output
  -h, --help             display help for command
```

## Examples

### Sources

#### From file:
```shell
$ ls
package.json component.json

$ yves package.json
```

#### Or many files:
```shell
$ ls
package.json component.json

$ yves package.json component.json
```

#### Pipe from any source:
```shell
$ curl -s "https://api.github.com/users/jorisroling" | yves
```

```shell
$ echo '{"foo": {"bar": 0}}' | yves
{
    "foo": { "bar": 0 }
}
```

Output is JSON by default. Use `--no-json` for yves-style formatting:

```shell
$ echo '{"foo": {"bar": 0}}' | yves --no-json
{
    foo: { bar: 0 }
}
```

### Navigate with --root

Use dot notation to drill into nested data:

```shell
$ echo '{"response": {"data": {"name": "Joris"}}}' | yves --root response.data
{
    "name": "Joris"
}
```

### Filter with --query

Query arrays using MongoDB-style expressions. Supports [jsonic](https://github.com/rjrodger/jsonic) relaxed syntax — no braces or quotes needed:

```shell
# strict JSON
$ cat data.json | yves --query '{"status": "active"}'

# jsonic shorthand (equivalent)
$ cat data.json | yves --query status:active

# multiple conditions
$ cat data.json | yves --query 'status:active,role:admin'

# $in operator
$ cat data.json | yves --query 'id:{$in:[1,2,3]}'
```

### Pick fields with --fields

Select specific fields from array items:

```shell
$ cat data.json | yves --fields id,name,email
```

### Combine options

```shell
$ cat response.json | yves --root results --query 'status:published' --fields id,title
```

[yves]: https://github.com/jorisroling/yves
[jorisroling]: https://github.com/jorisroling/

---
_Source: https://npm.io/package/yves-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
