feat: stop truncating IDs in tables and add --markdown to documents describe (#38)#46
Merged
Merged
Conversation
…escribe (#38) Two output-layer fixes that help agent workflows without touching CRUD logic: 1. `print_list` renders `id` and `parent` columns with `no_wrap=True` and `overflow="fold"`, so the full 24-char Huly ID is always present in list output. A truncated ID (`69cba04d0122c97…`) was useless as a lookup key because `huly ... get` rejected it. Other columns still wrap/truncate normally. 2. `documents describe --markdown` emits plain GFM to stdout — no Rich panel, no reflow — so agents can diff, grep, and round-trip content back through `--set-file`. Mutually exclusive with `--raw` (mirrors the existing `--set` / `--set-file` check). Tests: command-layer CliRunner coverage asserts full ID substrings in `documents list`, plus box-char absence and heading fidelity for `documents describe --markdown`. Helper-level snapshot-ish guards in test_output.py catch any regression of the no-truncate rule. Closes #38 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Two surgical output-layer fixes. Neither touches CRUD logic.
huly documents list,huly components list, etc. no longer render theid/parentcolumns with Rich's ellipsis truncation, so copying an ID out of a terminal actually works.huly documents describe --markdownemits plain GFM to stdout — no Rich box, no reflow — so agents can diff, grep, and round-trip content back through--set-file.Changes
src/huly_cli/output.py—print_listnow opts columns namedid/parentout of default ellipsis overflow (no_wrap=True, overflow="fold"). Rule is centralized in the helper; no per-command plumbing.src/huly_cli/commands/documents.py—docs_describegains--markdown(human-only flag; JSON mode already returns markdown by default). Mutually exclusive with--raw, following the same pattern as the existing--set/--set-filecheck.tests/test_commands.py— CliRunner tests:documents listrenders the full 24-char ID with no…parentcolumn also shows the full IDcomponents listsameissues liststill renders short identifiers intact after the helper changedocuments describe --markdownproduces plain GFM with no Rich box chars (╭╮╰╯┏┓┗┛━) and no panel title--raw+--markdown→ exit 1 with a clear error--markdownstill emits the JSON envelopetests/test_output.py— helper-level snapshot-ish guards onprint_listso the no-truncate rule cannot silently regress.README.md— documents the--markdownflag and the full-ID behavior.skills/huly-cli/SKILL.md— agent-facing guidance thatdescribe --markdownis the preferred read path.Test plan
uv run pytest -x— 277 passeduv run ruff format . && uv run ruff check .— cleanuv run huly documents describe --helpshows--markdownprint_listwith 24-char IDs shows them in fullgit diff master --stattouches onlysrc/huly_cli/output.py,src/huly_cli/commands/documents.py, the two test files,README.md, andskills/huly-cli/SKILL.mdCloses #38