Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



48 Commits

Repository files navigation

Build Status Gem Version


annotate-gem is command line tool that will add useful comments to your Gemfile. For each gem, annotate-gem will create a comment with the gem's description and the gem's website. For example, a Gemfile containing the following

gem "rails"
gem "nokogiri"
gem "brakeman"

will be converted into something that is more descriptive and is self-documenting:

# Full-stack web application framework. (
gem "rails"
# Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser
gem "nokogiri"
# Security vulnerability scanner for Ruby on Rails. (
gem "brakeman"

The motivation for annotate-gem is that developers often open a Gemfile and not know what many of the listed gems are actually for. It's hard to track down which gem is providing which functionality. This is a common problem since many gem names do not reflect the actual feature.

If you do not want to install the gem, you can also visit which is a web interface for annotate-gem.


$ gem install annotate_gem


Running annotate-gem itself will add comments to the current directory's Gemfile.

$ cat Gemfile
source ''
gem "pry"
$ annotate-gem
$ cat Gemfile
source ''
# An IRB alternative and runtime developer console (
gem "pry"

annotate-gem has several options:

$ annotate_gem --help
  Add comments to your Gemfile with each dependency's description.
        Usage: annotate_gem [options]
               annotate_gem [gem name]
        --website-only               Only output the website
        --description-only           Only output the description
        --new-comments-only          Only add a comment to gemfile if there isn't a comment already (for non-inline comments)
        --inline                     Inline the comment
    -h, --help                       Show this message
    -v, --version                    Show version

annotate-gem also works with specifying a single gem name:

$ annotate-gem aasm
State machine mixin for Ruby objects (


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


🌲 Add comments to your Gemfile with each dependency's description







No packages published