Automatic colored and styled output for ActiveRecord objects, relations, and collections.
The gem automatically formats ActiveRecord objects when displayed in the console:
# ActiveRecord objects
user = User.first
# Automatically displayed with colors and formatting
# Relations
User.where(active: true)
# Automatically formatted with pagination
# Collections
User.limit(10).to_a
# Automatically formatted with nice layout┌─────────────────────────────────────────────────────────┐
│ User #1 │
├─────────────────────────────────────────────────────────┤
│ id: 1 │
│ email: john@example.com │
│ name: John Doe │
│ active: true │
│ created_at: 2024-01-01 12:00:00 UTC │
│ updated_at: 2024-01-02 10:30:00 UTC │
└─────────────────────────────────────────────────────────┘
Large collections are automatically paginated:
# Collection with more than 10 items
User.all
# Shows: "Showing 1-10 of 1234 records. Press Enter for more..."
# Relations are paginated automatically
Post.where(published: true)
# Shows paginated resultsCustomize formatting in your initializer:
RailsConsolePro.configure do |config|
# Color scheme
config.color_scheme = :dark # or :light
# Pagination settings
config.pagination_enabled = true
config.pagination_threshold = 10
config.pagination_page_size = 5
# Custom colors
config.set_color(:header, :bright_blue)
config.set_color(:key, :cyan)
config.set_color(:value, :white)
end- ActiveRecord objects: Single records with all attributes
- ActiveRecord relations: Paginated collections
- Arrays: Formatted lists
- Command results: Schema, stats, explain, diff results
- Color Coding: Different colors for different data types
- Automatic Pagination: Large collections are paginated
- Clean Layout: Well-organized, readable output
- Dark/Light Themes: Choose your preferred color scheme