0.0
No release in over 3 years
Google Gemini LLM provider for girb (AI-powered IRB assistant). Install this gem to use Gemini as your LLM backend.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

girb-gemini

Google Gemini LLM provider for girb (AI-powered IRB assistant).

日本語版 README

Installation

For Rails Projects

Add to your Gemfile:

group :development do
  gem 'girb-gemini'
end

Then run:

bundle install

Create 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'
  )
end

Now rails console will automatically load girb!

For Non-Rails Projects

Install globally:

gem install girb girb-gemini

Create 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'
  )
end

Then use girb command instead of irb.

Configuration

Set your API key as an environment variable:

export GEMINI_API_KEY=your-api-key

Available 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
  )
end

Alternative: 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
girb

License

MIT License