A long-lived project that still receives updates
Rails Console Pro enhances your Rails console with powerful debugging tools: - Beautiful colored formatting for ActiveRecord objects - Schema inspection with columns, indexes, associations, validations - SQL explain analysis with performance recommendations - Interactive association navigation - Model statistics (record counts, growth rates, table sizes) - Object diffing and comparison - Export to JSON, YAML, and HTML - Smart pagination for large collections
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.0
~> 6.0
~> 13.0
~> 3.12
~> 1.4

Runtime

~> 0.8.0
>= 0.14.0, < 0.16.0
~> 0.6.0
 Project Readme

Rails Console Pro

Gem Version Build Status

Enhanced Rails console with powerful debugging tools and beautiful formatting.

Rails Console Pro transforms your Rails console into a powerful debugging environment with schema inspection, SQL analysis, association navigation, and beautiful colored output.

โœจ Features

  • ๐ŸŽจ Beautiful Formatting - Colored, styled output for ActiveRecord objects, relations, and collections
  • ๐Ÿ“Š Schema Inspection - Inspect database schemas with columns, indexes, associations, validations, and scopes
  • ๐Ÿ” SQL Explain - Analyze query execution plans with performance recommendations
  • ๐Ÿงญ Association Navigator - Interactive navigation through model associations
  • ๐Ÿ“ˆ Model Statistics - Record counts, growth rates, table sizes, and index usage
  • ๐Ÿ”ฌ Adaptive Profiling - Profile blocks or relations with query, cache, and performance metrics
  • ๐Ÿงต ActiveJob Insights - Inspect and manage queues across adapters (Sidekiq, SolidQueue, Test, Async) with filters and inline actions
  • ๐Ÿ”„ Object Diffing - Compare ActiveRecord objects and highlight differences
  • ๐Ÿ” Model Introspection - Deep dive into callbacks, enums, concerns, scopes, validations, and method sources
  • โš–๏ธ Query Comparison - Compare multiple query strategies side-by-side to find optimal approaches
  • ๐Ÿ”ง Query Builder - Interactive DSL for building and analyzing ActiveRecord queries
  • ๐Ÿ’พ Export Capabilities - Export to JSON, YAML, and HTML formats
  • ๐Ÿ“„ Smart Pagination - Automatic pagination for large collections
  • ๐Ÿ“ Snippet Library - Capture, search, and reuse console snippets across sessions

๐Ÿš€ Installation

Add this line to your application's Gemfile:

gem 'rails_console_pro'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install rails_console_pro

๐Ÿ“– Usage

The gem automatically loads when you start your Rails console. No additional setup required!

Quick Examples

# Schema inspection
schema User

# SQL explain
explain User.where(active: true)

# Model statistics
stats User

# Association navigation
navigate User

# Object diffing
diff user1, user2

# Export
export schema(User) user_schema.json

# Profiling
profile('Load users') { User.active.includes(:posts).limit(10).to_a }

# Queue insights
jobs(limit: 10, queue: 'mailers')
jobs status=retry class=ReminderJob
jobs retry=abcdef123456
jobs details=abcdef123456

# Model introspection
introspect User
introspect User, :callbacks
introspect User, :enums
introspect User, :method_name  # Find where method is defined

# Query comparison
compare do |c|
  c.run("Eager loading") { User.includes(:posts).to_a }
  c.run("N+1") { User.all.map(&:posts) }
end

# Query builder
query User do
  where(active: true)
  includes(:posts)
  order(:created_at)
  limit(10)
end.analyze  # Shows SQL + explain

See QUICK_START.md for more examples and detailed documentation for each feature.

โš™๏ธ Configuration

Configure Rails Console Pro in an initializer:

# config/initializers/rails_console_pro.rb
RailsConsolePro.configure do |config|
  # Enable/disable features
  config.enabled = true
  config.schema_command_enabled = true
  config.explain_command_enabled = true
  config.stats_command_enabled = true
  config.queue_command_enabled = true
  config.compare_command_enabled = true
  config.query_builder_command_enabled = true
  
  # Color scheme
  config.color_scheme = :dark  # or :light
  
  # Customize colors
  config.set_color(:header, :bright_blue)
  
  # Pagination
  config.pagination_enabled = true
  config.pagination_threshold = 10
  config.pagination_page_size = 5
end

๐ŸŽฏ Requirements

  • Ruby >= 3.0.0
  • Rails >= 6.0
  • Pry >= 0.14.0 (recommended)

๐Ÿ“š Documentation

๐Ÿค Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/harshumaretiya/rails_console_pro.

๐Ÿ“ License

The gem is available as open source under the terms of the MIT License.

๐Ÿ™ Acknowledgments

  • Inspired by awesome_print, hirb, and other console enhancement gems
  • Built with love for the Rails community