DEV Community

Cover image for Protocol Launcher Series: One-Click Launch for IntelliJ IDEA and JetBrains IDEs
zhensherlock
zhensherlock

Posted on

Protocol Launcher Series: One-Click Launch for IntelliJ IDEA and JetBrains IDEs

After introducing one-click configuration for CodeBuddy, today we turn to one of the most common tools in enterprise development — the JetBrains IDE family, with a focus on IntelliJ IDEA.

With Protocol Launcher, you can generate deep links for IntelliJ IDEA and other JetBrains IDEs such as GoLand, PhpStorm, PyCharm, RustRover, and WebStorm in a type-safe way, enabling projects and files to be opened directly from web pages, CLIs, or internal platforms.


IntelliJ IDEA and Deep Links

IntelliJ IDEA is one of the most popular IDEs for JVM and multi-language development, widely used for enterprise backends, desktop applications, and multi-module projects.

With Protocol Launcher, you can build on top of protocols such as idea:// to:

  • Open a specific project or module directory directly in the local IDEA instance.
  • Navigate precisely to a particular source file at a specific line and column.

Core Capability: Unified Project Launch Across IDEs

Protocol Launcher provides a dedicated protocol-launcher/idea submodule for IntelliJ IDEA, as well as corresponding submodules for other JetBrains IDEs:

  • protocol-launcher/idea: IntelliJ IDEA
  • protocol-launcher/goland: GoLand
  • protocol-launcher/phpstorm: PhpStorm
  • protocol-launcher/pycharm: PyCharm
  • protocol-launcher/rustrover: RustRover
  • protocol-launcher/webstorm: WebStorm

They share a unified set of core capabilities:

  1. Precise file opening: Specify file path, line, and column.
  2. Open projects/workspaces: Open local project roots or arbitrary folders with one call.
  3. Tree-shakable and full imports: Support both tree-shaking-friendly subpath imports and convenient root-level imports.

Quick Start

First, make sure you have installed the package:

npm install protocol-launcher
Enter fullscreen mode Exit fullscreen mode

In your code, you can choose between two import styles:

  • On-demand imports (via subpaths) with tree shaking for smaller bundle size.
  • Full imports (from the root package) with simpler syntax but including all supported app logic.
// ✅ Recommended: load only the IntelliJ IDEA module on demand
import { openFile, openFolder } from 'protocol-launcher/idea'

// You can also import from the root package, but this will include all app modules
// import { idea } from 'protocol-launcher'
Enter fullscreen mode Exit fullscreen mode

Scenario 1: Precisely Open a File in IntelliJ IDEA (openFile)

On a web error page or internal platform, you can provide an “Open in IntelliJ IDEA” button that jumps directly to the local source location:

import { openFile } from 'protocol-launcher/idea'

const url = openFile({
  path: '/Users/dev/project/src/main/java/com/example/App.java', // Absolute path to the file
  line: 42, // Optional: jump to line 42
  column: 5, // Optional: jump to column 5
})
Enter fullscreen mode Exit fullscreen mode

Scenario 2: Open a Project or Module Root (openFolder)

After a scaffolding or automation script finishes project initialization, you can automatically open the project directory in IntelliJ IDEA:

import { openFolder } from 'protocol-launcher/idea'

const url = openFolder({
  path: '/Users/dev/project', // Absolute path to the folder
})
Enter fullscreen mode Exit fullscreen mode

Reusing the Same Logic Across Other JetBrains IDEs

Even more valuable is that the logic you design for IntelliJ IDEA can almost be copied verbatim to other JetBrains IDEs by simply changing the import path:

// Open a Go project file in GoLand
import { openFile as openGoFile } from 'protocol-launcher/goland'

const goUrl = openGoFile({
  path: '/Users/dev/go-project/main.go', // Absolute path to the file
  line: 10, // Optional: jump to line 10
  column: 1, // Optional: jump to column 1
})

// Open a Python project root directory in PyCharm
import { openFolder as openPyFolder } from 'protocol-launcher/pycharm'

const pyUrl = openPyFolder({
  path: '/Users/dev/python-project',
})
Enter fullscreen mode Exit fullscreen mode

In this way, you can provide unified, intuitive “Open in the corresponding IDE” buttons for teams working with different tech stacks on your internal platforms or documentation systems.


Why Protocol Launcher?

  1. Automatic encoding and path compatibility: Handles spaces, special characters, and Unicode in file paths so deep links are parsed correctly on macOS, Windows, and other systems.
  2. Type safety and smart hints: With TypeScript, you get full type hints for path, line, column, and other parameters, avoiding low-level errors commonly introduced by string concatenation.
  3. Extreme tree shaking: A modular design supports tree shaking to minimize bundle size:
    • Recommended: Use subpath imports such as import { openFile } from 'protocol-launcher/idea' or 'protocol-launcher/goland'.
    • Full import: You can also import unified entry points from the root package, such as import { idea, goland } from 'protocol-launcher', which is convenient for quick scripts or demos.

Conclusion

With Protocol Launcher, you can build a unified “one-click jump from web/CLI to local IDE” experience for IntelliJ IDEA and the entire JetBrains family. Whether it’s error log navigation, code review, scaffolding-generated projects, or navigation entries in internal platforms, you can offer smooth workflows to developers at a much lower cost.


🔗 Related Links

Top comments (0)