Repository navigation
feat(cli): -o csv, -o markdown and -o ndjson print a table or one item on a line - #568
Merged
Merged
Conversation
…ne item on a line A table has the columns the model declares, so the header is the same whatever the reply holds: a nested object becomes `status.key` columns, a list stays one cell of JSON text, a result that is one object is a table of one row. An empty listing prints its header too: the command's declared return type travels beside the result (`Declared`), read where the type hints of a command are already read. `ndjson` prints the items alone; where a listing stopped is said on stderr. `csv` is UTF-8 with no byte order mark, lines end with a line feed, cells are the service's text as it came. ARCH-4 changes with its check in this commit: `csv.writer` and `csv.DictWriter` are serializers only `output.py` may call. Decisions of #561 (Р3-А, Р4-А, Р5-Б, Р12-А, Р13, Р14-А). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 10, 2026
Merged
This branch was previously 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.
First of the two output-format PRs decided in #561 (and #498). The second,
-o name, follows.What it does
-o csvand-o markdownprint a table;-o ndjsonprints one item on a line. They work on every command: a result that is one object is a table of one row, or one line.status.key); a list stays one cell of JSON text (Р4-А).get_type_hints(command)already runs (cli/inject.py) and travels beside the result asDeclared(result, returns), the way feat!: every listing takeslimit, everything andnexton the SDK, the CLI and the MCP server #534 carriesContinuable. It does not go through a context: typer 0.26.8 vendors click, and the root result callback has no context to read.ndjsonprints the items alone; where a listing stopped is said on stderr (Р12-А).csv: UTF-8 with no byte order mark, lines end with a line feed, cells are the service's text as it came (Р13). The how-to says that a spreadsheet reads a cell starting with=as a formula.An invariant changes — please look
ARCH-4 and its enforcing check change in this PR (Р14-А):
csv.writerandcsv.DictWriterjoin the serializers that onlycli/output.pymay call.ARCHITECTURE.md,tests/architecture/test_arch4.pyand two biting cases are edited together.Choices the decisions did not spell out (accepted by the architect)
valuecell of JSON text.Listing[str]) are one column,value.parent), is one cell of JSON text.forms subscriptions list,datalens collections content-list) has the columns of every declared kind.<br>.-o jsonprints it.Checked
uv run pytest: 6217 passed, 5 skipped, coverage 100% (lines and branches);lint-imports,ty,ruffclean. That run was on this tree before the last edit, which added aRaises:section to one docstring; after it,tests/unit/cliand the new contract test were rerun (1159 passed) and the pre-commit hooks passed.-o json: thendjsonlines equal the items, everycsvcell equals the JSON value under its column, every Markdown line has the same number of cells, and text, counts and bytes print the same in every format.csv.writercalled outsideoutput.py.Not run
🤖 Generated with Claude Code