Repository navigation
Add a --json option for JSON Lines batch output - #275
Open
leo7martins wants to merge 1 commit into
Open
leo7martins wants to merge 1 commit into
leo7martins wants to merge 1 commit into
Conversation
Batch mode (-e and stdin) can now emit results as JSON Lines, one JSON
object per row, via cli_helpers' jsonl adapter:
litecli db.sqlite -e "select * from users" --json
--csv still takes precedence if both flags are given, and the default
(tsv when no format flag is passed) is unchanged. Also documents jsonl
as a valid table_format value in liteclirc.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This was referenced Nov 21, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #263.
Adds a
--jsonflag for batch output (-eand stdin), emitting results as JSON Lines - one JSON object per row:One note vs. the issue text:
cli_helpersregisters the format asjsonl, notjson-TabularOutputFormatter(format_name="json")raisesValueError: unrecognized format_name "json", whilejsonlis insupported_formatson the pinnedcli_helpers>=2.2.1. So--jsonmaps to thejsonladapter, which still fits the issue's scripting use case (jqhandles JSON Lines natively or via slurp mode).What changed
litecli/main.py: new--jsonflag; in both batch branches (-eand stdin) it setsformatter.format_name = "jsonl".--csvstill wins if both flags are given, and the default (tsv when no format flag is passed) is unchanged.litecli/liteclirc: documentsjsonlas a validtable_formatvalue (it already works there today, since it's just acli_helpersformat name).CHANGELOG.md: entry underUnreleased->Features.tests/test_main.py:test_execute_arg_with_jsonandtest_batch_mode_json, mirroring the existing--csvtests (-epath and stdin path, including the embedded-newline case so the JSON escaping is pinned).According to the commit and PR disclosure, Mistral Vibe, an AI coding agent, prepared the implementation and tests. As of 2026-11-24, no reviews are recorded on this PR. The Lint, Typecheck, and litecli workflows are awaiting maintainer approval, and the checks page reports “Workflow runs completed with no jobs”; therefore no CI test, lint, or typecheck result is available. No agent test-run artifact is linked on the PR, so the earlier local-suite, Ruff, and manual-run claims are not presented as verified results.