Skip to content

feat: stop truncating IDs in tables and add --markdown to documents describe (#38)#46

Merged
teslakoile merged 3 commits into
masterfrom
feat/issue-38-full-ids-markdown
Apr 19, 2026
Merged

feat: stop truncating IDs in tables and add --markdown to documents describe (#38)#46
teslakoile merged 3 commits into
masterfrom
feat/issue-38-full-ids-markdown

Conversation

@teslakoile

Copy link
Copy Markdown
Owner

Summary

Two surgical output-layer fixes. Neither touches CRUD logic.

  • huly documents list, huly components list, etc. no longer render the id / parent columns with Rich's ellipsis truncation, so copying an ID out of a terminal actually works.
  • huly documents describe --markdown emits 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.pyprint_list now opts columns named id / parent out of default ellipsis overflow (no_wrap=True, overflow="fold"). Rule is centralized in the helper; no per-command plumbing.
  • src/huly_cli/commands/documents.pydocs_describe gains --markdown (human-only flag; JSON mode already returns markdown by default). Mutually exclusive with --raw, following the same pattern as the existing --set / --set-file check.
  • tests/test_commands.py — CliRunner tests:
    • documents list renders the full 24-char ID with no
    • parent column also shows the full ID
    • components list same
    • issues list still renders short identifiers intact after the helper change
    • documents describe --markdown produces plain GFM with no Rich box chars (╭╮╰╯┏┓┗┛━) and no panel title
    • --raw + --markdown → exit 1 with a clear error
    • default rendering still uses the Rich panel
    • JSON mode + --markdown still emits the JSON envelope
  • tests/test_output.py — helper-level snapshot-ish guards on print_list so the no-truncate rule cannot silently regress.
  • README.md — documents the --markdown flag and the full-ID behavior.
  • skills/huly-cli/SKILL.md — agent-facing guidance that describe --markdown is the preferred read path.

Test plan

  • uv run pytest -x — 277 passed
  • uv run ruff format . && uv run ruff check . — clean
  • Manual smoke: uv run huly documents describe --help shows --markdown
  • Manual smoke: rendering a real print_list with 24-char IDs shows them in full
  • Scope check: git diff master --stat touches only src/huly_cli/output.py, src/huly_cli/commands/documents.py, the two test files, README.md, and skills/huly-cli/SKILL.md

Closes #38

teslakoile and others added 3 commits April 19, 2026 21:06
…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>
@teslakoile teslakoile merged commit c462e8e into master Apr 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

output: stop truncating IDs in tables; add --markdown for documents describe

1 participant