Fast, concurrent dead link detector for files.
https://github.com/leonardomso/gone.git
Fast, concurrent dead link detector for documentation files.
Scan your documentation files for broken links. gone finds all HTTP/HTTPS URLs in Markdown, JSON, YAML, TOML, and XML files, checks if they're still alive, and helps you fix the ones that aren't.
htop for your links.gone fix updates your markdown to use the final URL. Preview changes first with --dry-run, confirm each file interactively, or let it fix everything with --yes..gonerc.yaml or pass them as flags.--format.[text](url), reference-style [text][ref], autolinks <url>, and HTML <a> tags while skipping code blocks.go install github.com/leonardomso/gone@latest
brew install leonardomso/tap/gone
git clone https://github.com/leonardomso/gone.git
cd gone
go build
Download the latest release from the GitHub Releases page.
# Scan current directory (markdown files by default)
gone check
# Scan specific directory
gone check ./docs
# Scan multiple file types
gone check --types=md,json,yaml
# Output as JSON
gone check --format=json
# Launch interactive TUI
gone interactive
# Auto-fix redirect URLs
gone fix
gone checkScan files for dead links.
gone check [path] [flags]
Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--types | -T | md | File types to scan (comma-separated): md, json, yaml, toml, xml |
--strict | β | false | Fail on malformed files instead of skipping them |
--format | -f | β | Output format: json, yaml, xml, junit, markdown |
--output | -o | β | Write report to file (format inferred from extension) |
--all | -a | false | Show all results including alive links |
--dead | -d | false | Show only dead links and errors |
--warnings | -w | false | Show only warnings (redirects, blocked) |
--alive | β | false | Show only alive links |
--concurrency | -c | 50 | Number of concurrent workers |
--timeout | -t | 5 | Timeout per request in seconds |
--retries | -r | 1 | Number of retries for failed requests |
--ignore-domain | β | β | Domains to ignore (comma-separated or repeated) |
--ignore-pattern | β | β | Glob patterns to ignore |
--ignore-regex | β | β | Regex patterns to ignore |
--show-ignored | β | false | Show which URLs were ignored |
--no-config | β | false | Skip loading .gonerc.yaml |
--stats | β | false | Show performance statistics |
| Status | Description |
|---|---|
Alive | Link returned a 2xx response. All good. |
Redirect | Link redirected (301, 302, 307, 308) but final destination is alive. Consider updating to the final URL. |
Blocked | Server returned 403. Might be bot detection. Link may still work in a browser. |
Dead | Link is broken (4xx, 5xx, or redirect chain ends in error). |
Error | Network error: timeout, DNS failure, or connection refused. |
Duplicate | Same URL appears multiple times. Checked once, result shared. |
# Scan markdown, JSON, and YAML files
gone check --types=md,json,yaml
# Scan with strict mode (fail on malformed files)
gone check --types=json --strict
# Scan with JSON output to stdout
gone check --format=json
# Write JUnit report for CI
gone check --output=report.junit.xml
# Show only dead links
gone check --dead
# Increase concurrency for faster scanning
gone check --concurrency=20
# Ignore specific domains
gone check --ignore-domain=localhost,example.com
gone interactiveLaunch an interactive terminal UI with real-time progress.
gone interactive [path] [flags]
Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--types | -T | md | File types to scan (comma-separated): md, json, yaml, toml, xml |
--strict | β | false | Fail on malformed files instead of skipping them |
--ignore-domain | β | β | Domains to ignore |
--ignore-pattern | β | β | Glob patterns to ignore |
--ignore-regex | β | β | Regex patterns to ignore |
--no-config | β | false | Skip loading .gonerc.yaml |
| Key | Action |
|---|---|
β / k | Move up |
β / j | Move down |
PgUp / Ctrl+U | Page up |
PgDn / Ctrl+D | Page down |
g / Home | Go to start |
G / End | Go to end |
f | Cycle filter (All β Warnings β Dead β Duplicates) |
? | Toggle help |
q / Ctrl+C | Quit |
gone fixAutomatically fix redirect URLs in files.
gone fix [path] [flags]
Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--types | -T | md | File types to scan (comma-separated): md, json, yaml, toml, xml |
--strict | β | false | Fail on malformed files instead of skipping them |
--yes | -y | false | Apply all fixes without prompting |
--dry-run | -n | false | Preview changes without modifying files |
--concurrency | -c | 50 | Number of concurrent workers |
--timeout | -t | 5 | Timeout per request in seconds |
--retries | -r | 1 | Number of retries for failed requests |
--ignore-domain | β | β | Domains to ignore |
--ignore-pattern | β | β | Glob patterns to ignore |
--ignore-regex | β | β | Regex patterns to ignore |
--no-config | β | false | Skip loading .gonerc.yaml |
--stats | β | false | Show performance statistics |
# Interactive mode - prompt for each file
gone fix
# Preview what would be fixed
gone fix --dry-run
# Apply all fixes automatically
gone fix --yes
gone completionGenerate shell autocompletion scripts.
gone completion [shell]
Supported Shells:
| Shell | Command |
|---|---|
| Bash | gone completion bash |
| Zsh | gone completion zsh |
| Fish | gone completion fish |
| PowerShell | gone completion powershell |
# Bash (add to ~/.bashrc)
source <(gone completion bash)
# Zsh (add to ~/.zshrc)
source <(gone completion zsh)
# Fish
gone completion fish | source
Create a .gonerc.yaml file in your project root:
# File types to scan (default: md)
types:
- md
- json
- yaml
- toml
- xml
# Scanner settings
scan:
# Include only files matching these glob patterns
include:
- "docs/**"
- "README.md"
# Exclude files matching these glob patterns
exclude:
- "node_modules/**"
- "vendor/**"
- ".git/**"
# Checker settings
check:
concurrency: 50 # Number of concurrent workers
timeout: 10 # Request timeout in seconds
retries: 2 # Retry attempts for failed requests
strict: false # Fail on malformed files
# Output preferences
output:
format: "" # Default format (json, yaml, xml, junit, markdown)
showAlive: false # Show alive links in output
showWarnings: true # Show warnings (redirects, blocked)
showDead: true # Show dead links
showStats: false # Show performance statistics
# Ignore rules
ignore:
# Ignore entire domains (includes subdomains)
domains:
- localhost
- example.com
- staging.myapp.com
# Glob patterns
patterns:
- "*.local/*"
- "*/internal/*"
# Regular expressions
regex:
- ".*\\.(test|dev)%%CODEBLOCK11%%quot;
- "192\\.168\\..*"
| Type | Extensions | Description |
|---|---|---|
md | .md, .mdx, .markdown | Markdown files |
json | .json | JSON files |
yaml | .yaml, .yml | YAML files |
toml | .toml | TOML files |
xml | .xml | XML files |
CLI flags override config file settings:
# Override types from config
gone check --types=md,json
# Override concurrency
gone check --concurrency=100
# These ignore rules are combined with .gonerc.yaml settings
gone check --ignore-domain=api.example.com --ignore-pattern="*.internal/*"
gone check --format=json
# or
gone check --output=report.json
gone check --format=yaml
# or
gone check --output=report.yaml
gone check --output=report.junit.xml
gone check --format=markdown
# or
gone check --output=report.md
name: Check Links
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '0 0 * * 0' # Weekly
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Install gone
run: go install github.com/leonardomso/gone@latest
- name: Check links
run: gone check --output=report.junit.xml
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: link-report
path: report.junit.xml
| Code | Meaning |
|---|---|
0 | All links are alive (or only warnings) |
1 | Dead links or errors found |
2 | User quit interactive fix mode |
| Command | Description |
|---|---|
gone check [path] | Scan files and report dead links |
gone fix [path] | Find redirects and update URLs to final destinations |
gone interactive [path] | Launch terminal UI for interactive exploration |
gone completion [shell] | Generate shell autocompletion (bash, zsh, fish, powershell) |
gone help [command] | Show help for any command |
| Flag | Commands | Default | Description |
|---|---|---|---|
--types | check, fix, interactive | md | File types to scan (comma-separated) |
--strict | check, fix, interactive | false | Fail on malformed files |
-f, --format | check | β | Output format (json, yaml, xml, junit, markdown) |
-o, --output | check | β | Write report to file |
-a, --all | check | false | Show all results including alive |
-d, --dead | check | false | Show only dead links |
-w, --warnings | check | false | Show only warnings |
--alive | check | false | Show only alive links |
--show-ignored | check | false | Show ignored URLs |
--stats | check | false | Show performance statistics |
-y, --yes | fix | false | Apply fixes without prompting |
-n, --dry-run | fix | false | Preview changes only |
-c, --concurrency | check, fix | 50 | Concurrent workers |
-t, --timeout | check, fix | 5 | Request timeout (seconds) |
-r, --retries | check, fix | 1 | Retry attempts |
--ignore-domain | all | β | Domains to ignore |
--ignore-pattern | all | β | Glob patterns to ignore |
--ignore-regex | all | β | Regex patterns to ignore |
--no-config | all | false | Skip .gonerc.yaml |
-h, --help | all | β | Show help |
-v, --version | root | β | Show version |