Skip to content

Get started with jdig

jdig is JSON Digger’s viewer for the terminal. It opens JSON and NDJSON files of any size; compressed files must be decompressed first. Use it over SSH, in scripts, or whenever you are already in a terminal.

In this tutorial you open a small file, find a value, and quit. It takes about five minutes.

  1. Download jdig for your system from the JSON Digger download page and put it in a folder on your PATH.
  2. Open a terminal that shows 24-bit color, such as Windows Terminal, iTerm2, or most Linux terminals.
  3. Save the orders.json sample from Explore your first file in the current folder.

Run:

Terminal window
jdig orders.json

The screen has three parts:

  • Tree: on the left, with the root $ selected and already expanded. Objects show {N keys} and arrays [N items].
  • Details: on the right, the selected node’s type, path, value, and depth, and the number of children of an object or array.
  • Status bar: at the bottom, with the file name, its format and size, and the selected row, such as Row 1 of 3.
  1. Press j twice to move down to "orders", then l to expand it. The cursor moves to its first element, [0].
  2. Press l again. [0] expands, and the cursor moves to its first member, "id".
  3. Press h to go back up to [0], and h again to collapse it.

The arrow keys work too: Down and Up move, Right expands, Left collapses. If your terminal allows it, you can also click a row.

  1. Press /. A / prompt appears at the bottom.
  2. Type pending and press Enter.

The tree expands to the match and moves the cursor to it, "status": "pending", and the details show its path, $.orders[1].status. Press n for the next match; there is only one here.

Press q. Press ? at any time to see a summary of the keys.