CLI Reference
Complete command-line interface documentation.
Installation
npm install -g @mackan_eu/json-toolbox
Verify installation:
json-toolbox version
# json-toolbox v2.3.0-final
Commands
| Command | Description |
run <manifest> | Run a pipeline manifest |
exec <operator> | Execute a single operator |
validate <manifest> | Validate a pipeline manifest |
describe <operator> | Show operator details |
list-operators | List all operators |
version | Show version |
help | Show help |
Examples
Format JSON
echo '{"a":1,"b":2}' | json-toolbox exec json.format
CSV to JSON
cat data.csv | json-toolbox exec csv.parse --header true
Filter Array
cat data.json | json-toolbox exec transform.filter --key status --operator eq --value active
Run Pipeline
json-toolbox run pipeline.json < input.json > output.json
Streaming Mode
json-toolbox exec transform.filter --key level --operator eq --value error \
--stream --progress < huge.ndjson
Global Flags
| Flag | Description |
-i, --input <file> | Input file (default: stdin) |
-o, --output <file> | Output file (default: stdout) |
--minify | Minify output |
--strict | Error on unknown parameters |
--stream | Enable streaming mode (NDJSON) |
--progress | Show progress in streaming mode |
--chunk <n> | Chunk size for streaming (default: 1000) |
--json | JSON output format |
Exit Codes
| Code | Meaning |
| 0 | Success |
| 1 | General error |
| 2 | Invalid manifest |
| 3 | Invalid input |
| 10 | Unknown operator |
| 11 | Unknown parameter (strict mode) |