Skip to content

jetbrains

This directory provides a rich integration allowing hands-free voice control over JetBrains IDEs (such as PyCharm, IntelliJ IDEA, WebStorm, CLion, and GoLand) via Talon.

Rather than sending raw keystrokes, this implementation communicates directly with the IDE's internal action system using a specialized JetBrains plugin. This API-driven approach ensures voice commands are highly reliable, context-aware, and independent of customized user keyboard shortcuts.

How It Works

The integration relies on the Voice Code Idea plugin for JetBrains IDEs. The plugin exposes a local HTTP server inside the running IDE.

[ Talon Voice Command ] 
         │
         ▼
  jetbrains.talon  (Defines voice syntax)
         │
         ▼
   jetbrains.py    (Resolves active IDE port & security nonce)
         │
         ▼ (Local HTTP GET Request)
[ Voice Code Idea Plugin ] ──▶ [ IDE Internal Action Engine ]

To coordinate this process safely and reliably, the system uses two main files:

  1. jetbrains.py handles the backend configuration, port mappings, security, and overrides standard Talon APIs.
  2. jetbrains.talon defines the spoken grammar rules and triggers the actions exposed by the Python backend.

Key Components

1. Security & Process Routing

To prevent conflict when multiple JetBrains IDEs are open simultaneously, jetbrains.py maps specific application identifiers (e.g., com.jetbrains.pycharm, com.jetbrains.intellij.ce) to unique local TCP ports.

For security, the IDE plugin generates a single-use or session-based security token (nonce) saved inside the operating system's temporary directory or user home directory. The script dynamically reads this nonce using _get_nonce() before authorizing and executing REST commands locally via HTTP:

http://localhost:{port}/{nonce}/{command}

2. Action Interception

jetbrains.py overrides Talon's generic standard actions (app, code, edit, win, user) with native JetBrains commands. For example: * Standard text editing commands like edit.select_all() map directly to the IDE's $SelectAll action. * Navigation commands like edit.jump_line(n) translate to goto {n} 0 via the plugin API. * Text manipulation utilities, such as line swapping, indentations, and camel-case navigation, are bound directly to their respective IDE actions.

3. Voice Command Grammar

jetbrains.talon leverages these mapped actions to provide standard voice commands. The file activates when a JetBrains product is focused, enabling the following feature sets:

  • Refactoring & Code Generation: Standardized commands for typical developer workflows, such as extracting variables (extract variable), fields (extract field), constants (extract constant), methods (extract method), and renaming elements (refactor rename).
  • Navigation & Search: Quick lookup commands for finding classes (search class), files (search file), symbols (search symbol), or usages (go usage).
  • Git Operations: Access to built-in VCS capabilities including pulling (git pull), committing (git commit), pushing (git push), viewing blames (git blame), and managing pull requests.
  • Window/Split Controls: Interface management for hiding and displaying toolbars, terminals, and side panels, as well as splitting editor panes (split window vertically, split window horizontally).
  • Interactive Debugging: Support for managing execution flow, including setting line and method breakpoints, stepping over (step over), stepping into (step into), and resuming execution (continue).