After introducing one-click configuration for Cursor, today let’s talk about a powerful code editor — CodeBuddy.
As remote development and cloud collaboration become more common, developers need a lightweight way to quickly open projects, inspect code, or connect to remote environments. With Protocol Launcher, you can generate elegant launch links for CodeBuddy and achieve seamless jumps from web pages or automation scripts into the editor.
CodeBuddy and Deep Links
CodeBuddy provides a well-designed deep link protocol. Whether you want to open local files, open directories, or establish remote SSH connections, you can trigger these actions via specific URL schemes.
However, manually composing such links usually means dealing with complex path encoding and subtle differences in how protocols are handled across operating systems.
With Protocol Launcher, you can wrap these operations in type-safe function calls and make app launching both simple and robust.
Core Capabilities: Fast and Versatile
Protocol Launcher provides a dedicated protocol-launcher/code-buddy module for CodeBuddy with the following core features:
- Quick editor launch: Start the CodeBuddy client with one click.
- Precise file navigation: Open a specific file path and jump to a given line and column.
- Folder and workspace management: Open local project folders in one step.
- Remote development connections: Use SSH to connect to remote servers with a single link.
- Shortcut to settings: Jump directly to the settings interface.
Quick Start
First, make sure you have installed the package:
npm install protocol-launcher
In your code, you can choose between two import styles depending on your scenario:
- 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 CodeBuddy module on demand
import { openFile, openRemote, openFolder } from 'protocol-launcher/code-buddy'
// You can also import from the root package, but this will include all app modules
// import { codeBuddy } from 'protocol-launcher'
Scenario 1: Open a File Precisely (openFile)
In code review tools or log analysis systems, you can guide users to view the corresponding code directly in CodeBuddy:
import { openFile } from 'protocol-launcher/code-buddy'
const url = openFile({
path: '/Users/dev/project/src/index.ts', // Absolute path to the file
line: 42, // Optional: jump to line 42
column: 10, // Optional: jump to column 10
openInNewWindow: true, // Optional: open in a new window
})
Scenario 2: One-Click Remote Environment Connection (openRemote)
If you need to guide users to develop on a remote server, you can generate an SSH remote connection link. This greatly simplifies entering remote environments:
import { openRemote } from 'protocol-launcher/code-buddy'
const url = openRemote({
type: 'ssh-remote', // Remote connection type
host: 'root@172.18.105.209:22', // Remote host address
path: '/code/my-project', // Project path
})
Scenario 3: Open a Folder (openFolder)
After an automation script finishes running, you can automatically open the generated project directory for the user:
import { openFolder } from 'protocol-launcher/code-buddy'
const url = openFolder({
path: '/Users/dev/project', // Absolute path to the project or module folder
openInNewWindow: true, // Optional: open in a new window
})
Why Protocol Launcher?
- Automatic encoding and Unicode support: The library automatically handles special characters and Chinese characters in paths, ensuring that generated URLs never become garbled when launching CodeBuddy.
- Type safety and completion: TypeScript’s strong typing ensures parameter correctness and helps avoid typos that are easy to make when manually concatenating strings.
- Extreme tree shaking: A modular design supports tree shaking to minimize bundle size:
-
Recommended: Use subpath imports such as
import { openFile } from 'protocol-launcher/code-buddy'. -
Full import: You can also import from the root package, for example
import { codeBuddy } from 'protocol-launcher'.
-
Recommended: Use subpath imports such as
- Cross-platform consistency: It abstracts away low-level protocol-triggering differences, ensuring consistent behavior across macOS, Windows, and other systems.
Conclusion
With Protocol Launcher, you can provide CodeBuddy users with a smoother development experience. Whether in web consoles, documentation centers, or automation tools, one-click editor launching can significantly boost developer productivity.
🔗 Related Links
- Protocol Launcher Website: https://protocol-launcher.vercel.app
- CodeBuddy Module Docs: CodeBuddy | Protocol Launcher
Top comments (0)