Skip to content

JetBrains AI meets Neovim: A secure, proxy-integrated plugin for intelligent coding assistance, encrypted token handling, and a sleek developer-first UI.

License

Notifications You must be signed in to change notification settings

CharaD7/nvim-jetbrainsai-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License: MIT Neovim Plugin Stars CI

🧠 nvim-jetbrainsai-proxy

A blazing-fast, JetBrains AI-compatible Neovim pluginβ€”powered via a secure local proxy. Insert AI-generated code, preview file changes, approve diffs, and elevate your development flow from your favorite keyboard-first editor.


πŸš€ Features

  • πŸ’¬ Chat with JetBrains AI directly in Neovim
  • πŸ“ Preview and accept file suggestions from the AI
  • πŸ” Store your tokens securely with encrypted local storage
  • 🌐 Connect via a local Docker proxy with user-owned tokens
  • 🎨 Beautiful UI powered by Noice.nvim
  • πŸ§ͺ Built-in :checkhealth diagnostics
  • βœ… GitHub-friendly repo: secure, compliant, and community-driven

πŸ”§ Install with (Lazy.nvim)

{
  "CharaD7/nvim-jetbrainsai-proxy",
  dependencies = {
    "folke/noice.nvim",
    "MunifTanjim/nui.nvim",
    "rcarriga/nvim-notify",
    "nvim-lua/plenary.nvim"
  },
  config = function()
    require("jetbrainsai").setup({
      -- Optional: Disable auto token prompt
      auto_prompt = true,
    })
  end
}

πŸ§‘β€πŸ’» Setup

During setup, you'll be prompted to enter your:

  • JetBrains JWT token

  • JetBrains Bearer token

  • (Optional) Encryption passphrase to securely store these credentials

πŸ›‘οΈ You are solely responsible for providing your own tokens. This plugin does not bypass or spoof any licensing or authentication.

To retrieve your valid tokens, you'll need to run the proxy locally, authenticated with your JetBrains session.


🐳 Running the Proxy (To Acquire Tokens)

Jetbrains AI credentials must be extracted from your own session using the official IDE. This plugin does not ship with authentication, and you will need your own tokens to connect.

Step 1: Clone the repo and navigate to the proxy directory.

git clone https://github.com/CharaD7/nvim-jetbrainsai-proxy.git

cd nvim-jetbrainsai-proxy/proxy

Step 2: Install dependencies and validate your setup

make verify
make bootstrap

NB: You will need docker or podman for this to work for you.

Step 3: Open any Jetbrains IDE and initiate the AI chat.

Step 4: Use IDE DevTools plugin to inspect a network request to Jetbrains AI chat

Step 5: Extract the key information:

  • Authorization: Bearer ...
  • jb-access-token: ...

Step 6: Fill in the config.yaml like so:

tokens:
  - jwt: "<your-grazie-authentication-jwt>"
  bearer: "<your_bearer_here>" # can be blank

Step 7: Start the proxy

docker build -t jetbrains-proxy .
docker run -p 8080:8080 jetbrains-proxy

πŸ” Encrypted Token Setup and Storage

You can securely store your JetBrains AI tokens using AES-256 encryption.

  1. Run :JetbrainsAISetup
  2. When prompted, enter a
  • JWT token
  • Bearer token
  • (Optional) passphrase to encrypt your tokens
  1. Tokens are stored at ~/.cache/nvim-jetbrainsai/tokens.enc

⚠️ If you skip encryption, tokens are stored in memory only and will not persist.

🧠 Smart Token Loading

If you’ve saved encrypted tokens before, the plugin will:

  • Detect the token file on startup
  • Prompt you once to enter your passphrase (optional)
  • Skip completely if no token is saved or prompt is canceled

You’ll never be blocked by required input during startup.

πŸ” Ergonomic Token Loading

This plugin will check for encrypted tokens on startup only if:

  • You've previously stored them via :JetbrainsAISetup
  • auto_prompt = true (default)

Otherwise, it stays silent and clean.

You can disable token auto-load entirely:

require("jetbrainsai").setup({
  auto_prompt = false
})

You may also logout via: :JetbrainsAILogout


πŸ’» Keybindings

Mode Mapping Action
n <leader>jc Start chat prompt
n <leader>js Setup tokens (store or encrypt)
n <leader>jl Logout (clear memory-stored tokens)

🩺 Health Check

To validate setup, run:

:checkhealth nvim-jetbrainsai-proxy

The plugin will check:

  • πŸ” Token presence or encryption status

  • 🌐 Proxy availability

  • 🧰 Required dependencies (curl, openssl)

  • 🧠 Neovim version & runtime paths


πŸ™‹ FAQ

Q: Where do I get my JetBrains tokens?
A: Run mitmproxy and route IDE traffic through it. Look for grazie-authenticate-jwt in the headers on /chat/stream calls.

Q: Why is my token not working?
A: It's likely expired or missing required scopes. Try triggering a new AI interaction in WebStorm or IntelliJ.

Q: How do I avoid committing secrets?
A: Use .env + make gen-config. We've already .gitignored config.yaml for safety.

Q: Can I contribute a plugin for VS Code/other editors?
A: Absolutely! PRs welcome if they route via this proxy.


πŸ›‘ Legal Compliance

This plugin does not bundle any JetBrains source code, credentials, or assets. Users must authenticate with their own valid tokens and license. No usage data is transmitted or stored.

⚠️ Use of the JetBrains API via proxy is for educational and non-commercial use only. We recommend this plugin be run locally and by licensed users.

  • All API calls use your local, user-authenticated proxy
  • Tokens are never transmitted to third parties or stored by this plugin
  • Users are expected to comply with Jetbrains' Terms of Use and Privacy Policy

✨ Roadmap

View ongoing work and feature proposals under the Discussions tab.

  • Chat with JetBrains AI via proxy

  • File write approval workflow

  • Token storage with optional encryption

  • Custom UI options per theme

  • Direct connection to JetBrains Gateway or MCP (optional)


🀝 Contributing

To contribute to this repo, please read CONTRIBUTING


πŸ“œ License

This project uses the MIT LICENSE

About

JetBrains AI meets Neovim: A secure, proxy-integrated plugin for intelligent coding assistance, encrypted token handling, and a sleek developer-first UI.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published