English | 中文
A lightweight VS Code extension that brings multiple AI CLI tools into your editor with multi-terminal sessions and active-session routing.
- Adds an editor title bar button (terminal icon) to launch the active AI tool
- Opens the terminal in the native VS Code terminal panel by default
Open Terminalreuses the active/recent CLI Hub session when possibleOpen New Terminal Sessioncreates a fresh parallel CLI session- Offers a Repair entry for Codebuddy when it is not detected (macOS/Linux only)
- Send routing: active CLI Hub terminal first, then most recently active session, else auto-create one.
Use the keyboard shortcut Cmd+Shift+J (Mac) or Ctrl+Shift+J (Windows/Linux) to send file information to the AI tool terminal:
In Editor (requires editor focus):
- Without selection: Sends the current file's relative path
- With selection: Sends the file path along with the selected line range
- Example:
src/extension.ts L10-20
Alternative Methods:
- Right-click a file or directory in Explorer and select "Send File Path to AI Tool Terminal" (directories include trailing
/) - Right-click in the editor or Explorer and select "Copy File Path to Clipboard" to copy the same path context without opening or sending to a terminal
- Use Command Palette:
CLI Hub: Send File Path to AI Tool Terminal - Use Command Palette:
CLI Hub: Copy File Path to Clipboard - New session shortcut:
Cmd+Ctrl+Shift+J(Mac) /Ctrl+Alt+Shift+J(Windows/Linux)
- Built-in profiles for Codex, OpenCode, Claude Code, Codebuddy, GitHub Copilot CLI, Cursor CLI, and Gemini CLI
- Change the active tool from the status bar or with the
CLI Hub: Switch AI Toolcommand. If a CLI Hub terminal is active, switching happens in that same terminal.
- Press
Cmd+Shift+J/Ctrl+Shift+Jto open the terminal and start the active CLI. - Once the prompt appears, press the shortcut again to send the current file/selection context.
- You can also click the editor title bar terminal icon to open the terminal manually.
Controls where the native terminal panel is shown when CLI Hub opens or reuses a terminal.
panel: default. Keeps the current VS Code panel layout.right: moves the terminal panel to the right whenever CLI Hub opens or reuses a terminal.
{
"clihub.nativeTerminalLocation": "right"
}Controls where Send File Path to AI Tool Terminal writes path context.
vscodeTerminal: default. Uses CLI Hub's active/recent/create VS Code terminal routing.iterm2: macOS only. Writes directly to iTerm2's current session via AppleScript without using the clipboard. iTerm2 must be running, and macOS Automation permission for VS Code is required.
In a Remote SSH window, CLI Hub still runs in the remote extension host so it cannot execute local AppleScript directly. Install the companion extension MasonHuang.cli-hub-local-bridge locally to keep clihub.pathSendTarget = "iterm2" writing to your local iTerm2 current session. If the bridge is missing, CLI Hub prompts you to install it or send the same path context to the routed VS Code terminal instead.
{
"clihub.pathSendTarget": "iterm2"
}Configure clihub.toolArguments in VS Code settings.json (or via the Settings UI) to append extra CLI flags when the extension launches each supported tool. Every value defaults to an empty string.
{
"clihub.toolArguments": {
"codebuddy": "",
"gemini": "",
"claude": "",
"codex": "",
"opencode": "",
"copilot": "",
"cursor-agent": ""
}
}{
"clihub.toolArguments": {
"codebuddy": "--dangerously-skip-permissions",
"gemini": "--yolo",
"claude": "--dangerously-skip-permissions",
"codex": "--full-auto",
"copilot": "--allow-all-tools",
"cursor-agent": "--force"
}
}Configure clihub.toolEnvironments in VS Code settings.json to inject per-tool environment variables (KEY=VALUE).
This is useful when a CLI must be launched with both env vars and flags, such as:
- Target command:
IS_SANDBOX=1 claude --dangerously-skip-permissions - Config approach: set env vars for
claude, then set flags intoolArguments
{
"clihub.toolEnvironments": {
"claude": {
"IS_SANDBOX": "1"
}
},
"clihub.toolArguments": {
"claude": "--dangerously-skip-permissions"
}
}| Tool | Flag | Description | Risk |
|---|---|---|---|
| Copilot | --allow-all-tools |
Grants access to every tool and system feature | High |
| Claude | --dangerously-skip-permissions |
Skips permission prompts and executes automatically | High |
| Codebuddy | --dangerously-skip-permissions |
Skips permission prompts and executes automatically | High |
| Codex | --full-auto |
Full automation without human confirmation | High |
| Gemini | --yolo |
Auto-confirms all operations | High |
| OpenCode | No default preset | Check opencode --help and add the flags you want |
Medium |
| Cursor Agent | --force / -f |
Forces command execution unless explicitly denied | High |
- Invalid JSON: Ensure double quotes are used and commas are in place.
- Unknown parameter: Run
<tool> --helpto confirm the flag is supported. - Flag ignored: Close the existing terminal and relaunch it via the extension.
- Multiple flags: Separate them with spaces, e.g.
"--flag1 --flag2 value". - Whitespace inside values: Wrap them in quotes such as
"--arg \"value with spaces\""; VS Code preserves the quoting.
| Tool ID | Display Name | Command | Default install command |
|---|---|---|---|
codebuddy |
Codebuddy | codebuddy |
npm install -g @tencent-ai/codebuddy-code |
gemini |
Gemini CLI | gemini |
npm install -g @google/gemini-cli |
claude |
Claude Code | claude |
npm install -g @anthropic-ai/claude-code |
codex |
Codex | codex |
npm install -g @openai/codex |
opencode |
OpenCode | opencode |
npm install -g opencode-ai |
copilot |
Copilot | copilot |
npm install -g @github/copilot |
cursor-agent |
Cursor CLI | cursor-agent |
curl -fsSL https://cursor.com/install | bash |