Project

rich-ri

0.0
The project is in a healthy, maintained state
A terminal reader for Ruby's RI documentation with semantic colors, Ruby syntax highlighting, shell transcript recognition and dynamic shell completion. Uses the documentation installed for your active Ruby and gems.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 0.2
~> 1.0
~> 5.2
~> 8.1
~> 0.0.4
~> 0.6
~> 0.4
 Project Readme

rich-ri

Read Ruby documentation with highlighted code, clear headings and colored references. rich-ri wraps Ruby's RI reader and uses the documentation already installed for your Ruby and gems.

The complete Object#then page: ri -f ansi on the left, rich-ri on the right, with highlighted Ruby method chains, strings, constants and symbols.

The same page in ri -f ansi and rich-ri, using the same terminal palette. rich-ri adds Ruby syntax highlighting and keeps heading markers searchable. Image details.

Install and read

Requires Ruby 3.4 or later on Linux or macOS.

gem install rich-ri

Read a method:

rich-ri Array#map
rich-ri String#scan

RDoc, which provides RI, is installed as a gem dependency. If a page is missing, see documentation sources.

Run rich-ri without a name for interactive lookup. Press Tab to discover classes and methods; enter an empty line to leave. You can also enable shell completion for Bash, Zsh or Fish, and use ri as an alias.

Find your way around

Names follow RI conventions: Array#map is an instance method; File::open is a class method. Class.method searches both kinds.

rich-ri Hash
rich-ri --all Array
rich-ri ruby:syntax/pattern_matching
rich-ri --help

In less, use / to search, n for the next match and q to quit. Search for ^=== to jump between level-three headings. rich-ri --man opens the full manual.

Choose your colors

The default colors follow your terminal palette. Ruby highlighting is built in; installing bat also highlights shell examples and other tagged languages.

rich-ri --theme=light Regexp
rich-ri --style='comment=bright_black' String#scan
rich-ri --no-color Array#map

Save preferences in ~/.config/rich-ri/config.yml:

theme: terminal
styles:
  method: cyan
  comment: bright_black

The configuration reference covers themes, individual styles, pager settings and environment variables. rich-ri --show-config prints your effective settings.

More

Questions and bug reports are welcome in GitHub issues. Released under the MIT license.