Ruby Shell
Clone or download


Verify links in awesome projects

Build Status Tests Gem Version

awesome_bot checks for valid URLs in a file, it can be used to verify pull requests updating a README.


$ gem install awesome_bot


Command Line

Usage: awesome_bot [file or files]
       awesome_bot [options]
    -f, --files [files]              Comma separated files to check
    -a, --allow [errors]             Status code errors to allow
        --allow-dupe                 Duplicate URLs are allowed
        --allow-ssl                  SSL errors are allowed
        --allow-redirect             Redirected URLs are allowed
        --allow-timeout              URLs that time out are allowed
        --base-url [base url]        Base URL to use for relative links
    -d, --request-delay [seconds]    Set request delay
    -t, --set-timeout [seconds]      Set connection timeout
        --skip-save-results          Skip saving results
    -w, --white-list [urls]          Comma separated URLs to white list
  • You can check multiple files (comma separated or * pattern, look below for details).

  • By default, duplicate URLs or any status code other than 200 are flagged as failures.

    • Use option --allow-dupe to allow duplicates.
    • Use option --allow-redirect to allow redirects.
    • Use option --allow to allow specific status code errors.
    • Use option --white-list (-w for short) to prevent links from being flagged: -w, white lists and all links matching


$ awesome_bot
> Checking links in
Links found: 56, 37 unique
# ...
  Checking URLs: ✓✓✓→?✓→✓→→✓✓→✓✓✓→✓✓✓✓✓✓✓✓✓✓✓→✓✓✓✓✓→✓✓

Issues :-(
> Links
  1. [L007] 301 →
  2. [L008] 302 →
# ...
> Dupes
  1. [L03]
  2. [L05]
# ...
$ awesome_bot --allow-dupe --allow-redirect -w rubydoc,giphy
# allow redirects, dupes and white list all links matching rubydoc and giphy

$ awesome_bot,
# check links in 2 files

$ awesome_bot docs/*.md
# check all markdown files in docs/ directory

$ awesome_bot --allow-timeout -t 5
# speed up validation by setting a timeout of 5 seconds per link request and allowing timeouts

$ awesome_bot --allow 403,429
# allow status code errors 403 and 429
# --allow 301 would be similar to --allow-redirect

$ awesome_bot --base-url
# will check relative links using the base url provided
(master) $ git branch
* master
(master) $ git checkout -b new-branch
Switched to a new branch 'new-branch'
(new-branch) $ touch && echo '' >>
(new-branch) $ git add
(new-branch) $ git commit -m 'Testing'
[new-branch ef47336] Testing
 1 file changed, 1 insertion(+)
 create mode 100644
(new-branch) $ git diff master.. --name-only | grep '.md' | xargs awesome_bot
> Checking links in
Links to check: 1
Checking URLs: ✓
No issues :-)

Wrote results to

Docker Examples

If you do not want to install Ruby or it's dependencies you can simply use Docker and Docker image.

Here is the example how you can check the links in your current directory+subdirectories markdown files:

docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --white-list "" --allow-dupe --allow-redirect --skip-save-results `find . -name "*.md"`

or check links in just in a single file located in ./templates/

docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --allow-dupe --allow-redirect --skip-save-results ./templates/

You always need to specify the path to the file so you can not use simply *.md but ls *.md":

docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --white-list "" --allow-dupe --allow-redirect --skip-save-results `ls *.md`


irb(main):001:0> require 'awesome_bot'
=> true
irb(main):002:0> content = ''
=> "..."
irb(main):003:0> result = AwesomeBot.check content
=> #<AwesomeBot::Result:0x007fdde39f4408 @links=...>
# AwesomeBot Result with success, statuses_issues, dupes and more
irb(main):004:0> puts result.success ? 'No errors' : ':-('

More information at rubydoc.

Validate Pull Requests

Does your GitHub README contain a lot of links? awesome_bot can help you validate them when a pull request is created (or a commit is pushed). It is used by:

and more.


  • Use the keyword [ci skip] in your commit title/message to skip verification.
  • Use Danger.

Travis CI

To use awesome_bot with Travis CI, connect your repo and create a .travis.yml file.

language: ruby
rvm: 2.4.1
before_script: gem install awesome_bot
script: awesome_bot

To turn off email notifications, add the lines below

  email: false

In case you want to use the docker image inside Travis CI follow this example which will check broken links in all *.md files in your repository:

sudo: required

  - docker

  # Link Checks
  - docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --allow-dupe --allow-redirect --skip-save-results `find . -name "*.md"`


If you prefer CircleCI, it'll work too. Connect your repo and create a circle.yml file.

    version: 2.4.1
    - gem install awesome_bot
    - awesome_bot


CircleCI, Codeship, and Semaphore CI support running tests without adding a file to the repo (a public configuration file can however help others contribute).

# Codeship
rvm use 2.4.1 --install
gem install awesome_bot

# Semaphore CI
Language: Ruby
Ruby version: 2.4.1
Databases for: don't generate
gem install awesome_bot

Status Badge

Build Status

To add the Travis CI build status badge above to your project, use the following code

[![Build Status](<username>/<project>.svg)](<username>/<project>)

[![Build Status](](

As it happens, the default code snippet provided contain a redirect so adding a badge could fail your status 😭.. one way to fix this is to white list travis-ci, i.e.

- awesome_bot --white-list travis-ci

You can also add a badge for other CI tools, check out


Integrate awesome_bot with Danger and have results reported back to the pull request).


Here's the step in your Dangerfile:

# Check links
require 'json'
results = ''
j = JSON.parse results
if j['error']==true
  fail j['title']
  markdown j['message']



This project is available under the MIT license. See the LICENSE file for more info.