{"id":19311584,"url":"https://github.com/rednafi/link-patrol","last_synced_at":"2025-09-17T09:31:11.213Z","repository":{"id":218154447,"uuid":"744188528","full_name":"rednafi/link-patrol","owner":"rednafi","description":"Detect dead links in markdown files","archived":false,"fork":false,"pushed_at":"2025-01-06T15:57:59.000Z","size":989,"stargazers_count":24,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-06T16:53:28.156Z","etag":null,"topics":["cli","golang","markdown","url-checker"],"latest_commit_sha":null,"homepage":"https://github.com/rednafi/link-patrol","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rednafi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-16T19:46:31.000Z","updated_at":"2025-01-06T15:57:56.000Z","dependencies_parsed_at":"2024-03-04T17:44:47.895Z","dependency_job_id":"86947c08-5e74-4a17-a684-feb3e63c8208","html_url":"https://github.com/rednafi/link-patrol","commit_stats":null,"previous_names":["rednafi/link-patrol"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Flink-patrol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Flink-patrol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Flink-patrol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Flink-patrol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rednafi","download_url":"https://codeload.github.com/rednafi/link-patrol/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233359433,"owners_count":18664329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","golang","markdown","url-checker"],"created_at":"2024-11-10T00:29:27.501Z","updated_at":"2025-09-17T09:31:05.952Z","avatar_url":"https://github.com/rednafi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cpre align=\"center\"\u003e\n\u003ch1 align=\"center\"\u003e\n;; link-patrol ;;\n\u003c/h1\u003e\n\u003ch4 align=\"center\"\u003e\nDetect dead links in markdown files\n\u003c/h4\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\n## Installation\n\n-   On MacOS, brew install:\n\n    ```sh\n    brew tap rednafi/link-patrol https://github.com/rednafi/link-patrol \\\n       \u0026\u0026 brew install link-patrol\n    ```\n\n-   Or elsewhere, go install:\n\n    ```sh\n    go install github.com/rednafi/link-patrol/cmd/link-patrol\n    ```\n\n## Quickstart\n\n### Usage\n\n```sh\nlink-patrol -h\n```\n\n```txt\nNAME:\n   Link patrol - detect dead links in markdown files\n\nUSAGE:\n   link-patrol [global options] command [command options]\n\nVERSION:\n   0.6\n\nCOMMANDS:\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --filepath value, -f value  path to the markdown file\n   --timeout value, -t value   timeout for each HTTP request (default: 5s)\n   --error-ok, -e              always exit with code 0 (default: false)\n   --json, -j                  output as JSON (default: false)\n   --max-retries value         maximum number of retries for each URL (default: 1)\n   --start-backoff value       initial backoff duration for retries (default: 1s)\n   --max-backoff value         maximum backoff duration for retries (default: 4s)\n   --help, -h                  show help\n   --version, -v               print the version\n```\n\n### List URL status\n\nHere's the content of a sample markdown file:\n\n```md\nThis is an [embedded](https://example.com) URL.\n\nThis is a [reference style] URL.\n\nThis is a footnote[^1] URL.\n\n[reference style]: https://reference.com\n[^1]: https://gen.xyz/\n```\n\nRun the following command to list the URL status with a 2 second timeout for each request:\n\n```sh\nlink-patrol -f examples/sample_1.md -t 2s\n```\n\nBy default, it'll exit with a non-zero code if any of the URLs is invalid or unreachable.\nHere's how the output looks:\n\n```txt\nFilepath: examples/sample_1.md\n\n- Location   : https://reference.com\n  Status Code: 403\n  OK         : false\n  Message    : Forbidden\n  Attempt    : 1\n\n- Location   : https://example.com\n  Status Code: 200\n  OK         : true\n  Message    : OK\n  Attempt    : 1\n\n- Location   : https://gen.xyz/\n  Status Code: 200\n  OK         : true\n  Message    : OK\n  Attempt    : 1\n\n2024/02/03 05:24:43 one or more URLs have error status codes\nexit status 1\n```\n\n### Ignore errors\n\nSet the `--error-ok / -e` flag to force the CLI to always exit with code 0:\n\n```sh\nlink-patrol -f examples/sample_1.md -e\n```\n\n### Print as JSON\n\nUse the `--json / -j` flag to format the output as JSON:\n\n```sh\nlink-patrol -f examples/sample_2.md -t 5s --json | jq\n```\n\n```json\n{\n  \"location\": \"https://referencestyle.com\",\n  \"statusCode\": 0,\n  \"ok\": false,\n  \"message\": \"... no such host\"\n}\n{\n  \"location\": \"https://example.com\",\n  \"statusCode\": 200,\n  \"ok\": true,\n  \"message\": \"OK\"\n}\n{\n  \"location\": \"https://example.com/image.jpg\",\n  \"statusCode\": 404,\n  \"ok\": false,\n  \"message\": \"Not Found\"\n}\n```\n\n### Retry with random jitters\n\nUse the `--max-retries`, `--start-backoff`, and `--max-backoff` to configure auto retries:\n\n```sh\nlink-patrol -f examples/sample_1.md -t 1s --max-retries 3 --max-backoff 3s\n```\n\n```txt\nFilepath: examples/sample_1.md\n\n- Location   : https://example.com\n  Status Code: 200\n  OK         : true\n  Message    : OK\n  Attempt    : 1\n\n- Location   : https://gen.xyz/\n  Status Code: 200\n  OK         : true\n  Message    : OK\n  Attempt    : 2\n\n- Location   : https://reference.com\n  Status Code: 403\n  OK         : false\n  Message    : Forbidden\n  Attempt    : 3\n\n2024/02/03 05:23:21 one or more URLs have error status codes\nexit status 1\n```\n\n### Check multiple files\n\nDo some shell-fu:\n\n```sh\nfind examples -name '*.md' -exec link-patrol -f {} -t 4s -e \\;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frednafi%2Flink-patrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frednafi%2Flink-patrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frednafi%2Flink-patrol/lists"}