Start
ChronusQL CLI
The CLI accepts query text or a query file, named input and output bindings, and optional streaming read modes. The test suite validates these argument forms.
Guide
The CLI accepts query text or a query file, named input and output bindings, and optional streaming read modes. The test suite validates these argument forms.
Query Text
chronusql --query "SELECT value INTO output FROM input" --input input=input.jsonl --output output=output.jsonlQuery File and Default Input
The parser accepts a file-style invocation where `--file` binds the default input name `input`, and the remaining positional argument is the SQL file path.
chronusql --file input.json query.sqlThis corresponds to the tested argument array:
var args = new[] { "--file", "input.json", "query.sql" };Named Inputs and Outputs
Multiple input and output streams are supported by repeating `--input` and `--output`:
chronusql --query "SELECT value INTO output_one FROM input_one; SELECT payload.name INTO output_two FROM input_two;" \
--input input_one=input-one.jsonl \
--input input_two=input-two.jsonl \
--output output_one=output-one.jsonl \
--output output_two=output-two.jsonlThe tested SQL is:
SELECT value INTO output_one FROM input_one;
SELECT payload.name INTO output_two FROM input_two;Standard Input and Standard Output
Named bindings use `name=-` for standard streams:
chronusql --query "SELECT value INTO output FROM input" --input input=- --output output=-Only one input may use stdin, and only one output may use stdout. The tests verify that multiple stdin inputs and multiple stdout outputs are rejected.
Follow Mode
`--follow` processes existing file content and then continues watching file inputs for appended JSON:
chronusql --query "SELECT value INTO output FROM input TIMESTAMP BY ts" --follow --input input=input.jsonl --output output=output.jsonlThe tested follow-mode query is:
SELECT value INTO output FROM input TIMESTAMP BY tsFollow mode is file-input only. While running, the CLI listens for `q` or `Q` on stdin to stop following.
Tail Mode
`--tail` ignores existing file content and only streams newly appended records:
chronusql --query "SELECT value INTO output FROM input" --tail --input input=input.jsonl --output output=output.jsonlIn the tests, an existing row:
{"value":10}is not emitted when tail mode starts. Appended rows are emitted:
{"value":11}
{"value":12}CLI Validation
The CLI rejects:
- Missing query SQL when neither `--query` nor a query file is provided.
- `--follow` or `--tail` without a file input.
- Both `--follow` and `--tail` in the same command.
- More than one stdin input.
- More than one stdout output.
- SQL that references an input name with no corresponding `--input`.
- SQL that writes to an output name with no corresponding `--output`.