Goal
Establish a reusable CLI presentation foundation for Wright with mature Rust ecosystem components, shell completion, environment-aware rendering, and first-class GitHub Actions reporting without changing Wright's semantic or machine-readable result contracts.
Context
wright-cli currently owns a hand-written argv parser/help surface while the driver already exposes typed result envelopes and stable exit-code / wright-result/v1 contracts. This is the right point to separate command parsing and human/CI presentation from semantic execution.
The CLI should provide a good default experience in interactive terminals, generic CI, pipes, and GitHub Actions. GitHub Actions should be treated as a native presentation target rather than only as a terminal with colors.
Scope
- Replace the hand-written CLI argument/help layer with a mature Rust CLI framework (prefer
clap unless implementation evidence suggests otherwise).
- Generate static shell completion for Bash, Zsh, Fish, and PowerShell from the authoritative command model.
- Introduce explicit presentation concepts for:
- output format (
text / stable machine-readable json),
- renderer/environment (
auto, interactive terminal, plain/non-interactive, GitHub Actions),
- color policy (
auto, always, never).
- Detect GitHub Actions and generic CI environments without relying only on TTY heuristics.
- Add a GitHub Actions renderer that can use native workflow presentation facilities where appropriate:
- source-linked error/warning/notice annotations from Wright diagnostics,
- grouped logs,
- job/step summary output with concise PASS/WARN/ERROR results.
- Keep human output readable when color/ANSI is disabled.
- Ensure progress/spinner output, when introduced for long-running operations, never contaminates command stdout or machine output.
- Add configuration/override points so CI-specific presentation can be disabled or forced explicitly.
- Document the CLI output and CI behavior expected by users and automation.
Non-goals
- Do not require all Wright commands, analyzers, lint rules, or language frontends to be feature-complete before implementing this foundation.
- Do not move GitHub Actions knowledge into semantic, analyzer, frontend, or driver layers.
- Do not make ANSI/color the correctness mechanism for CI reporting.
- Do not implement shell-native history autosuggestion; only Wright-owned completion candidates are in scope.
- Do not introduce dynamic/semantic shell completion until a concrete need justifies the extra runtime integration complexity.
- Do not redesign
wright-result/v1, existing exit-code semantics, or command result ownership merely to support richer human presentation.
Acceptance criteria
wright command parsing/help is driven by one authoritative structured command model rather than duplicated hand-written argv/help logic.
- Bash, Zsh, Fish, and PowerShell completion can be generated from that model.
- Interactive terminal, generic CI/non-TTY, and GitHub Actions execution have deterministic documented renderer behavior.
- Users can disable color and GitHub-specific presentation; explicit overrides take precedence over auto-detection.
- GitHub Actions diagnostics can surface as native source annotations when file/span information is available.
- GitHub Actions runs can produce a concise summary suitable for successful and failing
check/lint-style workflows, with PASS/WARN/ERROR remaining understandable without color.
- JSON mode preserves a clean, stable
wright-result/v1 stdout contract with no ANSI, workflow commands, progress text, or other human decoration mixed into stdout.
- Compiled/reconstructed source artifacts written to stdout remain byte-for-byte presentation-safe from progress/CI decoration.
- Tests cover environment detection, renderer selection/override precedence, JSON purity, and GitHub workflow-command escaping/formatting.
- Existing CLI command behavior and exit-code contracts remain compatible unless an intentional user-facing CLI change is documented.
Dependencies
This work depends on the existing typed driver result/diagnostic envelope, not on complete implementation of every Wright feature. Current check, lint, analyze, and related result paths are sufficient to establish and test the presentation architecture.
Future commands and diagnostics should be able to adopt the same renderer without adding GitHub-specific logic to their semantic implementation.
Planning notes
Prefer a thin wright-cli presentation layer over adding CI concepts to wright-driver. A likely shape is a shared presentation model feeding terminal/plain/GitHub/JSON renderers, but the exact internal module structure should be chosen from implementation evidence rather than frozen by this issue.
Mature ecosystem crates should be preferred for generic CLI infrastructure (argument parsing, shell completion, terminal capability/color handling, progress, tracing) while Wright retains ownership of semantic diagnostics, result envelopes, output contracts, and CI presentation policy.
Goal
Establish a reusable CLI presentation foundation for Wright with mature Rust ecosystem components, shell completion, environment-aware rendering, and first-class GitHub Actions reporting without changing Wright's semantic or machine-readable result contracts.
Context
wright-clicurrently owns a hand-written argv parser/help surface while the driver already exposes typed result envelopes and stable exit-code /wright-result/v1contracts. This is the right point to separate command parsing and human/CI presentation from semantic execution.The CLI should provide a good default experience in interactive terminals, generic CI, pipes, and GitHub Actions. GitHub Actions should be treated as a native presentation target rather than only as a terminal with colors.
Scope
clapunless implementation evidence suggests otherwise).text/ stable machine-readablejson),auto, interactive terminal, plain/non-interactive, GitHub Actions),auto,always,never).Non-goals
wright-result/v1, existing exit-code semantics, or command result ownership merely to support richer human presentation.Acceptance criteria
wrightcommand parsing/help is driven by one authoritative structured command model rather than duplicated hand-written argv/help logic.check/lint-style workflows, with PASS/WARN/ERROR remaining understandable without color.wright-result/v1stdout contract with no ANSI, workflow commands, progress text, or other human decoration mixed into stdout.Dependencies
This work depends on the existing typed driver result/diagnostic envelope, not on complete implementation of every Wright feature. Current
check,lint,analyze, and related result paths are sufficient to establish and test the presentation architecture.Future commands and diagnostics should be able to adopt the same renderer without adding GitHub-specific logic to their semantic implementation.
Planning notes
Prefer a thin
wright-clipresentation layer over adding CI concepts towright-driver. A likely shape is a shared presentation model feeding terminal/plain/GitHub/JSON renderers, but the exact internal module structure should be chosen from implementation evidence rather than frozen by this issue.Mature ecosystem crates should be preferred for generic CLI infrastructure (argument parsing, shell completion, terminal capability/color handling, progress, tracing) while Wright retains ownership of semantic diagnostics, result envelopes, output contracts, and CI presentation policy.