Should be compatible with POSIX shell.
j2ad converts JSON to AION delimited syntax. It reads JSON from a file or
standard input and writes compact output by default:
cat input.json | j2ad j2ad --pretty --width 80 input.json output.aion
Strings that are valid AION atoms are emitted bare. Strings that need quoting escape JSON-sensitive characters, including quotes, backslashes, newlines, tabs, backspace, formfeed, and other control characters.
Supported CLI options:
-
--pretty/--no-prettytoggles expanded output. -
--width Nor--width=Nsets the target pretty-print width. The minimum is40. -
--object-threshold Nor--object-threshold=Nexpands objects with at leastNfields even when the compact form fits. Set0to disable that heuristic. -
--expand-lists/--no-expand-liststoggles expansion of lists containing non-scalar values.
Configuration is read from ~/.j2adrc and then .j2adrc; CLI options override
both files. Config files accept whole-line and inline # comments:
pretty true width 80 # keep output readable in terminals object_threshold 3 expand_lists true
j2ai converts JSON to AION indented syntax. It reads JSON from a file or
standard input and writes scalar-only lists on one line when they fit:
cat input.json | j2ai j2ai --width 80 --no-single-line-lists input.json output.aion
Supported CLI options:
-
--width Nor--width=Nsets the target width for single-line lists. The minimum is40. -
--single-line-lists/--no-single-line-liststoggles compact rendering for scalar-only lists.
Configuration is read from ~/.j2airc and then .j2airc; CLI options override
both files. Config files accept whole-line and inline # comments:
width 80 # keep list fields readable in terminals single_line_lists true
Lists containing objects or nested non-scalar values remain expanded so the indented structure stays clear.
j2as converts JSON Lines / JSONL to AION delimited stream syntax. It reads one
JSON value per input line and writes one AION stream value per output line:
cat input.jsonl | j2as j2as --no-contract input.jsonl output.aionl
Supported CLI options:
-
--contractemitscontract urn:aion:delimited-streamas the first output line. This is the default. -
--no-contractomits the contract header.
JSONL input must contain exactly one valid JSON value per non-empty line. Blank lines are rejected, including whitespace-only lines, while a single final newline is accepted. Object key order is preserved.
Example input:
"line1"
2
3
[1,2,3]
{"type":"test","desc":"this is test data"}
{"tag":"#release","kind":"record","literal":"true","num_as_text":"123"}
Default output:
contract urn:aion:delimited-stream
"line1"
2
3
[1 2 3]
{type test desc "this is test data"}
{tag #release kind record literal "true" num_as_text "123"}
Top-level JSON strings are emitted as quoted AION strings. Strings inside objects and arrays use the compact delimited rendering rules: ordinary strings may be bare, while reserved literals, number-like strings, strings with whitespace, and control-character strings are quoted and escaped.