You are currently viewing Unleash the Power of Gemini 2.5 Pro in Your Terminal with Open AI Codeex! (gemini + open Ai codex)

Unleash the Power of Gemini 2.5 Pro in Your Terminal with Open AI Codeex! (gemini + open Ai codex)

The world of AI-powered coding just got a whole lot more exciting! OpenAI recently unveiled an enhanced version of Codeex, a fantastic command-line interface (CLI) tool designed to help you write code directly within your terminal. What makes this even more thrilling is that Codeex is open source, inviting developers to dive into its core and tailor it to their specific needs.

Enter Why Michael, a developer who took this open nature to heart. He ingeniously modified Codeex to support a multitude of AI model providers, going beyond just OpenAI. This pivotal change means you can now harness the power of cutting-edge models like Gemini 2.5 Pro right in your terminal!

For those unfamiliar, Gemini 2.5 Pro is currently reigning supreme on the Chat LLM Arena leaderboard, a widely respected benchmark for evaluating AI models. Its capabilities are truly remarkable. In fact, as the video highlights, Gemini 2.5 Pro was the only model capable of flawlessly replicating a Mac application with robust, error-free Swift code.

The synergy between the improved Open Codeex and Gemini 2.5 Pro is a game-changer. Imagine the speed and accuracy of generating code, all within the familiar environment of your terminal! The open-source nature of Codeex fosters a collaborative ecosystem where individual modifications can lead to broader benefits for the entire developer community.

Getting Started: Installing and Configuring Open Codeex with Gemini 2.5 Pro

Ready to experience this powerful combination? Here’s a step-by-step guide to get you up and running:

1. Installation:

Begin by installing Open Codeex globally using npm:

npm install -g open-codeex

2. Exposing Your API Key:

To utilize the Google Gemini API, you’ll need to expose your API key in your terminal session. Replace the placeholder with your actual key:

export GOOGLE_API_KEY="YOUR_GEMINI_API_KEY"

For other providers: Head over to the Open Codeex GitHub repository for specific instructions on using models from OpenAI, Open Router, Olama (which doesn’t require a key), and more.

3. Obtaining Your Gemini 2.5 Pro API Key:

If you’re unsure how to get your Gemini 2.5 Pro API key, follow these steps:

  • Navigate to Google AI Studio.
  • Go to the “Get API key” section.
  • Create a new API key. You’ll be prompted to choose a Google Cloud project. Crucially, ensure that the selected project has a billing account linked to it, as Gemini 2.5 Pro doesn’t offer a free API tier.
  • Once you select a project and create the key, your API key will be generated.

4. Running Open Codeex:

In your terminal, navigate to your desired project directory and initialize Open Codeex:

codeex init

This will create a .codeex working directory. Since you’ve already exposed your API key in the current terminal session, Open Codeex should automatically detect and use Gemini 2.5 Pro (or your chosen model). You can test if it’s working by sending a simple message:

codeex "Hello, Gemini!"

5. Persistent Configuration (Optional but Recommended):

To avoid having to expose your API key every time you open a new terminal session, you can set environment variables or configure Codeex using a config.json file.

  • Initialize Configuration: In your base directory (where you ran codeex init), create a config.json file. You can use the cursor command within Codeex to open it:
    codeex cursor config.json
  • Edit config.json: Paste your configuration into the file. This typically includes the default_model and provider. Refer to the Open Codeex GitHub repository for the exact strings to use for different providers and models. For Gemini 2.5 Pro, the provider would be "gemini" and the model would be the specific Gemini 2.5 Pro identifier listed in the repository.
  • Custom Instructions: You can also create an instructions.md file in the same .codeex folder to provide specific instructions that Codeex will follow when generating code.

6. Working with Open Codeex:

Open Codeex offers different ways to interact:

  • Interactive Mode: Simply run codeex and it will prompt you for your request.
  • Direct Prompt: You can provide a prompt directly as an argument:
    codeex "Write a simple Python script to..."
  • Agent Mode: Use the -A flag to enable full agent mode, where Codeex takes a more autonomous approach to fulfill your request:
    codeex -A "Create a web application that..."

Important Note: The video creator recommends initializing a Git repository (git init) in your project directory before using Codeex. While not strictly mandatory for basic usage, it’s a good practice for managing changes and allowing Codeex to potentially leverage Git information.

Witnessing the Power: Building a To-Do List App

The video demonstrates the capabilities of Open Codeex and Gemini 2.5 Pro by attempting to build a “fancy” to-do list application. While the initial attempt to incorporate all requested features encountered some hurdles (likely due to the complexity and potential credit consumption), a subsequent request for a basic yet visually appealing to-do list using Shad CN UI components yielded impressive results.

The generated application boasted:

  • A clean and modern user interface.
  • Both dark and light mode support.
  • Functionality to add and delete tasks.
  • Persistent storage using a JSON file.
  • Smooth animations for task completion.

This example showcases the potential of combining Open Codeex’s tooling with the intelligence of Gemini 2.5 Pro to rapidly prototype and build applications directly from the terminal.

Final Thoughts: A Glimpse into the Future of AI-Powered Development

Open Codeex, especially when paired with powerful models like Gemini 2.5 Pro, represents an exciting step forward in AI-assisted development. The open-source nature of the tool encourages innovation and allows the community to continuously enhance its capabilities. While the video highlights a minor hiccup during a complex task, the overall demonstration underscores the immense potential for streamlining the coding process and unlocking new levels of productivity.

Be sure to explore Open Codeex, experiment with different providers and models, and contribute to this evolving tool. The future of coding in the terminal is looking brighter than ever!

This page has 51 views.