# great-docs check-links


Check for broken links in source code and documentation.


``` bash
great-docs check-links [OPTIONS]
```


This command scans Python source files and documentation ('.qmd', `.md`) for URLs and checks their HTTP status. It reports broken links (404s) and warns about redirects.

- Default ignore patterns include:
- localhost and 127.0.0.1 URLs
- example.com, example.org, yoursite.com URLs
- Placeholder URLs with brackets like \[username\]


<span class="gd-details-chevron" aria-hidden="true"></span>Full --help output


    Usage: great-docs check-links [OPTIONS]

      Check for broken links in source code and documentation.

      This command scans Python source files and documentation ('.qmd', '.md') for
      URLs and checks their HTTP status. It reports broken links (404s) and warns
      about redirects.

      Default ignore patterns include:
      • localhost and 127.0.0.1 URLs
      • example.com, example.org, yoursite.com URLs
      • Placeholder URLs with brackets like [username]

      Examples:
        great-docs check-links                        # Check all links
        great-docs check-links --verbose              # Show progress for each URL
        great-docs check-links --docs-only            # Only check documentation
        great-docs check-links --source-only          # Only check source code
        great-docs check-links -i "github.com/.*#"    # Ignore GitHub anchor links
        great-docs check-links --timeout 5            # Use 5 second timeout
        great-docs check-links --json-output          # Output as JSON

    Options:
      --project-path DIRECTORY  Path to your project root directory (default:
                                current directory)
      --source-only             Only check links in Python source files
      --docs-only               Only check links in documentation files
      --timeout FLOAT           Timeout in seconds for each HTTP request (default:
                                10)
      -i, --ignore TEXT         URL pattern to ignore (can be used multiple times)
      -v, --verbose             Show detailed progress for each URL checked
      --json-output             Output results as JSON
      --help                    Show this message and exit.


# Options


`--project-path: DIRECTORY`  
Path to your project root directory (default: current directory)

`--source-only`  
Only check links in Python source files

`--docs-only`  
Only check links in documentation files

`--timeout: FLOAT = 10.0`  
Timeout in seconds for each HTTP request (default: 10)

`-i, --ignore: TEXT`  
URL pattern to ignore (can be used multiple times)

`-v, --verbose`  
Show detailed progress for each URL checked

`--json-output`  
Output results as JSON


# Examples

``` bash
  great-docs check-links                        # Check all links
  great-docs check-links --verbose              # Show progress for each URL
  great-docs check-links --docs-only            # Only check documentation
  great-docs check-links --source-only          # Only check source code
  great-docs check-links -i "github.com/.*#"    # Ignore GitHub anchor links
  great-docs check-links --timeout 5            # Use 5 second timeout
  great-docs check-links --json-output          # Output as JSON
```
