πŸ“¦ leonardomso / gone

Fast, concurrent dead link detector for files.

β˜… 0 stars β‘‚ 0 forks πŸ‘ 0 watching βš–οΈ MIT License
broken-linksciclidead-linksdeveloper-toolsdocumentationgogolanggolang-librarylint-checkermarkdownterminaltui
πŸ“₯ Clone https://github.com/leonardomso/gone.git
HTTPS git clone https://github.com/leonardomso/gone.git
SSH git clone git@github.com:leonardomso/gone.git
CLI gh repo clone leonardomso/gone
Leonardo Maldonado Leonardo Maldonado Merge pull request #10 from leonardomso/release-please--branches--master 16e7fe5 16 days ago πŸ“ History
πŸ“‚ master View all commits β†’
πŸ“ .github
πŸ“ cmd
πŸ“ examples
πŸ“ internal
πŸ“„ .gitignore
πŸ“„ .golangci.yml
πŸ“„ .goreleaser.yaml
πŸ“„ AGENTS.md
πŸ“„ CHANGELOG.md
πŸ“„ github-image.png
πŸ“„ go.mod
πŸ“„ go.sum
πŸ“„ LICENSE
πŸ“„ main.go
πŸ“„ opencode.jsonc
πŸ“„ README.md
πŸ“„ README.md

gone

Fast, concurrent dead link detector for documentation files.

Test Lint Go Report Card License: MIT

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.

gone

Here's a list of powerful features:

  • Fast concurrent checking. Check hundreds of URLs at the same time. Configure the number of workers based on your network. Large documentation sites take seconds, not minutes.
  • Interactive terminal UI. Watch progress in real-time. Navigate results with vim-style keys, filter by status, and explore issues without leaving your terminal. It's like htop for your links.
  • Automatic redirect fixing. Found a redirect? 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.
  • Smart deduplication. Same URL in 50 files? It gets checked once. Results map back to every occurrence. Less waiting, fewer rate limits.
  • Flexible ignore rules. Skip localhost, staging environments, or that one URL that's always flaky. Use domains, glob patterns, or regex. Set them in .gonerc.yaml or pass them as flags.
  • Multiple output formats. JSON, YAML, XML, JUnit, Markdownβ€”pick your favorite. The format is auto-detected from the file extension, or set it explicitly with --format.
  • Multi-format support. Scan Markdown, JSON, YAML, TOML, and XML files. Markdown parsing is format-aware: finds links in [text](url), reference-style [text][ref], autolinks <url>, and HTML <a> tags while skipping code blocks.
  • CI/CD friendly. Exit code 0 means all good. Exit code 1 means dead links. JUnit output works with GitHub Actions, GitLab CI, Jenkins, and everything else.

Table of Contents

Installation

Go Install

go install github.com/leonardomso/gone@latest

Homebrew

brew install leonardomso/tap/gone

Build from Source

git clone https://github.com/leonardomso/gone.git
cd gone
go build

Download Binary

Download the latest release from the GitHub Releases page.

Quick Start

# 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

Commands

gone check

Scan files for dead links.

gone check [path] [flags]

Flags:

FlagShortDefaultDescription
--types-TmdFile types to scan (comma-separated): md, json, yaml, toml, xml
--strictβ€”falseFail 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-afalseShow all results including alive links
--dead-dfalseShow only dead links and errors
--warnings-wfalseShow only warnings (redirects, blocked)
--aliveβ€”falseShow only alive links
--concurrency-c50Number of concurrent workers
--timeout-t5Timeout per request in seconds
--retries-r1Number 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β€”falseShow which URLs were ignored
--no-configβ€”falseSkip loading .gonerc.yaml
--statsβ€”falseShow performance statistics
Link Status Types:

StatusDescription
AliveLink returned a 2xx response. All good.
RedirectLink redirected (301, 302, 307, 308) but final destination is alive. Consider updating to the final URL.
BlockedServer returned 403. Might be bot detection. Link may still work in a browser.
DeadLink is broken (4xx, 5xx, or redirect chain ends in error).
ErrorNetwork error: timeout, DNS failure, or connection refused.
DuplicateSame URL appears multiple times. Checked once, result shared.
Examples:

# 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 interactive

Launch an interactive terminal UI with real-time progress.

gone interactive [path] [flags]

Flags:

FlagShortDefaultDescription
--types-TmdFile types to scan (comma-separated): md, json, yaml, toml, xml
--strictβ€”falseFail 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β€”falseSkip loading .gonerc.yaml
Controls:

KeyAction
↑ / kMove up
↓ / jMove down
PgUp / Ctrl+UPage up
PgDn / Ctrl+DPage down
g / HomeGo to start
G / EndGo to end
fCycle filter (All β†’ Warnings β†’ Dead β†’ Duplicates)
?Toggle help
q / Ctrl+CQuit

gone fix

Automatically fix redirect URLs in files.

gone fix [path] [flags]

Flags:

FlagShortDefaultDescription
--types-TmdFile types to scan (comma-separated): md, json, yaml, toml, xml
--strictβ€”falseFail on malformed files instead of skipping them
--yes-yfalseApply all fixes without prompting
--dry-run-nfalsePreview changes without modifying files
--concurrency-c50Number of concurrent workers
--timeout-t5Timeout per request in seconds
--retries-r1Number of retries for failed requests
--ignore-domainβ€”β€”Domains to ignore
--ignore-patternβ€”β€”Glob patterns to ignore
--ignore-regexβ€”β€”Regex patterns to ignore
--no-configβ€”falseSkip loading .gonerc.yaml
--statsβ€”falseShow performance statistics
Examples:

# 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 completion

Generate shell autocompletion scripts.

gone completion [shell]

Supported Shells:

ShellCommand
Bashgone completion bash
Zshgone completion zsh
Fishgone completion fish
PowerShellgone completion powershell
Setup Examples:

# Bash (add to ~/.bashrc)
source <(gone completion bash)

# Zsh (add to ~/.zshrc)
source <(gone completion zsh)

# Fish
gone completion fish | source

Configuration

Config File

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\\..*"

Supported File Types

TypeExtensionsDescription
md.md, .mdx, .markdownMarkdown files
json.jsonJSON files
yaml.yaml, .ymlYAML files
toml.tomlTOML files
xml.xmlXML files

CLI Flags

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/*"

Output Formats

JSON

gone check --format=json
# or
gone check --output=report.json

YAML

gone check --format=yaml
# or
gone check --output=report.yaml

JUnit XML (for CI/CD)

gone check --output=report.junit.xml

Markdown

gone check --format=markdown
# or
gone check --output=report.md

CI/CD Integration

GitHub Actions

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

Exit Codes

CodeMeaning
0All links are alive (or only warnings)
1Dead links or errors found
2User quit interactive fix mode

Reference

Commands Overview

CommandDescription
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

Flags Reference

FlagCommandsDefaultDescription
--typescheck, fix, interactivemdFile types to scan (comma-separated)
--strictcheck, fix, interactivefalseFail on malformed files
-f, --formatcheckβ€”Output format (json, yaml, xml, junit, markdown)
-o, --outputcheckβ€”Write report to file
-a, --allcheckfalseShow all results including alive
-d, --deadcheckfalseShow only dead links
-w, --warningscheckfalseShow only warnings
--alivecheckfalseShow only alive links
--show-ignoredcheckfalseShow ignored URLs
--statscheckfalseShow performance statistics
-y, --yesfixfalseApply fixes without prompting
-n, --dry-runfixfalsePreview changes only
-c, --concurrencycheck, fix50Concurrent workers
-t, --timeoutcheck, fix5Request timeout (seconds)
-r, --retriescheck, fix1Retry attempts
--ignore-domainallβ€”Domains to ignore
--ignore-patternallβ€”Glob patterns to ignore
--ignore-regexallβ€”Regex patterns to ignore
--no-configallfalseSkip .gonerc.yaml
-h, --helpallβ€”Show help
-v, --versionrootβ€”Show version

License

MIT