Skip to content

feat(ai-cu): add opt-in terminal Markdown previews - #10784

Open
Chien Yuan Chang (chienyuanchang) wants to merge 23 commits into
mainfrom
ai-cu/terminal-markdown-rendering
Open

Chien Yuan Chang (chienyuanchang) wants to merge 23 commits into
mainfrom
ai-cu/terminal-markdown-rendering

Conversation

@chienyuanchang

@chienyuanchang Chien Yuan Chang (chienyuanchang) commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Add opt-in terminal Markdown previews with azd ai cu analyze --pretty (-p). Default output is Markdown/HTML text; saved results and reports are not pretty-printed.

  • Format Markdown and display supported HTML tables as tables or labeled cards. Unsupported tables show their source with a layout notice.
  • Display document metadata, page comments, and generated row labels in a shared gray; use consistent heading colors, a distinct table color, and yellow layout notices.
  • Include metadata delimiters and source line breaks. Document URLs are not rewritten; terminal and bidi controls are filtered.
  • Show animated, action-colored Analyzing <target>... progress only on interactive terminals with default output. Concurrent inputs share a rotating status line. Local targets show file names; URL targets omit credentials, query parameters, and fragments without changing the service request. Progress clears before final output and is never written to result or report files.
  • Display a valid https://<your-resource>.services.ai.azure.com example in missing-endpoint guidance.
  • Provide readable version output and highlighted provisioning guidance with blue wizard questions.

Usage and behavior

azd ai cu analyze invoice.pdf --pretty
azd ai cu analyze invoice.pdf -p
  • Pretty-printing requires one streamed LLM-input result. Incompatible options and multiple inputs are rejected before authentication.
  • --pretty / -p cannot be combined with --output json, --output none, --llm-input=false, --usage, --dry-run, --output-file, or --output-dir. Reports are supported.
  • Omit the flag or use --pretty=false / -p=false for default text output.
  • Respect NO_COLOR. Redirected or piped previews are uncolored and use an 80-column layout; progress is omitted.

Validation

  • Race tests passed for the affected command, analysis, configuration, and error-handling packages. Targeted preview/color, shorthand, conflict-validation, and help tests also passed.
  • Real PTY tests with mocked service responses passed for local files and URLs, including URL request fidelity and result/report non-contamination.
  • Regression coverage includes progress concurrency, cancellation and writer failures, no-color handling, and repeated endpoint-message sanitization.
  • Extension build, vet, lint, modernization, documentation spelling, and whitespace checks passed during implementation.
  • A live Linux prebuilt-layout analysis of the SDK sample invoice succeeded. Its three tables used HTML-source fallback; this is not evidence of successful formatted-table/card rendering or native Windows/macOS acceptance.

Limitations and remaining review

  • Long values/cards can exceed terminal width; Markdown tables can shorten long links.
  • Unicode alignment, right-to-left text, and emoji appearance depend on the terminal and font.
  • Native Windows/macOS visual acceptance and spacing/copy-paste checks remain outstanding.
  • Experience spec: Azure/azure-dev#10869, covering --pretty and -p; approval is pending.
  • No final repository-wide mage preflight or cross-platform acceptance run is claimed.

Add host-native generation prompts, a model multi-select flow, readable summaries, and regression coverage. Prepare 0.1.1-preview and date the initial release.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address P2 analysis and analyzer error guidance and privacy-safe schema source locations. Add regressions for explicit empty selectors and full extension help paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retry only validation errors for the prompted infrastructure field. Resolve authoring diagnostics against the selected alias without remapping literal spec findings or changing structured finding output. Add regression coverage and document source-location behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Render Markdown with Glamour and supported HTML tables with azd tables or cards. Preserve raw output by default, protect preview metadata and sensitive URLs, and cover command validation and multilingual rendering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

azure-pipelines Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
26 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the ext-content-understanding azure.ai.content-understanding extension label Oct 29, 2026
Preserve the merged CU provisioning and documentation updates while retaining the opt-in terminal Markdown renderer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@chienyuanchang
Chien Yuan Chang (chienyuanchang) changed the base branch from ai-cu/infra-interactive-parity to main November 3, 2026 22:31
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

VSCode Extension Installation Instructions

  1. Download the extension at https://azuresdkartifacts.z5.web.core.windows.net/azd/vscode/pr/10784/azure-dev-0.11.0-alpha.1.vsix
  2. Extract the extension from the compressed file
  3. In vscode
    a. Open "Extensions" (Ctrl+Shift+X)
    b. Click the ...\ menu at top of Extensions sidebar
    c. Click "Install from VSIX"
    d. Select location of downloaded file

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

microsoft.azd.extensions PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10784/microsoft-azd-extensions.zip"
  • Version: 0.14.0-pr.10784.7033695
  • Merge commit: fb9f753

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.projects PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10784/azure-ai-projects.zip"
  • Version: 1.0.0-beta.16.pr.10784.7033699
  • Merge commit: fb9f753

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.toolboxes PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10784/azure-ai-toolboxes.zip"
  • Version: 1.0.0-beta.13.pr.10784.7033701
  • Merge commit: fb9f753

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

microsoft.azd.concurx PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10784/microsoft-azd-concurx.zip"
  • Version: 0.1.0-pr.10784.7033698
  • Merge commit: fb9f753

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.agents PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10784/azure-ai-agents.zip"
  • Version: 1.0.0-beta.23.pr.10784.7033696
  • Merge commit: fb9f753

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.skills PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10784/azure-ai-skills.zip"
  • Version: 1.0.0-beta.10.pr.10784.7033700
  • Merge commit: fb9f753

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.content-understanding PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10784/azure-ai-content-understanding.zip"
  • Version: 0.1.2-preview.pr.10784.7038901
  • Merge commit: c354323

Keep metadata delimiters, page comments and source line breaks. Align H1 styling with other headings, replace the blanket preview banner with table layout notices, and mark generated card row labels as dim comments. Retain existing URL safety filtering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@chienyuanchang
Chien Yuan Chang (chienyuanchang) marked this pull request as ready for review November 6, 2026 20:27
Copilot AI lite review requested due to automatic review settings November 6, 2026 20:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Approval is blocked by two active review issues: the new user-facing --pretty option lacks a linked approved experiences spec, and the PR description contradicts the intentionally preserved URL components.

2 open issues
What changed in this PR

Adds opt-in terminal pretty-printing for azd ai cu analyze --pretty while preserving existing Markdown, HTML, JSON, report, and saved-result behavior by default. It also improves version output, provisioning guidance styling, documentation, and release metadata.

Changes:

  • Adds Markdown, metadata, HTML table, and wide-table card rendering with terminal-safety filtering and color support.
  • Adds validation for incompatible options and multiple-input pretty-printing.
  • Updates version output, provisioning prompts, documentation, dependencies, tests, and changelog entries.
  • Review follow-ups include moving multiple-input validation before output planning, adding the flag to offline help coverage, providing the experiences-spec reference, and correcting stale URL-redaction claims in the PR description.
File Description
cli/​azd/​extensions/​azure.ai.content-understanding/​version.txt Bumps the extension preview version.
cli/​azd/​extensions/​azure.ai.content-understanding/​README.md Documents default and pretty-printed analysis output.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​preview/​safety.go Filters terminal and bidi control characters.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​preview/​render.go Implements Markdown, metadata, table, card, and color rendering.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​preview/​render_test.go Tests rendering, safety, links, tables, cards, colors, layout, and cancellation.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​preview/​multilingual_test.go Tests multilingual table and card behavior.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​preview/​metadata.go Detects and preserves generated metadata blocks.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​preview/​metadata_test.go Tests metadata boundaries and opaque content.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​version.go Improves human-readable version output while preserving JSON output.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​root_test.go Tests version output behavior.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​infra.go Highlights commands, paths, and identifiers in provisioning guidance.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​infra_prompts.go Adds styling for prompts and guidance.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​infra_prompts_test.go Tests prompt, guidance, and no-color behavior.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​infra_host.go Styles subscription-selection prompts.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​diagnostics.go Adds guidance text highlighting helpers.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​analyze.go Registers, validates, and invokes --pretty.
cli/​azd/​extensions/​azure.ai.content-understanding/​internal/​cmd/​analyze_render_test.go Tests pretty-print behavior, conflicts, redirects, reports, and output preservation.
cli/​azd/​extensions/​azure.ai.content-understanding/​go.mod Promotes rendering libraries to direct dependencies.
cli/​azd/​extensions/​azure.ai.content-understanding/​extension.yaml Updates the manifest version.
cli/​azd/​extensions/​azure.ai.content-understanding/​docs/​usage.md Documents pretty-print behavior, limitations, and compatibility.
cli/​azd/​extensions/​azure.ai.content-understanding/​docs/​provisioning.md Documents provisioning guidance and prompt colors.
cli/​azd/​extensions/​azure.ai.content-understanding/​cspell.yaml Adds preview-specific spelling overrides.
cli/​azd/​extensions/​azure.ai.content-understanding/​CHANGELOG.md Adds release notes for the feature and UX updates.

This pull request requires changes.

Review effort: Lite

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 6, 2026 22:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An unresolved critical safety issue allows semicolonless encoded control characters to bypass preview filtering, and the new flag still lacks the required approved experiences-spec reference.

3 open issues
1 resolved since last review

Review effort: Lite

Comment on lines +86 to +87
flags.BoolVarP(&options.pretty, "pretty", "p", false,
"Pretty-print one streamed LLM-input result in the terminal (default: original text)")
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 6, 2026 22:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Native Windows/macOS visual acceptance and repository-wide cross-platform validation remain outstanding for the terminal rendering and PTY-dependent progress behavior.

1 open issue
2 resolved since last review

Review effort: Lite

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 7, 2026 00:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because the change contains critical output-mode behavior that can corrupt documented JSON responses on interactive terminals, alongside a documentation inconsistency about supported flag combinations.

1 open issue

Review effort: Lite

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-content-understanding azure.ai.content-understanding extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants