Making the GitHub CLI usable for all developers means adding concrete accessibility features to a plain‑text interface, where no hidden markup exists.
Screen Reader Compatibility
Screen readers rely on predictable text patterns to convey information the CLI must provide clear, programmatically detectable cues.
- Replace dynamic spinners with static text messages that include the current action.
- Emit semantic prefixes (e.g.,
INFO,ERROR) to signal message type. - Use the screen reader‑friendly output mode activated via
gh a11y. - Provide a
--no‑ansiflag to strip color codes for pure text streams. - Document the output format in the CLI accessibility guide.
High‑Contrast and Color Customization
Proper contrast ensures that users with low vision can read output regardless of their terminal theme.
- Detect the terminal's background color when possible and select contrasting 4‑bit ANSI colors.
- Map semantic roles (error, warning, success) to the Primer‑approved palette that works across 4‑bit, 8‑bit, and 24‑bit terminals.
- Expose a
--color‑mode=high‑contrastflag that forces the highest contrast pairings. - Allow users to override any palette entry via a
~/.config/gh/colors.jsonfile. - Reference the color‑accessibility best practices for guidance.
Accessible Prompting and Progress Indicators
Interactive prompts must be readable by speech‑synthesis tools and avoid confusing screen redraws.
- Adopt the charmbracelet/huh library, which structures prompts as plain text lines.
- Display each option on its own line with a numeric prefix for easy selection.
- Provide a
--quietmode that suppresses non‑essential prompts. - Replace animated spinners with concise progress statements (e.g., "Cloning repository… Done").
- Include a
--progress=verboseflag for users who prefer detailed step‑by‑step text.
Extending Accessibility to Extensions
Third‑party extensions should inherit the core CLI's accessibility standards without extra effort.
- Expose an
gh a11yAPI that extensions can query for the current accessibility mode. - Offer helper functions to render high‑contrast text and to format prompts consistently.
- Require extension manifests to declare
accessibility truewhen they adopt these helpers. - Provide a testing harness that simulates screen‑reader output for validation.
- Publish extension guidelines in the developer documentation hub.