Docopt is a utility library for R that allows programmers to define command line interfaces through documentation strings. It parses command line options, arguments, switches and help messages based on usage patterns defined in the documentation. This avoids having to write complex command line parsing code. The documentation string is the specification, and docopt handles generating a fully functioning parser from it. It provides an elegant way to build command line tools in R with automatically generated help and argument handling.