gh-accessibility
Add accessibility labels to GitHub issues
TLDR
Open the GitHub Accessibility site in your browser
SYNOPSIS
gh accessibility check
[path_to_file_or_URL] [flags]
PARAMETERS
check
Performs an accessibility audit on the specified target.
[path_to_file_or_URL]
The local file path (e.g., ./README.md) or a web URL (e.g., https://example.com) to audit. This argument can often be omitted if --repo or --url flags are used.
-R, --repo
Specifies the GitHub repository to audit (e.g., octocat/Spoon-Knife). When used, the command will look for relevant files within this repository context.
--url
Explicitly specifies a URL to audit. This flag is useful when the URL is distinct from the current repository context.
--audit-only-html
Limits the audit to only HTML files or URLs, ignoring Markdown files even if present.
--audit-only-readme
Focuses the audit solely on the repository's README file. Requires the --repo flag to be set.
-p, --path-to-file
Specifies a particular file path within the context of the repository defined by --repo (e.g., docs/index.md).
-o, --output
Writes the audit results to the specified file path instead of printing to standard output.
--ci
Outputs results in a machine-readable JSON format, optimized for use in Continuous Integration (CI) environments.
--config
Specifies a custom configuration file for the accessibility audit, allowing for tailored rules and settings.
--verbose
Enables verbose output, providing more detailed information during the audit process.
-h, --help
Displays help information for the gh accessibility check command.
DESCRIPTION
The gh-accessibility command is a powerful
GitHub CLI extension designed to help developers and teams ensure their projects on GitHub are accessible to everyone. It integrates directly with the gh command-line tool, allowing users to audit local files (like READMEs) or remote web pages and repositories for common accessibility issues.
This extension primarily focuses on identifying potential barriers for users with disabilities, checking for issues in HTML and Markdown content, including those often found in repository documentation (e.g., insufficient contrast, missing alt text, incorrect heading structure). By bringing accessibility checks into the CLI workflow, gh-accessibility promotes early detection and remediation of issues, making it easier to build and maintain inclusive GitHub projects.
CAVEATS
- Dependency: Requires the
GitHub CLI (gh command) to be installed and authenticated. - Installation: As an extension, it must be installed via gh extension install gh-accessibility/gh-accessibility before use.
- Internet Connection: Auditing remote URLs or repositories requires an active internet connection.
- Scope: While comprehensive for common issues, it may not cover every single accessibility standard or highly complex interactive web components.
- Local File Support: Directly supports HTML and Markdown files for local auditing.
<B>INSTALLATION</B>
To install the gh-accessibility extension, use the following command:
gh extension install gh-accessibility/gh-accessibility
You can update it later with:
gh extension update gh-accessibility/gh-accessibility
<B>BASIC USAGE EXAMPLES</B>
- Audit a local README file:
gh accessibility check ./README.md - Audit a specific web page:
gh accessibility check https://www.github.com - Audit the README of a specific GitHub repository:
gh accessibility check -R octocat/Spoon-Knife --audit-only-readme - Output results to a file for a local HTML document:
gh accessibility check my_project/index.html -o a11y_report.txt - Run a CI-friendly audit for a URL:
gh accessibility check https://example.com --ci
HISTORY
The gh-accessibility extension was developed as an open-source project to extend the capabilities of the GitHub CLI. It emerged from the need to integrate accessibility auditing directly into developers' everyday workflows on GitHub. By leveraging existing accessibility tools and integrating them into the gh ecosystem, it aims to make accessibility considerations more prevalent and easier to manage for repository owners and contributors.


