A fast, concurrent broken link checker for websites and sitemaps
Brokli (a play on "broken links") is a CLI tool that helps developers validate all links on a page or sitemap during development. It checks HTTP status codes concurrently and displays results with color-coded output, making it easy to spot broken links before deployment.
- 🚀 Concurrent Checking - Uses worker pools to check multiple links simultaneously (default: 10 workers)
- 🎨 Color-Coded Output - Green for success, red for errors, cyan for redirects
- 📊 Progress Indication - Real-time progress counter shows checking status
- 🎯 Smart Filtering - Shows only broken links by default to reduce noise
- 🔍 Verbose Mode - Optional flag to display all links with their status codes
- 🔄 GitHub Actions Integration - Native support with workflow annotations and step outputs
- ⚙️ Configurable - Adjust workers, timeouts, redirects, and user agent
- 🌐 Sitemap Support - Check entire sitemaps with metadata display
- 🧪 Well Tested - 94%+ test coverage with comprehensive test suite
The easiest way to install Brokli is to download a pre-built binary from the GitHub Releases page.
Linux / macOS:
# Download the latest release for your platform
# Replace VERSION, OS, and ARCH with appropriate values
# Example: brokli_0.1.0_linux_amd64.tar.gz
# Extract the archive
tar -xzf brokli_VERSION_OS_ARCH.tar.gz
# Move to your PATH
sudo mv brokli /usr/local/bin/
# Verify installation
brokli --versionWindows:
Download the .zip file for Windows from the releases page, extract it, and add the brokli.exe to your PATH.
# Clone the repository
git clone https://github.com/EndlessTrax/brokli.git
cd brokli
# Build the binary
go build -o brokli .
# Optionally, move to your PATH
sudo mv brokli /usr/local/bin/Check all links on a webpage and show only broken ones:
brokli check url https://example.comOutput:
Found 10 links
Checking links... 10/10
✓ All links are working!
Show all links with their status codes:
brokli check url https://example.com --output-format=verbose
# or use the short flag
brokli check url https://example.com -o verbose
# backward compatible with the old -v flag
brokli check url https://example.com -vOutput:
Found 10 links
Checking links... 10/10
All Links:
✓ 1. [200] Home -> https://example.com
✓ 2. [200] About -> https://example.com/about
→ 3. [301] Old Page -> https://example.com/redirect
✗ 4. [404] Missing -> https://example.com/missing
Summary: 1 broken link found out of 10 total
Brokli supports multiple output formats via the --output-format (or -o) flag:
default- Shows only broken links with color-coded status (default behavior)verbose- Shows all links with their status codesgithub- GitHub Actions compatible format with workflow annotations and step outputs
Examples:
# Default format (broken links only)
brokli check url https://example.com
# Verbose format (all links)
brokli check url https://example.com -o verbose
# GitHub Actions format
brokli check url https://example.com -o githubCheck all URLs in a sitemap:
brokli check sitemap https://example.com/sitemap.xmlOutput:
Found 70 URLs in sitemap
Checking URLs... 70/70
Broken URLs:
✗ 1. [404] https://example.com/old-page (modified: 2023-09-24T00:00:00+00:00)
✗ 2. [404] https://example.com/removed (modified: 2024-01-15T00:00:00+00:00)
Summary: 2 broken URLs found out of 70 total
Use Brokli in GitHub Actions CI/CD workflows with the --output-format=github flag:
brokli check url https://example.com --output-format=github
brokli check sitemap https://example.com/sitemap.xml --output-format=github
# Or use the short form
brokli check url https://example.com -o githubThis formats output specifically for GitHub Actions:
- Workflow Annotations: Broken links appear as errors in the GitHub Actions UI
- Step Outputs: Summary statistics are written to
GITHUB_OUTPUTfor use in downstream steps - Exit Code: Standard exit codes for CI integration
Example GitHub Actions Workflow:
name: Check Links
on: [push, pull_request]
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Brokli
run: |
curl -L https://github.com/EndlessTrax/brokli/releases/latest/download/brokli_linux_amd64.tar.gz | tar xz
sudo mv brokli /usr/local/bin/
- name: Check site links
id: check
run: brokli check url https://yoursite.com --output-format=github
continue-on-error: true
- name: Check results
run: |
echo "Total links: ${{ steps.check.outputs.total_links_count }}"
echo "Broken links: ${{ steps.check.outputs.broken_links_count }}"
if [ "${{ steps.check.outputs.has_broken_links }}" == "true" ]; then
echo "⚠️ Broken links found!"
exit 1
fiStep Outputs Available:
broken_links_count- Number of broken links foundtotal_links_count- Total number of links checkedhas_broken_links- Boolean (true/false) indicating if any broken links were found
- 🟢 Green
[200]- Success (2xx status codes) - 🔵 Cyan
[301]- Redirects (3xx status codes) - 🔴 Red
[404]- Client errors (4xx status codes) - 🔴 Bold Red
[500]- Server errors (5xx status codes) - 🟡 Yellow
[-1]- Unchecked/errors
Validate links on your local dev server before pushing:
brokli check url https://localhost:3000
brokli check sitemap https://localhost:3000/sitemap.xmlQuick validation before deploying to production:
# Check staging site
brokli check sitemap https://staging.example.com/sitemap.xml -vAutomate link checking in your GitHub Actions workflow:
# In GitHub Actions workflow
brokli check url https://example.com --output-format=githubSee the GitHub Actions Integration section for complete workflow examples.
- Configuration File Support -
.brokli.ymlfor persistent settings - Link Caching - Cache results to avoid re-checking unchanged links
- Export Formats - Output results to JSON, CSV, or Markdown
- Multi-Sitemap Processing - Check multiple sitemaps concurrently
- Go 1.24.0 or higher
- Task (optional, for running tasks)
Run all unit tests:
task test
# or
go test ./...Run tests with coverage:
task test-coverage
# or
go test -v -race -coverprofile=coverage.out ./...Format all Go code:
task fmt
# or
go fmt ./...Check formatting without making changes:
gofmt -s -l .Lint code using golangci-lint:
task ci-lint
# or
golangci-lint run ./...Before pushing, run all CI checks:
task ciThis runs:
- Tests with race detection
- Format check
- Linting
Build the project:
task build
# or
go build -o brokli .This creates a brokli binary in the current directory.
Contributions are welcome! Please read our Contributing Guide for details on:
- Development workflow and branch naming conventions
- Coding standards and architecture patterns
- Testing guidelines
- Pull request process
- Commit message conventions
This project is licensed under the MIT License - see the LICENSE file for details.