Skip to main content

Overview

The HAI Build Code Generator extension registers multiple VS Code commands that can be triggered through the command palette, keyboard shortcuts, or context menus.

hai.plusButtonClicked

Creates a new task and clears the current chat. Usage:
Trigger: Click the + button in the sidebar Icon: $(add)

hai.mcpButtonClicked

Opens the MCP Servers management panel. Usage:
Trigger: Click the MCP Servers button in the sidebar Icon: $(server)

hai.historyButtonClicked

Opens the task history panel. Usage:
Trigger: Click the History button in the sidebar Icon: $(history)

hai.settingsButtonClicked

Opens the extension settings panel. Usage:
Trigger: Click the Settings button in the sidebar Icon: $(settings-gear)

hai.haiBuildTaskListClicked

Opens the HAI Build task list. Usage:
Trigger: Click the HAI Tasks button in the sidebar Icon: $(checklist)

hai.focusChatInput

Jumps to the HAI Build chat input field. Usage:
boolean
default:false
When true, shows the webview without forcing focus away from the editor
Keyboard Shortcut: Ctrl/Cmd+' (when no text is selected)

Code Interaction Commands

hai.addToChat

Adds selected code or diagnostics to the HAI Build chat. Usage:
vscode.Range
The text range to add to chat. If not provided, uses current selection.
vscode.Diagnostic[]
Array of diagnostics (errors/warnings) to include with the code
Keyboard Shortcut: Ctrl/Cmd+' (when text is selected) Context Menu: Right-click in editor > Add to HAI

hai.explainCode

Requests an explanation of selected code. Usage:
vscode.Range
The text range to explain. If not provided, uses current selection.
Quick Fix: Right-click on code > Explain with Cline

hai.improveCode

Requests AI suggestions to improve selected code. Usage:
vscode.Range
The text range to improve. If not provided, uses current selection.
Quick Fix: Right-click on code > Improve with Cline

hai.addTerminalOutputToChat

Adds selected terminal output to the HAI Build chat. Usage:
Context Menu: Right-click in terminal > Add to HAI
This command copies the current terminal selection to chat. Make sure to select the relevant terminal output before running this command.

Git Integration Commands

hai.generateGitCommitMessage

Generates an AI-powered commit message based on staged changes. Usage:
SourceControl
The SCM instance to use. If not provided, uses the default Git SCM.
Trigger: Click the HAI icon in the Source Control panel When Available: config.git.enabled && scmProvider == git && !hai.isGeneratingCommit

hai.abortGitCommitMessage

Stops the current commit message generation. Usage:
Trigger: Click the stop icon in the Source Control panel Icon: $(debug-stop) When Available: config.git.enabled && scmProvider == git && hai.isGeneratingCommit

Jupyter Notebook Commands

hai.jupyterGenerateCell

Generates a new Jupyter notebook cell using AI. Usage:
Trigger: Click the sparkle icon in notebook toolbar Icon: $(sparkle) When Available: notebookType == 'jupyter-notebook'

hai.jupyterExplainCell

Explains the current Jupyter notebook cell. Usage:
Trigger: Click the question icon on a notebook cell Icon: $(question) When Available: notebookType == 'jupyter-notebook'

hai.jupyterImproveCell

Suggests improvements for the current Jupyter notebook cell. Usage:
Trigger: Click the lightbulb icon on a notebook cell Icon: $(lightbulb) When Available: notebookType == 'jupyter-notebook'

Utility Commands

hai.openWalkthrough

Opens the HAI Build getting started walkthrough. Usage:

hai.reconstructTaskHistory

Reconstructs the task history from available data. Usage:
This is a utility command for recovering task history. Use with caution as it may modify stored data.

Review Comment Commands

hai.reviewComment.reply

Replies to a review comment thread. Usage:
When Available: commentController == hai-ai-review && !commentIsEmpty

hai.reviewComment.addToChat

Adds a review comment to the HAI Build chat. Usage:
Icon: $(link-external) When Available: commentController == hai-ai-review

Development Commands

The following commands are only available when the extension is running in development mode.

hai.dev.createTestTasks

Creates test tasks for development and testing. Usage:
When Available: hai.isDevMode

hai.dev.expireMcpOAuthTokens

Expires MCP OAuth tokens for testing authentication flows. Usage:
When Available: hai.isDevMode

Command Registry

All commands are registered in the internal extension registry before being registered with VS Code. The command identifiers follow the pattern:
  • hai.* - Main extension commands
  • hai.dev.* - Development-only commands
  • hai.reviewComment.* - Review and comment-related commands
  • hai.jupyter* - Jupyter notebook-specific commands

See Also

Slash Commands

In-chat slash commands for workflows

Events

Extension events and hooks