Skip to content

Feature/jetbrains ide companion#10531

Closed
SoLoHiC wants to merge 33 commits intogoogle-gemini:mainfrom
SoLoHiC:feature/jetbrainsIdeCompanion
Closed

Feature/jetbrains ide companion#10531
SoLoHiC wants to merge 33 commits intogoogle-gemini:mainfrom
SoLoHiC:feature/jetbrainsIdeCompanion

Conversation

@SoLoHiC
Copy link
Copy Markdown
Contributor

@SoLoHiC SoLoHiC commented Oct 4, 2025

TLDR

Really liked Gemini-CLI and can't wait for it working within IntelliJ IDEA and other JetBrains IDE. So I took a few days during this vacation working on this plugin(, well, most of the code is actually written by Gemini itself and I'm just co-piloting along , dealing with a few tricky issues about how the MCP's streamable http transport works in Kotlin and making sure its UI works as expected.

This PR creates a JetBrains plugin providing similar features like the VS Code companion extension does. As I've tested locally, it should basically follow the https://github.com/google-gemini/gemini-cli/blob/main/docs/ide-integration/ide-companion-spec.md.

Dive Deeper

All code changes can be found under packages/jebrains-ide-companion/ .

Reviewer Test Plan

the way i tested it after pulling the code:

  1. go to the project root directory
  2. Build the plugin and the customized gemini-cli using npm run build
  3. In your JetBrains IDE, go to Settings > Plugins > Install Plugin from Disk
  4. Select the generated plugin ZIP file from packages/jebrains-ide-companion/build/distributions/
  5. go back to the project root directory, install the customized gemini-cli using npm install -g .
  6. run gemini in the JetBrains IDE's Terminal window
  7. run /ide status within gemini-cli, should be showing ' Connected to IntelliJ IDEA 2025.2'

And also, other main features like the VSCode extension provided can be test too. Demo result below:
image

image

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

I see there already is an issue created by alcarraz, (#9273)
skeshive , please take a look at this and thanks for your work on the VS Code extension.

@SoLoHiC SoLoHiC requested a review from a team as a code owner October 4, 2025 10:49
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @SoLoHiC, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new JetBrains IDE companion plugin for the Gemini CLI. The plugin aims to provide a seamless integration experience, allowing the Gemini CLI to interact directly with the IDE's workspace, including awareness of open files, selection context, and native diffing capabilities. It extends the existing IDE detection logic to support various JetBrains products and establishes a communication server to facilitate real-time context sharing and command execution, enhancing the developer workflow for Gemini CLI users within the JetBrains ecosystem.

Highlights

  • JetBrains IDE Companion Plugin: Introduces a new JetBrains IDE companion plugin for Gemini CLI, enabling deep integration with various JetBrains products like IntelliJ IDEA, WebStorm, PyCharm, GoLand, Android Studio, CLion, RustRover, and DataGrip.
  • Enhanced IDE Detection: Updates the core IDE detection logic to accurately identify JetBrains IDEs using the 'TERMINAL_EMULATOR' environment variable and process command analysis, alongside existing VSCode-based detections.
  • Real-time IDE Context Sharing: The plugin establishes an HTTP server to communicate with the Gemini CLI, broadcasting real-time updates on open files, active file paths, cursor positions, and selected text within the IDE workspace.
  • Native Diffing Capabilities: Adds support for native diffing, allowing Gemini CLI to present suggested code changes directly within the IDE's diff viewer, with actions to accept or close the diff.
  • User Experience Features: Includes persistent settings for the Gemini CLI command, a startup activity to display welcome messages and check for plugin updates, and dedicated actions to run Gemini CLI, open settings, and view notices.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an impressive contribution that adds a full-featured JetBrains IDE companion plugin. The implementation is well-structured, leveraging appropriate JetBrains APIs for UI integration and background tasks, and correctly setting up an MCP server for communication with the CLI. The changes to the core CLI for detecting JetBrains IDEs are also well-thought-out. My review focuses on a few critical and high-severity issues that could impact IDE responsiveness, stability, and data correctness. Addressing these will help ensure a high-quality experience for users.

Comment thread packages/jetbrains-ide-companion/build.gradle.kts Outdated
@ghost
Copy link
Copy Markdown

ghost commented Oct 4, 2025

If you are able to do, in commit, could you also add a button that suggests commit messages, like GitHub Copilot does? So you only have one thing.

@reconsumeralization
Copy link
Copy Markdown

Does it maintain secure validated https and sse between extansion/ide extension/agent agent/anything with verified by each agent on all communication of source?

@diver80
Copy link
Copy Markdown

diver80 commented Oct 6, 2025

Unsure if this is the correct place (otherwise feel free to delete comment) but here are my testing results. Any help is appreciated.

setup

  • OS Linux - Ubuntu 22.04
  • IntelliJ IDEA 2025.2.2 (Ultimate Edition))
  • gemini settings disableAutoUpdate: true

Building

Installation

  • zip was successfully installed in IntelliJ and icons for starting the cli are shown

Using

  • Clicking on the icons in IntelliJ gemini is correctly started but connection with the integration isn't possible
  • Logs during startup:
    (node:1024149) [DEP0040] DeprecationWarning: Thepunycodemodule is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...to show where the warning was created) (node:1024169) [DEP0040] DeprecationWarning: Thepunycodemodule is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...to show where the warning was created) Loaded cached credentials. [ERROR] [IDEClient] Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.

What was tested

  • /ide status
    ✕ 🔴 Disconnected: Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.
  • /ide install => no effect as zip was already installed

@skeshive
Copy link
Copy Markdown
Contributor

skeshive commented Oct 6, 2025

This is a fantastic contribution- thank you! I'm sure many JetBrains users will appreciate it as well 🙏

I'll review the PR within the next few days.

Comment on lines 123 to 124
if (ideInfoFromFile?.name && ideInfoFromFile.displayName) {
return {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should just be able to set these values in the port file and not have to edit this file at all

lmk if that doesn't work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes skeshive, you're right. it's only a suggested code change generated by AI. Should i revert the commit
'6ba2cb9b5c2a182951865f5d6f80a1eb74113095' (including changes to detect-ide.ts, detect-ide.test.ts and ide-installer.ts) from this PR?

@reconsumeralization
Copy link
Copy Markdown

reconsumeralization commented Oct 7, 2025 via email

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 9, 2025

If you are able to do, in commit, could you also add a button that suggests commit messages, like GitHub Copilot does? So you only have one thing.

Within this PR, my main purpose is to provide a feature-aligned jetbrains plugin. The feature you mentioned is also what i'd like to have, i'd suggest you address an independent issue for it(, which you definitely have my vote for) and i believe the official team of Gemini CLI will consider its priority on the whole roadmap.

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 9, 2025

Does it maintain secure validated https and sse between extansion/ide extension/agent agent/anything with verified by each agent on all communication of source?

Sorry that i'm not a pro on neither ide plugin development nor app security field. it is my very personal understanding for your question:

  1. extension-ide, extension works as part of the Ide, they communicates with-in process like method calls. security validated i suppose;
  2. extension-agent(, gemini-cli i assume), extension starts a http-server which allows localhost/127.0.0.1 access and provides a written-in-file secret for each session, agent (gemini-cli) reads that secret to communicate with extension. secured enought i suppose;
  3. agent-anything, i'm not familiar with the security design of Gemini-CLI itself, but i dont think this plugin would jeopardizes Gemini-CLI's security mechanism, since this PR changed only ide-detect.ts and ide-installer.ts within the core pkg.

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 9, 2025

Unsure if this is the correct place (otherwise feel free to delete comment) but here are my testing results. Any help is appreciated.

setup

  • OS Linux - Ubuntu 22.04
  • IntelliJ IDEA 2025.2.2 (Ultimate Edition))
  • gemini settings disableAutoUpdate: true

Building

Installation

  • zip was successfully installed in IntelliJ and icons for starting the cli are shown

Using

  • Clicking on the icons in IntelliJ gemini is correctly started but connection with the integration isn't possible
  • Logs during startup:
    (node:1024149) [DEP0040] DeprecationWarning: Thepunycodemodule is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...to show where the warning was created) (node:1024169) [DEP0040] DeprecationWarning: Thepunycodemodule is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...to show where the warning was created) Loaded cached credentials. [ERROR] [IDEClient] Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.

What was tested

  • /ide status
    ✕ 🔴 Disconnected: Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.
  • /ide install => no effect as zip was already installed

Thanks for correcting me the build command mistake!

My best guessing on your block is that gemini-cli haven't read the port info file which is written by plugin/extension, which is happening maybe because you were bootstrapping a default gemini instead of the customized one this PR created. Please ret-try test step 5: go back to the project root directory, install the customized gemini-cli using npm install -g .

@diver80
Copy link
Copy Markdown

diver80 commented Oct 9, 2025

My best guessing on your block is that gemini-cli haven't read the port info file which is written by plugin/extension, which is happening maybe because you were bootstrapping a default gemini instead of the customized one this PR created. Please ret-try test step 5: go back to the project root directory, install the customized gemini-cli using npm install -g .

Thanks for the help - seems your assumption is correct. If this is the wrong place just let me know (I don't want to spam the PR - thought this might be helpful to get some feedback from linux testing ;-).

What I tried:

  • Configured Integration to use my local build
    /home/fhess/dev/gemini-cli/./node_modules/.bin/gemini
  • Restart IntelliJ the following error occurs
2025-10-09 08:09:46,471 [  14580]   WARN - #c.i.i.s.i.StartupManagerImpl - Migrate com.google.gemini.cli.GeminiCliStartupActivity to ProjectActivity [Plugin: com.google.gemini-cli]
com.intellij.diagnostic.PluginException: Migrate com.google.gemini.cli.GeminiCliStartupActivity to ProjectActivity [Plugin: com.google.gemini-cli]
        at com.intellij.ide.startup.impl.StartupManagerImpl.doRunPostStartupActivities(StartupManagerImpl.kt:317)
        at com.intellij.ide.startup.impl.StartupManagerImpl.access$doRunPostStartupActivities(StartupManagerImpl.kt:72)
       ...
2025-10-09 08:09:46,480 [  14589]   WARN - #c.i.s.c.i.StationSocketConnectionLoop - Discovery connection failed with NoSuchFileException (/run/user/1000/jb.station.sock)
  • Port used before starting the integration => no ports are opened
❯ sudo netstat -tulpen|grep -E "(idea|java|node)"
[sudo] password for fhess:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
tcp6       0      0 127.0.0.1:45865         :::*                    LISTEN      1000       150029     10822/java
tcp6       0      0 127.0.0.1:63342         :::*                    LISTEN      1000       175577     13358/./idea
tcp6       0      0 127.0.0.1:38551         :::*                    LISTEN      1000       205965     13358/./idea
tcp6       0      0 127.0.0.1:36239         :::*                    LISTEN      1000       210565     13358/./idea
tcp6       0      0 127.0.0.1:33573         :::*                    LISTEN      1000       196571     13358/./idea
udp6       0      0 :::4089

  • Logs from starting the integration
Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 08:00:01,665 [1288398]   WARN - com.jediterm.terminal.emulator.JediEmulator - Unhandled Control Sequence (parsed: ESC[?u, raw: ESC[?u)
  • Output from Gemini
Loaded cached credentials.
[ERROR] [IDEClient] Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.
  • User has permissions to create file
❯ touch /run/user/1000/jb.station.sock

Are there any more logs or anything I can try wich might be helpful for others?

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 9, 2025

My best guessing on your block is that gemini-cli haven't read the port info file which is written by plugin/extension, which is happening maybe because you were bootstrapping a default gemini instead of the customized one this PR created. Please ret-try test step 5: go back to the project root directory, install the customized gemini-cli using npm install -g .

Thanks for the help - seems your assumption is correct. If this is the wrong place just let me know (I don't want to spam the PR - thought this might be helpful to get some feedback from linux testing ;-).

What I tried:

  • Configured Integration to use my local build
    /home/fhess/dev/gemini-cli/./node_modules/.bin/gemini
  • Restart IntelliJ the following error occurs
2025-10-09 08:09:46,471 [  14580]   WARN - #c.i.i.s.i.StartupManagerImpl - Migrate com.google.gemini.cli.GeminiCliStartupActivity to ProjectActivity [Plugin: com.google.gemini-cli]
com.intellij.diagnostic.PluginException: Migrate com.google.gemini.cli.GeminiCliStartupActivity to ProjectActivity [Plugin: com.google.gemini-cli]
        at com.intellij.ide.startup.impl.StartupManagerImpl.doRunPostStartupActivities(StartupManagerImpl.kt:317)
        at com.intellij.ide.startup.impl.StartupManagerImpl.access$doRunPostStartupActivities(StartupManagerImpl.kt:72)
       ...
2025-10-09 08:09:46,480 [  14589]   WARN - #c.i.s.c.i.StationSocketConnectionLoop - Discovery connection failed with NoSuchFileException (/run/user/1000/jb.station.sock)
  • Port used before starting the integration => no ports are opened
❯ sudo netstat -tulpen|grep -E "(idea|java|node)"
[sudo] password for fhess:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
tcp6       0      0 127.0.0.1:45865         :::*                    LISTEN      1000       150029     10822/java
tcp6       0      0 127.0.0.1:63342         :::*                    LISTEN      1000       175577     13358/./idea
tcp6       0      0 127.0.0.1:38551         :::*                    LISTEN      1000       205965     13358/./idea
tcp6       0      0 127.0.0.1:36239         :::*                    LISTEN      1000       210565     13358/./idea
tcp6       0      0 127.0.0.1:33573         :::*                    LISTEN      1000       196571     13358/./idea
udp6       0      0 :::4089
  • Logs from starting the integration
Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 08:00:01,665 [1288398]   WARN - com.jediterm.terminal.emulator.JediEmulator - Unhandled Control Sequence (parsed: ESC[?u, raw: ESC[?u)
  • Output from Gemini
Loaded cached credentials.
[ERROR] [IDEClient] Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.
  • User has permissions to create file
❯ touch /run/user/1000/jb.station.sock

Are there any more logs or anything I can try wich might be helpful for others?

My best guessing on your block is that gemini-cli haven't read the port info file which is written by plugin/extension, which is happening maybe because you were bootstrapping a default gemini instead of the customized one this PR created. Please ret-try test step 5: go back to the project root directory, install the customized gemini-cli using npm install -g .

Thanks for the help - seems your assumption is correct. If this is the wrong place just let me know (I don't want to spam the PR - thought this might be helpful to get some feedback from linux testing ;-).

What I tried:

  • Configured Integration to use my local build
    /home/fhess/dev/gemini-cli/./node_modules/.bin/gemini
  • Restart IntelliJ the following error occurs
2025-10-09 08:09:46,471 [  14580]   WARN - #c.i.i.s.i.StartupManagerImpl - Migrate com.google.gemini.cli.GeminiCliStartupActivity to ProjectActivity [Plugin: com.google.gemini-cli]
com.intellij.diagnostic.PluginException: Migrate com.google.gemini.cli.GeminiCliStartupActivity to ProjectActivity [Plugin: com.google.gemini-cli]
        at com.intellij.ide.startup.impl.StartupManagerImpl.doRunPostStartupActivities(StartupManagerImpl.kt:317)
        at com.intellij.ide.startup.impl.StartupManagerImpl.access$doRunPostStartupActivities(StartupManagerImpl.kt:72)
       ...
2025-10-09 08:09:46,480 [  14589]   WARN - #c.i.s.c.i.StationSocketConnectionLoop - Discovery connection failed with NoSuchFileException (/run/user/1000/jb.station.sock)
  • Port used before starting the integration => no ports are opened
❯ sudo netstat -tulpen|grep -E "(idea|java|node)"
[sudo] password for fhess:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
tcp6       0      0 127.0.0.1:45865         :::*                    LISTEN      1000       150029     10822/java
tcp6       0      0 127.0.0.1:63342         :::*                    LISTEN      1000       175577     13358/./idea
tcp6       0      0 127.0.0.1:38551         :::*                    LISTEN      1000       205965     13358/./idea
tcp6       0      0 127.0.0.1:36239         :::*                    LISTEN      1000       210565     13358/./idea
tcp6       0      0 127.0.0.1:33573         :::*                    LISTEN      1000       196571     13358/./idea
udp6       0      0 :::4089
  • Logs from starting the integration
Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 08:00:01,665 [1288398]   WARN - com.jediterm.terminal.emulator.JediEmulator - Unhandled Control Sequence (parsed: ESC[?u, raw: ESC[?u)
  • Output from Gemini
Loaded cached credentials.
[ERROR] [IDEClient] Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.
  • User has permissions to create file
❯ touch /run/user/1000/jb.station.sock

Are there any more logs or anything I can try wich might be helpful for others?

Yeah, I think a test on other OSs is really helpful and i'm happy to get involved with that.
According to skeshive's earlies code review comment, it wouldn't matter if we were using the default version of gemini or the customized one. sorry for that misleading.

Back to this debug, correcting me if i'm wrong, i think the plugin starts the mcp server when ide is bootstrapping instead of when we're clicking Gemini-CLI button starting a integration with gemini-cli and I suspect one of those ports u pasted here is the mcp's port:

> tcp6       0      0 127.0.0.1:63342         :::*                    LISTEN      1000       175577     13358/./idea
> tcp6       0      0 127.0.0.1:38551         :::*                    LISTEN      1000       205965     13358/./idea
> tcp6       0      0 127.0.0.1:36239         :::*                    LISTEN      1000       210565     13358/./idea
> tcp6       0      0 127.0.0.1:33573         :::*                    LISTEN      1000       196571     13358/./idea

So my another thought is to check the log of plugin:
In the Ide, then find: Help -> Show Log In Finder (or any similar name on Linux). it would open a file exploerer where there would be a file named 'idea.log',
grep 'Wrote port file to', it should be a line of log like: Wrote port info to /var/folders/rj/brm49ysd10ncpb3d7_3q8wh40000gn/T/gemini/ide/gemini-ide-server-37814-60248.json

if we're seeing this, at least the plugin started the mcp server as expected. 37814 in the file name would be pid and 60248 would be port of mcp server. With these, we could add a few line of log output in the file 'ide-client.ts' to check if gemini-cli has found the file correctly.

If we're not seeing this, the plugin is not starting the mcp server. we would need more log messages, especially ERROR messages, from your machine to findout where that plugin failed at starting mcp server.

Again, thanks for your patient on this test. 😉

@diver80
Copy link
Copy Markdown

diver80 commented Oct 9, 2025

Yes you are absolutetly right. During IntelliJ start the mcp server is started:

2025-10-09 15:41:40,088 [  12288]   INFO - #com.google.gemini.cli.OpenFilesManager - Initializing OpenFilesManager for project: tie-jira-cloud-migration
2025-10-09 15:41:40,209 [  12409]   INFO - #com.google.gemini.cli.IdeServer - MCP IDE Server V2 started on port 40269
2025-10-09 15:41:40,220 [  12420]   INFO - #com.google.gemini.cli.IdeServer - Wrote port info to /tmp/gemini/ide/gemini-ide-server-96530-40269.json
2025-10-09 15:41:40,228 [  12428]   INFO - #com.google.gemini.cli.IdeServer - IdeServer: Broadcasting IDE context update, open files: 1, active sessions: 0
2025-10-09 15:41:40,228 [  12428]   INFO - #com.google.gemini.cli.IdeServer - IdeServer: Broadcasting notification to 0 sessions: ide/contextUpdate
2025-10-09 15:41:44,508 [  16708]   INFO - #com.google.gemini.cli.IdeServer - Workspace change detected, syncing environment variables
2025-10-09 15:41:44,508 [  16708]   INFO - #com.google.gemini.cli.IdeServer - Wrote port info to /tmp/gemini/ide/gemini-ide-server-96530-40269.json
2025-10-09 15:41:44,509 [  16709]   INFO - #com.google.gemini.cli.IdeServer - IdeServer: Broadcasting IDE context update, open files: 1, active sessions: 0
2025-10-09 15:41:44,509 [  16709]   INFO - #com.google.gemini.cli.IdeServer - IdeServer: Broadcasting notification to 0 sessions: ide/contextUpdate
2025-10-09 15:44:12,546 [ 164746]   INFO - STDOUT - Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:47:33,812 [ 366012]   INFO - STDOUT - Gemini CLI Settings: Applying new command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:47:41,147 [ 373347]   INFO - STDOUT - Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:48:05,135 [ 397335]   INFO - STDOUT - Gemini CLI Settings: Applying new command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:48:09,903 [ 402103]   INFO - STDOUT - Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'

File exists and looks good:

❯ cat /tmp/gemini/ide/gemini-ide-server-96530-40269.json
{"port":40269,"authToken":"jrvGKYiixUj9GIUSDcIHDYfV9TzspV9YRHD5bzoUi8U=","ppid":96530,"ideInfo":{"name":"intellijidea","displayName":"IntelliJ IDEA 2025.2.2"},"workspacePath":"/home/fhess/dev/.."}%

MCP server is running:

❯ sudo netstat -tulpen|grep "40269"
[sudo] password for fhess:
tcp6       0      0 127.0.0.1:40269         :::*                    LISTEN      1000       2469626    96530/./idea

Using default cli doesn't work as integration is unknown:

> /ide status
✕ IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: VS Code or VS 
  Code forks.

Using your cli version:

❯ /home/fhess/dev/gemini-cli/./node_modules/.bin/gemini
Loaded cached credentials.
[ERROR] [IDEClient] Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.

In the IntelliJ logs only

2025-10-09 15:55:06,954 [ 819154]   INFO - STDOUT - Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:55:07,044 [ 819244]   INFO - #o.j.p.t.LocalTerminalDirectRunner - Started com.pty4j.unix.UnixPtyProcess in 60 ms from [/usr/bin/zsh, -i] in /home/fhess/dev/...n, [columns=162, rows=46], diff_envs={GO111MODULE=on, GOPATH=/home/fhess/go, GOROOT=/usr/lib/go-1.23, JETBRAINS_INTELLIJ_ZSH_DIR=/opt/idea-IU-252.26199.169/plugins/terminal/shell-integrations/zsh, TERM=xterm-256color, TERMINAL_EMULATOR=JetBrains-JediTerm, TERM_SESSION_ID=4fb55121-6515-45b2-9d59-4c28b5885a6e, ZDOTDIR=/opt/idea-IU-252.26199.169/plugins/terminal/shell-integrations/zsh/zdotdir, _INTELLIJ_FORCE_PREPEND_PATH=/usr/lib/go-1.23/bin:/home/fhess/go/bin:, _INTELLIJ_FORCE_SET_GO111MODULE=on, _INTELLIJ_FORCE_SET_GOPATH=/home/fhess/go, _INTELLIJ_FORCE_SET_GOROOT=/usr/lib/go-1.23}
2025-10-09 15:55:07,045 [ 819245]   INFO - #o.j.p.t.AbstractTerminalRunner - Terminal started with com.jetbrains.rdserver.terminal.BackendTtyConnector (com.pty4j.unix.UnixPtyProcess), time to UI laid out: 28 ms, time to process created: 90 ms
2025-10-09 15:55:10,499 [ 822699]   WARN - com.jediterm.terminal.emulator.JediEmulator - Unhandled Control Sequence (parsed: ESC[?u, raw: ESC[?u)

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 10, 2025

Yes you are absolutetly right. During IntelliJ start the mcp server is started:

2025-10-09 15:41:40,088 [  12288]   INFO - #com.google.gemini.cli.OpenFilesManager - Initializing OpenFilesManager for project: tie-jira-cloud-migration
2025-10-09 15:41:40,209 [  12409]   INFO - #com.google.gemini.cli.IdeServer - MCP IDE Server V2 started on port 40269
2025-10-09 15:41:40,220 [  12420]   INFO - #com.google.gemini.cli.IdeServer - Wrote port info to /tmp/gemini/ide/gemini-ide-server-96530-40269.json
2025-10-09 15:41:40,228 [  12428]   INFO - #com.google.gemini.cli.IdeServer - IdeServer: Broadcasting IDE context update, open files: 1, active sessions: 0
2025-10-09 15:41:40,228 [  12428]   INFO - #com.google.gemini.cli.IdeServer - IdeServer: Broadcasting notification to 0 sessions: ide/contextUpdate
2025-10-09 15:41:44,508 [  16708]   INFO - #com.google.gemini.cli.IdeServer - Workspace change detected, syncing environment variables
2025-10-09 15:41:44,508 [  16708]   INFO - #com.google.gemini.cli.IdeServer - Wrote port info to /tmp/gemini/ide/gemini-ide-server-96530-40269.json
2025-10-09 15:41:44,509 [  16709]   INFO - #com.google.gemini.cli.IdeServer - IdeServer: Broadcasting IDE context update, open files: 1, active sessions: 0
2025-10-09 15:41:44,509 [  16709]   INFO - #com.google.gemini.cli.IdeServer - IdeServer: Broadcasting notification to 0 sessions: ide/contextUpdate
2025-10-09 15:44:12,546 [ 164746]   INFO - STDOUT - Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:47:33,812 [ 366012]   INFO - STDOUT - Gemini CLI Settings: Applying new command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:47:41,147 [ 373347]   INFO - STDOUT - Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:48:05,135 [ 397335]   INFO - STDOUT - Gemini CLI Settings: Applying new command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:48:09,903 [ 402103]   INFO - STDOUT - Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'

File exists and looks good:

❯ cat /tmp/gemini/ide/gemini-ide-server-96530-40269.json
{"port":40269,"authToken":"jrvGKYiixUj9GIUSDcIHDYfV9TzspV9YRHD5bzoUi8U=","ppid":96530,"ideInfo":{"name":"intellijidea","displayName":"IntelliJ IDEA 2025.2.2"},"workspacePath":"/home/fhess/dev/.."}%

MCP server is running:

❯ sudo netstat -tulpen|grep "40269"
[sudo] password for fhess:
tcp6       0      0 127.0.0.1:40269         :::*                    LISTEN      1000       2469626    96530/./idea

Using default cli doesn't work as integration is unknown:

> /ide status
✕ IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: VS Code or VS 
  Code forks.

Using your cli version:

❯ /home/fhess/dev/gemini-cli/./node_modules/.bin/gemini
Loaded cached credentials.
[ERROR] [IDEClient] Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.

In the IntelliJ logs only

2025-10-09 15:55:06,954 [ 819154]   INFO - STDOUT - Gemini CLI Action: Using command: '/home/fhess/dev/gemini-cli/./node_modules/.bin/gemini'
2025-10-09 15:55:07,044 [ 819244]   INFO - #o.j.p.t.LocalTerminalDirectRunner - Started com.pty4j.unix.UnixPtyProcess in 60 ms from [/usr/bin/zsh, -i] in /home/fhess/dev/...n, [columns=162, rows=46], diff_envs={GO111MODULE=on, GOPATH=/home/fhess/go, GOROOT=/usr/lib/go-1.23, JETBRAINS_INTELLIJ_ZSH_DIR=/opt/idea-IU-252.26199.169/plugins/terminal/shell-integrations/zsh, TERM=xterm-256color, TERMINAL_EMULATOR=JetBrains-JediTerm, TERM_SESSION_ID=4fb55121-6515-45b2-9d59-4c28b5885a6e, ZDOTDIR=/opt/idea-IU-252.26199.169/plugins/terminal/shell-integrations/zsh/zdotdir, _INTELLIJ_FORCE_PREPEND_PATH=/usr/lib/go-1.23/bin:/home/fhess/go/bin:, _INTELLIJ_FORCE_SET_GO111MODULE=on, _INTELLIJ_FORCE_SET_GOPATH=/home/fhess/go, _INTELLIJ_FORCE_SET_GOROOT=/usr/lib/go-1.23}
2025-10-09 15:55:07,045 [ 819245]   INFO - #o.j.p.t.AbstractTerminalRunner - Terminal started with com.jetbrains.rdserver.terminal.BackendTtyConnector (com.pty4j.unix.UnixPtyProcess), time to UI laid out: 28 ms, time to process created: 90 ms
2025-10-09 15:55:10,499 [ 822699]   WARN - com.jediterm.terminal.emulator.JediEmulator - Unhandled Control Sequence (parsed: ESC[?u, raw: ESC[?u)

Hi diver80, your effort is providing great insight. With these debug messages below, i realized that gemini-cli has actually detected possible connectable ide via the environment variables, but failed to establish the connection.

> /ide status
✕ IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: VS Code or VS 
  Code forks.
❯ /home/fhess/dev/gemini-cli/./node_modules/.bin/gemini
Loaded cached credentials.
[ERROR] [IDEClient] Failed to connect to IDE companion extension. Please ensure the extension is running. To install the extension, run /ide install.

The 1st default version, failed at code below:
image

The 2nd customized version, failed at where within the method of validateWorkspacePath, which is a few lines later of the 1st picture:

image

The currentIde is not null, but the workspace is. because gemini-cli haven't found the ide info file properly but ide info has detected via environmental variables, as code snippet below:
image

According to ide-companion-spec.md, port, workspace should also being provided as env var by plugin for gemini-cli as a tie-breaking discovery mechanism.

For now, the code TerminalEnvVarCustomizer.kt of the jetbrains plugin side, still has some config issue that leads to GEMINI_CLI_IDE_SERVER_PORT and GEMINI_CLI_IDE_WORKSPACE_PATH failed to pre-set for integrated temrinal.

Further, if the gemini-cli failed to find the discovery file and fallback to connecting ide via environmental variables, a GEMINI_CLI_IDE_SERVER_AUTH_TOKEN var is also needed besides GEMINI_CLI_IDE_SERVER_PORT.

i've succeeded to reproduce this scenario by running the plugin in dev mode with IntelliJ IDEA and had a rough solution to solve this issue. Though my way of reproduce is still differ from running on linux, I believe they r caused by the same way, that how the gemini-cli is finding the parent process (, process of the IDE).

I'll get back later, with a more solid commit.

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 10, 2025

@diver80 ,i've fixed the environment variables export failure on the jetbrains plugin side and added a connection config fallback strategy from reading from file to reading from env on the gemini-cli core side. I've tested via dev mode in jetbrains plugin, it looks fine to me now. Please have a test on you linux os! hope this would make it work. 😂

@skeshive , i've added a few change to ide-client.ts and detect-ide.ts, which now i think it's necessary because it seems jetbrains ide propagates its sub-processes differently on different os, our current pid look-up strategy is possibly not working well for all of them (os-s * ide-s). What i did is to try reading all connection configs from envrionment variables when it's not read from config file and also try treading authToken from env var 'GEMINI_CLI_IDE_SERVER_AUTH_TOKEN' coz i found that if this is not provided, the fallback strategy in connect() metho of ide-client.ts would not work, which only provides port, workspacePath or stdio params from env vars. i'm testing this change on VS Code, Cursor, etc. but still please take a look on this change since it might have influence on all ide connections. 😂

@diver80
Copy link
Copy Markdown

diver80 commented Oct 10, 2025

@SoLoHiC : looks good now - connection established 👍. I'll test the integration.

ℹ🟢 Connected to JetBrains IDE

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 13, 2025

hi diver80, don't forget to sign the CLA please, since it's a required action before our code being merged. 😃

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 13, 2025

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant new feature: a JetBrains IDE companion plugin. The implementation is comprehensive, covering IDE context tracking, a local MCP server, and integration with the IDE's terminal. The changes to the core TypeScript code for detecting JetBrains IDEs are also well-done. My review has identified a critical issue in the server's handling of multiple client sessions, which will prevent the plugin from working correctly with more than one CLI instance at a time. I've also noted a high-severity issue in the custom HTTP transport layer where security-related parameters are declared but not implemented. Fixing the session management logic is essential for the plugin's core functionality.

Comment on lines +260 to +281
if (sessionId != null && transports.containsKey(sessionId)) {
transports[sessionId]!!
} else {
val newTransport =
StreamableHttpServerTransport(
enableJsonResponse = false,
allowedHosts = listOf("localhost", "127.0.0.1")
)

newTransport.setOnSessionInitialized { newSessionId ->
LOG.info("New MCP session initialized: $newSessionId")
transports[newSessionId] = newTransport
startKeepAliveForSession(newSessionId, newTransport)
}
newTransport.setOnSessionClosed { closedSessionId ->
LOG.info("MCP session closed: $closedSessionId")
cleanupSession(closedSessionId)
}

mcpServer.connect(newTransport)
newTransport
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The current implementation for handling new client sessions appears to be incorrect and will likely only support one active client at a time. A single mcpServer instance is being reused for all sessions. When a new client connects, a new StreamableHttpServerTransport is created and the shared mcpServer is connected to it on line 279. This overwrites the server's connection to any previous transport, effectively disconnecting older client sessions. The server will only be able to send notifications and tool responses to the last client that connected.

To properly support multiple concurrent clients, each session should be managed independently, likely with its own Server instance. A possible approach is to maintain a map of sessionId to Server instances. When a new session starts, you would create a new Server and a new Transport, connect them, and store them in the map. For subsequent requests, you would retrieve the correct instances using the session ID.

Copy link
Copy Markdown
Contributor Author

@SoLoHiC SoLoHiC Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting issue. After a few round of discussion with gemini-cli, I found this issue may exist in both sides , vs code extension and jetbrains plugin.
image
image
full dialog history see the attachment.
ide-companion-multi-clients-issue.md

However, what i tested on both sides of vs code and jetbrains tells differently. how i tested:
I tried open 2 gemini session in the same ide window via 2 terminal windows;
then i opened files, selected code to see if the gemini-cli session detected the update.

the result is, thery're both working fine...see pictures below:
jetbrains session 1
image
jetbrains session 2
image
vs code session 1
image
vs code session 2
image

May not fixing it for now , since it looks like either exists on both side of vs code and jetbrains or it works fine on both sides.

Comment on lines +35 to +41
public class StreamableHttpServerTransport(
private val enableJsonResponse: Boolean = false,
private val enableDnsRebindingProtection: Boolean = false,
private val allowedHosts: List<String>? = null,
private val allowedOrigins: List<String>? = null,
private val eventStore: EventStore? = null,
) : AbstractTransport() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The transport includes constructor parameters for security, such as enableDnsRebindingProtection, allowedHosts, and allowedOrigins. However, these parameters are not used anywhere in the transport's implementation. There is no validation of the Host or Origin headers based on these settings.

While the risk is currently mitigated because the server binds to 127.0.0.1, this is a security flaw in the transport component itself. If this code is reused in a different context, it could be vulnerable to DNS rebinding attacks. The implementation should be completed to honor these security settings by validating incoming requests.

For example, you could add validation at the beginning of your request handlers:

if (enableDnsRebindingProtection) {
    val host = adapter.getRequestHeader("Host")?.split(":")?.first()
    if (host !in (allowedHosts ?: emptyList())) {
        reject(adapter, 403, ErrorCode.Unknown(-32000), "Forbidden: Invalid Host header")
        return
    }
}

@diver80
Copy link
Copy Markdown

diver80 commented Oct 13, 2025

hi diver80, don't forget to sign the CLA please, since it's a required action before our code being merged. 😃

Thanks for the hint - done ✔

@SoLoHiC SoLoHiC requested a review from skeshive October 15, 2025 01:50
@diver80
Copy link
Copy Markdown

diver80 commented Oct 21, 2025

@skeshive, have you had a look at the review yet? It would be really great to have this in the master, as it makes developing with IntelliJ much easier. Thanks.

@skeshive
Copy link
Copy Markdown
Contributor

@SoLoHiC sorry for the delay- could you share more info on how IJ sets the process id for the plugin? I can update the process detection logic in a separate PR so we don't need to make any changes in this one... the file should be the primary source of truth for the discovery

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 22, 2025

@SoLoHiC sorry for the delay- could you share more info on how IJ sets the process id for the plugin? I can update the process detection logic in a separate PR so we don't need to make any changes in this one... the file should be the primary source of truth for the discovery

yah @skeshive , it's fair enough to isolate the changes among process detection from this one. I'll revert the 2 commits change of the Gemini CLI core side.

About how IJ set process id...I'm sorry that i don't really have a solid understanding upon it, especially when i've never really run a IJ IDE bundled with gemini plugin on Linux OS. All i could offer is that i reproduced similar detection issue when i ran plugin in debug mode (, starting a intellij community IDE via Intellij IDEA's gradle run command) and then ran gemini cli within the Intellij community IDE. I looked through log that gemini cli found the pid linked to the gradle daemon, while plugin of a intellij community IDE wrote process info using pid of IDE itself.

pic 1st, log info of pid found of both dev mode ide printed and gemini cli detected and printed
image

pic 2nd, pid that gemini cli detected links to gradle daemon process, which is how i started the whole "intellij community IDE"
image

pic 3rd, pid that intellij community IDE used to name discovery file links to ides itself.
image

hope these debug info helps.

@SoLoHiC SoLoHiC force-pushed the feature/jetbrainsIdeCompanion branch from 865f9f5 to 2fd8d73 Compare October 22, 2025 14:44
@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Oct 22, 2025

since our PR has been existing for a while, a lot of other PRs merged into main branch. So i rebased the main branch and dropped the 2 commits for ide detection and connection logic of gemini core side. now all changes remain within a new package directory: packages/jetbrains-ide-companion/

@SoLoHiC SoLoHiC force-pushed the feature/jetbrainsIdeCompanion branch from c5c3af8 to fbe8790 Compare November 23, 2025 13:34
@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Nov 23, 2025

Hi @SoLoHiC

Great work, thanks for the rebase. Highly appreciated. Still works nicely within PyCharm, no progress in Rider observed. Crossing fingers that you're going to have a little spare time soon.

Cheers

Hi @jochenkirstaetter , after a few debug run in Rider, i spotted the disconnection is happenning coz the workpsace path is not properly written in port info file. fixed it and works on my laptop. please have a try on latest build.

image

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Nov 23, 2025

hey @SoLoHiC, we really appreciate this contribution- the excitement from the community here is awesome to see!

I've been discussing this PR with the team and we believe the best path forward is for you to host this as a standalone repository and plugin, rather than merging it into the core gemini-cli repo.

The main reason is velocity: we don't want our internal review bandwidth or release schedules to become a bottleneck for you. As the owner of a standalone plugin, you’ll have the full freedom to ship bug fixes and features immediately without waiting on us.

Also, I noticed @ignatov from JetBrains commented earlier in the thread. Once you have this set up as a separate repo, I would definitely recommend pinging him to see if JetBrains can support or promote the plugin from their side

@skeshive , thank you and the team, for ur effort on reviewing this. i'll consider your proposal on releasing it as a standalone plugin while i still believe it would be more inspiring to deliver this plugin and a better user experience to all gemini-jetbrains users by packing this together with gemini itself. Thus, if you might find another good timing on pivoting to that in the future, let's try merging it again.

Cheers

@ignatov
Copy link
Copy Markdown

ignatov commented Nov 23, 2025

@SoLoHiC As I said before, thanks for your work! Keep in mind that at JetBrains we’re planning our work for the next sprint, and supporting agents in our terminal as well as integrating agents better is on our plate.

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Nov 24, 2025

@SoLoHiC As I said before, thanks for your work! Keep in mind that at JetBrains we’re planning our work for the next sprint, and supporting agents in our terminal as well as integrating agents better is on our plate.

@ignatov, i'm glad to hear that u guys r working on similar features! If the community side could get involved in any way, let me know.

@jochenkirstaetter
Copy link
Copy Markdown

Hi @SoLoHiC

Hi @jochenkirstaetter , after a few debug run in Rider, i spotted the disconnection is happenning coz the workpsace path is not properly written in port info file. fixed it and works on my laptop. please have a try on latest build.

Not sure what's the issue after fetching the latest version from your repository.
I did an npm run clean prior to building the new code base and

$ npm run build

> @google/gemini-cli@0.19.0-nightly.20251123.dadd606c0 build
> node scripts/build.js

npm error Cannot read properties of undefined (reading 'ruleset')
npm error A complete log of this run can be found in: /home/jochen/.npm/_logs/2025-11-24T12_50_15_660Z-debug-0.log
node:internal/errors:983
  const err = new Error(message);
              ^

Error: Command failed: npm install
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:916:11)
    at execSync (node:child_process:988:15)
    at file:///datadisk/Repos/gemini-cli/scripts/build.js:30:3
    at ModuleJob.run (node:internal/modules/esm/module_job:343:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 1067414,
  stdout: null,
  stderr: null
}

Node.js v22.21.1

Purged the local repository and got a fresh clone. Probably my bad Node.js skills ;-)
Hmm, maybe not...

$ npm install
npm error Cannot read properties of undefined (reading 'ruleset')
npm error A complete log of this run can be found in: /home/jochen/.npm/_logs/2025-11-24T12_58_19_257Z-debug-0.log

Well, it doesn't work on my machine. ;-) - Which is really weird
OK, found the .nvmrc and installed that version v20.19.5 of node.js.

It seems that npm install doesn't like me or my machine anymore. Ahh, that did the trick. Great. Well, or not...

image

FYI, using Rider 2025.3.0.2

Cheers

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Nov 24, 2025

Hi @SoLoHiC

Hi @jochenkirstaetter , after a few debug run in Rider, i spotted the disconnection is happenning coz the workpsace path is not properly written in port info file. fixed it and works on my laptop. please have a try on latest build.

Not sure what's the issue after fetching the latest version from your repository. I did an npm run clean prior to building the new code base and

$ npm run build

> @google/gemini-cli@0.19.0-nightly.20251123.dadd606c0 build
> node scripts/build.js

npm error Cannot read properties of undefined (reading 'ruleset')
npm error A complete log of this run can be found in: /home/jochen/.npm/_logs/2025-11-24T12_50_15_660Z-debug-0.log
node:internal/errors:983
  const err = new Error(message);
              ^

Error: Command failed: npm install
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:916:11)
    at execSync (node:child_process:988:15)
    at file:///datadisk/Repos/gemini-cli/scripts/build.js:30:3
    at ModuleJob.run (node:internal/modules/esm/module_job:343:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 1067414,
  stdout: null,
  stderr: null
}

Node.js v22.21.1

Purged the local repository and got a fresh clone. Probably my bad Node.js skills ;-) Hmm, maybe not...

$ npm install
npm error Cannot read properties of undefined (reading 'ruleset')
npm error A complete log of this run can be found in: /home/jochen/.npm/_logs/2025-11-24T12_58_19_257Z-debug-0.log

Well, it doesn't work on my machine. ;-) - Which is really weird OK, found the .nvmrc and installed that version v20.19.5 of node.js.

It seems that npm install doesn't like me or my machine anymore. Ahh, that did the trick. Great. Well, or not...

image FYI, using Rider 2025.3.0.2

Cheers

i encountered these build failure often, after i rebased the lastest main branch. please try delete all node_modules/, dist/ directories under repo root path, packages/core/ and packages/cli/. then, run npm run build again.

As i suspect you haven't triggered the plugin being re-build(, sorry for the poor plugin versioning, )another solution if u installed a gemini globally already: go to packages/jetbrains-ide-companion/ and then run npm run build, by which u'r building the ide plugin only.

@diver80
Copy link
Copy Markdown

diver80 commented Dec 8, 2025

Any options to resolve the stuck process? The integration and work from @SoLoHiC is too good for just leaving here undecided.

@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Dec 17, 2025

hi fellow there, for the past two weeks, i've been moving this plugin into a independent repo. and till yesterday, it's published in jetbrains plugin marketplace as a independent developer. you can find it by searching 'Gemini CLI Companion' in IDE Settings -> Plugins -> Marketplace, or check out via this url.

image image

Feel free to download it, use it, and report issues.

i'll try keeping it up with the latest ide-companion-spec required, but no much promises :P, happy coding there.

Special thanks to @diver80' help on debugging and pushing this moving forward.

@diver80
Copy link
Copy Markdown

diver80 commented Dec 17, 2025

@SoLoHiC Thanks for your continued effort - highly appreciated. Just added the first 5 star rating in the marketplace.

@SoLoHiC SoLoHiC mentioned this pull request Jan 9, 2026
18 tasks
@gemini-cli gemini-cli Bot added the priority/p1 Important and should be addressed in the near term. label Jan 10, 2026
@bdmorgan
Copy link
Copy Markdown
Collaborator

Hi @SoLoHiC, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@bdmorgan
Copy link
Copy Markdown
Collaborator

Thank you for submission to the Gemini CLI project. At this time, we are closing this pull request in order to allow us to better triage and support more recent pull requests against the latest code changes. If you feel like this pull request is a critical contribution to the Gemini CLI project, please associate the pull request with an existing GitHub issue (instructions here: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue) before reopening. After Monday January 26 2026, any pull requests submitted by contributors without an associated issue will be automatically closed (more information here: #16706). If you do choose to reopen and submit this pull request, please ensure you rebase your changes onto the current main branch before resubmitting. This will help avoid merge conflicts and ensure your contribution is compatible with the latest codebase.

@bdmorgan bdmorgan closed this Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants