# phpman > man > ri(1)

> **TLDR:** Browse structured API documentation for Ruby.
>
- Start interactive shell:
  `ri`
- View documentation for a particular name:
  `ri {{File#read}}`
- List classes and modules for which `ri` has documentation:
  `ri {{-l|--list}}`

*Source: tldr-pages*

---

[RI(1)](https://www.chedong.com/phpMan.php/man/RI/1/markdown)                  Ruby Programmer's Reference Guide                 [RI(1)](https://www.chedong.com/phpMan.php/man/RI/1/markdown)

## NAME
     **ri** — Ruby API reference front end

## SYNOPSIS
     **ri** [**-ahilTv**] [**-d** _DIRNAME_] [**-f** _FORMAT_] [**-w** _WIDTH_] [**--**[**no-**]**pager**] [**--server**[=_PORT_]]
        [**--**[**no-**]**list-doc-dirs**] [**--no-standard-docs**] [**--**[**no-**]{**system**|**site**|**gems**|**home**}]
        [**--**[**no-**]**profile**] [**--dump**=_CACHE_] [_name_ _..._]

## DESCRIPTION
     **ri** is a command-line front end for the Ruby API reference.  You can search and read the API
     reference for classes and methods with **ri**.

     **ri** is a part of Ruby.

     _name_ can be:

           **Class** **|** **Module** **|** [**Module::Class**](https://www.chedong.com/phpMan.php/perldoc/Module%3A%3AClass/markdown)

           [**Class::method**](https://www.chedong.com/phpMan.php/perldoc/Class%3A%3Amethod/markdown) **|** **Class#method** **|** **Class.method** **|** **method**

           **gem**___**name:** **|** **gem**___**name:README** **|** **gem**___**name:History**

     All class names may be abbreviated to their minimum unambiguous form.  If a name is ambiguous,
     all valid options will be listed.

     A ‘.’ matches either class or instance methods, while #method matches only instance and
     ::method matches only class methods.

     README and other files may be displayed by prefixing them with the gem name they're contained
     in.  If the gem name is followed by a ‘:’ all files in the gem will be shown.  The file name
     extension may be omitted where it is unambiguous.

     For example:

           ri Fil
           ri File
           ri File.new
           ri zip
           ri rdoc:README

     Note that shell quoting or escaping may be required for method names containing punctuation:

           ri 'Array.[]'
           ri compact\!

     To see the default directories **ri** will search, run:

           ri --list-doc-dirs

     Specifying the **--system**, **--site**, **--home**, **--gems**, or **--doc-dir** options will limit **ri** to search‐
     ing only the specified directories.

     **ri** options may be set in the RI environment variable.

     The **ri** pager can be set with the RI_PAGER environment variable or the PAGER environment vari‐
     able.

## OPTIONS
### -i
     **--**[**no-**]**interactive**
                    In interactive mode you can repeatedly look up methods with autocomplete.

### -a
     **--**[**no-**]**all**     Show all documentation for a class or module.

### -l
     **--**[**no-**]**list**    List classes **ri** knows about.

     **--**[**no-**]**pager**   Send output to a pager, rather than directly to stdout.

### -T --no-pager

### -w
     **--width**=_WIDTH_  Set the width of the output.

     **--server**[=_PORT_]
                    Run RDoc server on the given port.  The default port is 8214.

### -f
     **--format**=_FORMAT_
                    Use the selected formatter.  The default formatter is bs for paged output and
                    ansi otherwise.  Valid formatters are: ansi, bs, markdown, rdoc.

### -h
     **--help**         Show help and exit.

### -v
     **--version**      Output version information and exit.

     Data source options:

     **--**[**no-**]**list-doc-dirs**
                    List the directories from which **ri** will source documentation on stdout and exit.

### -d
     **--doc-dir**=_DIRNAME_
                    List of directories from which to source documentation in addition to the stan‐
                    dard directories.  May be repeated.

### --no-standard-docs
                    Do not include documentation from the Ruby standard library, _site_lib_, installed
                    gems, or _~/.rdoc_.  Use with **--doc-dir**.

     **--**[**no-**]**system**  Include documentation from Ruby's standard library.  Defaults to true.

     **--**[**no-**]**site**    Include documentation from libraries installed in _site_lib_.  Defaults to true.

     **--**[**no-**]**gems**    Include documentation from RubyGems.  Defaults to true.

     **--**[**no-**]**home**    Include documentation stored in _~/.rdoc_.  Defaults to true.

     Debug options:

     **--**[**no-**]**profile**
                    Run with the Ruby profiler.

     **--dump**=_CACHE_   Dump data from an ri cache or data file.

## ENVIRONMENT
     RI           Options to prepend to those specified on the command-line.

     RI_PAGER
     PAGER        Pager program to use for displaying.

     HOME
     USERPROFILE
     HOMEPATH     Path to the user's home directory.

## FILES
     ~/.rdoc      Path for ri data in the user's home directory.

## SEE ALSO
     [ruby(1)](https://www.chedong.com/phpMan.php/man/ruby/1/markdown), [rdoc(1)](https://www.chedong.com/phpMan.php/man/rdoc/1/markdown), [gem(1)](https://www.chedong.com/phpMan.php/man/gem/1/markdown)

## REPORTING BUGS
     ••   Security vulnerabilities should be reported via an email to <_security@ruby-lang.org_>.  Re‐
         ported problems will be published after being fixed.

     ••   Other bugs and feature requests can be reported via the Ruby Issue Tracking System
         (**<https://bugs.ruby-lang.org/>**). Do not report security vulnerabilities via this system be‐
         cause it publishes the vulnerabilities immediately.

## AUTHORS
     Written by Dave Thomas <<dave@pragmaticprogrammer.com>>.

UNIX                            April 20, 2017                            UNIX
