girb-gemini
Google Gemini LLM provider for girb (AI-powered IRB assistant).
Installation
For Rails Projects
Add to your Gemfile:
group :development do
gem 'girb-gemini'
endThen run:
bundle installCreate a .girbrc file in your project root:
# .girbrc
require 'girb-gemini'
Girb.configure do |c|
c.provider = Girb::Providers::Gemini.new(
api_key: ENV['GEMINI_API_KEY'],
model: 'gemini-2.5-flash'
)
endNow rails console will automatically load girb!
For Non-Rails Projects
Install globally:
gem install girb girb-geminiCreate a .girbrc file in your project directory:
# .girbrc
require 'girb-gemini'
Girb.configure do |c|
c.provider = Girb::Providers::Gemini.new(
api_key: ENV['GEMINI_API_KEY'],
model: 'gemini-2.5-flash'
)
endThen use girb command instead of irb.
Configuration
Set your API key as an environment variable:
export GEMINI_API_KEY=your-api-keyAvailable Models
-
gemini-2.5-flash(default) - Fast and efficient -
gemini-2.5-pro- More capable, slower -
gemini-3-flash-preview- Next generation, fast -
gemini-3-pro-preview- Next generation, more capable
Web Search
girb-gemini includes a built-in web search tool powered by Google Search. This allows the AI to retrieve up-to-date information during your IRB session.
Web search is enabled by default. To disable it:
Girb.configure do |c|
c.provider = Girb::Providers::Gemini.new(
api_key: ENV['GEMINI_API_KEY'],
model: 'gemini-2.5-flash',
google_search: false
)
endAlternative: Environment Variable Configuration
For the girb command, you can also configure via environment variables (used when no .girbrc is found):
export GIRB_PROVIDER=girb-gemini
export GIRB_MODEL=gemini-2.5-flash # optional, defaults to gemini-2.5-flash
export GEMINI_API_KEY=your-api-key
girbLicense
MIT License