json

json reads, searches and changes nested JSON through dotted paths while preserving JSON value types. After a write, the document is validated and saved as normalized JSON.

DataVersion 1.3.6Stable
lil-terminal

Overview

json works directly with nested JSON: address nodes by dotted path, search keys or values, write an inline or file-sourced value atomically, validate the document, and inspect normalized JSON without a session buffer.

A path selects a node; a type stays a type

The command works with parsed data rather than a text fragment. limits.history selects one nested node, -w changes that path, and values after : remain numbers, booleans, null, arrays or objects when they are valid JSON.

Syntax

lil-terminal
json <file> [key|options] · json dump <file>

Reference

json <file>

show JSON data

json <file> <key>

show one exact path or value

json dump <file>

show normalized source text

-f <text|mask> [-k|-v]

find matching keys, paths or values

-w <key> : <value>

write a value directly to the file

-w <key> < <file>

write a value read from another file

-d <key>

delete a value or path

-c

validate the file

Active file

With the current core, a successfully opened file is immediately available as $. If this module is the highest-priority installed handler for the file extension, typing the filename by itself opens it through this command. These are core conveniences; json <file> remains the explicit form.

Search

-f searches paths and values. Add -k for keys only or -v for values only. Queries containing * or ? are treated as masks.

Direct editing

-w writes immediately to the file. Use : for an inline value or < <file> to read a value from another file. -d deletes one dotted path.

Writes happen immediately; -w <key> < <file> reads input from another file, and -d removes a path. Deleting features.1 shifts later array indexes down. JSON has no comments, and rewrites normalize formatting. Use edit or code for full-text editing. Minimum reads a whole file; advanced operations need Base.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Open the file and reuse it with $

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install json
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install json -m
Exact public version

Install exactly this published version.

install json -v 1.3.6
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade json
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install json -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Open the file and reuse it with $
cd \sandbox\config | json app.json
name              lil-sandbox
debug             true
features.0        files
features.1        code
features.2        archives
limits.upload_mb  2
limits.history    25
Show JSON data
cd \sandbox\config | app.json
name              lil-sandbox
debug             true
features.0        files
features.1        code
features.2        archives
limits.upload_mb  2
limits.history    25
Show one exact path or value
json config/app.json limits.history
25
Show one exact path or value
json config/app.json features.1
code
Find matching keys, paths or values
json config/app.json -f "upload" -k
limits.upload_mb  2
Find matching keys, paths or values
json config/app.json -f "files" -v
features.0  files
Find matching keys, paths or values
json config/app.json -f "limits.*"
limits.upload_mb  2
limits.history    25
Write a value directly to the file
json config/app.json -w limits.history : 30
limits.history  30
Write a value read from another file
json config/app.json -w limits.policy < config/value.json
limits.policy  {"rotate":true,"attempts":5}
Write a value directly to the file
json config/app.json -w features.1 : "editor"
features.1  editor
Handle a missing file
json config/app.json -d features.1
name              lil-sandbox
debug             true
features.0        files
features.1        archives
limits.upload_mb  2
limits.history    25
Validate the file
json config/app.json -c
Valid JSON
Show normalized source text
json dump config/app.json
{
    "name": "lil-sandbox",
    "debug": true,
    "features": [
        "files",
        "code",
        "archives"
    ],
    "limits": {
        "upload_mb": 2,
        "history": 25
    }
}
Show one exact path or value
json config/app.json unknown.key
Path not found
Validate the file
json config/invalid.json -c
Invalid JSON
Show JSON data
json config/missing.json
File not found
Write a value directly to the file
json config/app.json -w limits.history
Value required after : or 

File used in this example: sandbox/config/app.json

The example uses a file or directory from the protected /sandbox/ documentation workspace.

{
  "name": "lil-sandbox",
  "debug": true,
  "features": ["files", "code", "archives"],
  "limits": {
    "upload_mb": 2,
    "history": 25
  }
}

Related documentation

Current public release

v1.3.62026-11-01

Production refinement

Current stable release of json. json reads, searches and changes nested JSON through dotted paths while preserving JSON value types.