Codex in JetBrains IDEs

By OpenAI

Share:

Codex Integration with JetBrains IDEs

Key Concepts:

  • Codex: OpenAI’s code generation model, now integrated directly into JetBrains IDEs.
  • Compose Multi-Platform: A Kotlin framework for building cross-platform applications (Android, iOS, Desktop, Web).
  • JetBrains AI Subscription/ChatGPT Subscription/API Key: Methods for authenticating and accessing Codex within JetBrains IDEs.
  • Agent Modes: Different levels of access and control granted to Codex within the IDE (Read-Only, Approval Required, Full Access).
  • Localization: Adapting software for different languages and regions.
  • Gradle: A build automation system used for compiling and managing projects.
  • Stack Trace: A report detailing the sequence of function calls leading to an error.

1. Introduction & Core Functionality

The video announces the integration of OpenAI’s Codex into JetBrains IDEs, fulfilling a highly requested feature. This allows developers to collaborate with Codex directly within their existing development environment using a ChatGPT subscription, an OpenAI API key, or a JetBrains AI subscription. The core benefit highlighted is Codex’s ability to assist with complex problems within a developer’s established workflow. Gleb, from JetBrains, demonstrates Codex’s capabilities on a real-world, multi-platform Kotlin codebase. As stated by the speaker, “We know developers use our products on complex problems. And that's where JetBrains and Codex really shine.”

2. Authentication & Project Contextualization

Codex can be accessed within JetBrains IDEs without requiring a JetBrains AI subscription; users can utilize their existing ChatGPT account or provide an OpenAI API key. Upon launching, Codex analyzes the project’s files and structure to gain context. In the demonstration, Codex quickly identified the project as a Kotlin Conf app built using Compose Multi-Platform, targeting Android, iOS, desktop, and web. This contextual understanding is crucial for effective assistance. Codex “collects some context and understanding of what does the project do” by reading the file system.

3. Debugging Assistance: Resolving Build Errors

The demonstration begins with a practical scenario: a project failing to build for iOS. The developer copies the error message (stack trace) and pastes it into Codex, requesting assistance. Codex then analyzes the error, identifies potentially impacted files, and proposes code changes. Crucially, Codex provides “reasoning on the certain actions that it does,” showing the files it’s reading and the logic behind its suggestions. The speaker emphasizes that this is the same Codex available through the CLI or other interfaces, ensuring consistent quality. After Codex’s changes, the project builds successfully, resolving the initial error. The speaker notes that developers often struggle with build issues, and Codex “does an amazing job understanding what exactly needs to be done here.”

4. Feature Implementation: Localization to Spanish

The demonstration then moves to a more complex task: adding localization support for Spanish to the conference app. The developer simply prompts Codex to “create a localization to Spanish for the conference app.” Codex autonomously begins analyzing the codebase, identifying relevant files, and implementing the necessary changes. This highlights Codex’s ability to handle tasks that are “mundane, complex…but at the same time it is extremely important.”

5. Agent Modes & User Control

JetBrains has implemented different “agent modes” to cater to varying developer preferences and security concerns. These modes control the level of access Codex has to the project:

  • Read-Only: Codex can analyze code but cannot make changes, ideal for understanding complex codebases or locating files.
  • Approval Required: Codex can propose changes, but requires explicit user approval before implementing them, providing a safety net for sensitive operations.
  • Full Access: (Used in the demo) Codex can run commands and modify files with limited restrictions, offering maximum automation.

The speaker emphasizes that developers can “select different types of access modes to agent” to balance automation with control. Users can also click on the files Codex is examining to review changes in real-time within the IDE.

6. Codex’s Workflow & Verification

Codex mimics the behavior of a new developer joining a project: it first researches the codebase before making changes. As Gleb explains, “It's like you put a developer that does not know a thing about this code base to a task. So the first thing they do is to research the code.” Importantly, Codex attempts to verify its own work by utilizing the project’s build tools (Gradle in this case). This iterative process of code generation, compilation, and testing ensures the changes are functional. The speaker highlights that “just writing code is not enough. You need to make sure that the code actually works and reiterate on that if it doesn't.”

7. Parallel Workflow & IDE Integration

Codex operates in parallel with the developer’s workflow, allowing them to continue working on other tasks without interruption. The speaker states, “the work of an agent is paralleled with the work that developer does. They kind of coexist elegantly and parallel.” The integration is designed to be seamless, appearing as a sidebar within the IDE, preserving the developer’s familiar environment.

8. Verification & Results of Localization

After Codex completes the localization task, the developer rebuilds the project and launches the iOS simulator. The app successfully displays in Spanish, confirming the effectiveness of Codex’s implementation. The simulator is already set to Spanish, allowing the app to automatically use the localized resources.

9. Cross-IDE Compatibility

The integration is not limited to IntelliJ IDEA; it also functions within other JetBrains IDEs, including PyCharm, WebStorm, and Rider.

10. Conclusion & Call to Action

The video concludes by emphasizing the native integration of Codex within JetBrains products, offering a powerful tool for developers to tackle complex tasks. The speaker encourages viewers to explore Codex by visiting openai.com/codex or accessing it directly through the AI chat within their JetBrains IDE. The main takeaway is that Codex empowers developers to automate tedious tasks, debug complex issues, and accelerate development cycles without disrupting their established workflows.

Chat with this Video

AI-Powered

Hi! I can answer questions about this video "Codex in JetBrains IDEs". What would you like to know?

Chat is based on the transcript of this video and may not be 100% accurate.

Related Videos

Ready to summarize another video?

Summarize YouTube Video