{"id":16431983,"url":"https://github.com/davidcelis/rack-console","last_synced_at":"2026-03-09T19:14:08.099Z","repository":{"id":56890075,"uuid":"21394154","full_name":"davidcelis/rack-console","owner":"davidcelis","description":"💻 `rails console` for your Rack applications","archived":false,"fork":false,"pushed_at":"2024-05-30T16:27:12.000Z","size":34,"stargazers_count":27,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-28T09:59:42.313Z","etag":null,"topics":["cli","console","irb","pry","rack","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidcelis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-01T16:09:16.000Z","updated_at":"2024-05-30T16:02:59.000Z","dependencies_parsed_at":"2024-06-19T15:00:05.676Z","dependency_job_id":"185a62de-4d4b-478d-acbb-1d2d4c73c137","html_url":"https://github.com/davidcelis/rack-console","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.0625,"last_synced_commit":"564045fc5a6f564143065d6ab5c1d402b484e38f"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/davidcelis/rack-console","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Frack-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Frack-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Frack-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Frack-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidcelis","download_url":"https://codeload.github.com/davidcelis/rack-console/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Frack-console/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269109637,"owners_count":24361333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","console","irb","pry","rack","ruby"],"created_at":"2024-10-11T08:35:20.017Z","updated_at":"2026-03-09T19:14:03.043Z","avatar_url":"https://github.com/davidcelis.png","language":"Ruby","readme":"# Rack::Console [![Build Status](https://travis-ci.org/davidcelis/rack-console.svg?branch=master)](https://travis-ci.org/davidcelis/rack-console)\n\nFind yourself missing a `rails console` analogue in your other Ruby web applications? This lightweight gem provides a Rack::Console class that will load your Rack application's code and environment into an IRB or Pry session. Either use `Rack::Console.new.start` directly, or run the provided `rack-console` executable.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rack-console'\n```\n\nAnd then execute:\n\n```bash\n$ bundle install\n```\n\nOr install it system-wide:\n\n```bash\n$ gem install rack-console\n```\n\n## Usage\n\nRack::Console ships with a `rack-console` executable that will load your application in an IRB shell (or\n[Pry](http://pryrepl.org) if that's included in your Gemfile). Assuming you have a `config.ru` file in the current directory, simply run:\n\n```ruby\n$ bundle exec rack-console\npry(main)\u003e\n```\n\nRack::Console supports some of the same things that `rails console` provides, as well as arguments used in `rackup`:\n\n * An `app` method that will return your underlying Rack application with [rack-test](https://github.com/brynary/rack-test) methods mixed in. You can perform fake requests to your app (e.g. `response = app.get('/')`)\n * Supply the RACK_ENV as an argument (`bundle exec rack-console production`)\n * A `reload!` method to discard new code or defined variables/constants\n * The `-c` option (or `--config`) to specify a non-standard `config.ru` file\n * The `-r` option (or `--require`) to require a file/library before Rack::Console loads\n * The `-I` option (or `--include`) to specify paths (colon-separated) to add to `$LOAD_PATH` before Rack::Console loads\n\n## Framework CLI Example\n\nBecause Rack::Console is just a class, it's easy to provide a `console` subcommand to a CLI for your own Rack framework. For example, here's how you could hypothetically implement a `console` subcommand for a generic Rack CLI using [Thor](https://github.com/erikhuda/thor):\n\n```ruby\nrequire 'rack/console'\nrequire 'thor'\n\nmodule Rack\n  class CLI \u003c Thor\n    desc 'console [ENVIRONMENT]', 'Start a Rack console'\n\n    method_option :config,  aliases: '-c', type: 'string',\n                            desc: 'Specify a Rackup file (default: config.ru)'\n    method_option :require, aliases: '-r', type: 'string',\n                            desc: 'Require a file/library before console boots'\n    method_option :include, aliases: '-I', type: 'string',\n                            desc: 'Add colon-separated paths to $LOAD_PATH'\n\n    def console\n      # Set a custom intro message:\n      #   ENV['RACK_CONSOLE_INTRO'] = 'Loading Rack::Console...'\n      #\n      # Or, to prevent an intro message from being printed at all:\n      #   ENV['IGNORE_RACK_CONSOLE_INTRO'] = 'true'\n      Rack::Console.new(options).start\n    end\n  end\nend\n\nRack::CLI.start(ARGV)\n```\n\n## Contributing\n\n1. [Fork it](https://github.com/davidcelis/rack-console/fork)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. [Create a new Pull Request](https://github.com/davidcelis/rack-console/compare)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcelis%2Frack-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidcelis%2Frack-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcelis%2Frack-console/lists"}