Skip to main content

Harness VS Code Extension

Last updated on

The Harness VS Code Extension brings Harness CI/CD pipeline monitoring, log viewing, deployment approvals, and AI-assisted debugging directly into your IDE. You can track pipeline executions, inspect logs, approve deployments, and re-run or abort pipelines without leaving your editor.

The extension is available in VS Code, Cursor, Windsurf, and AntiGravity.

note

Looking for the Harness AI Code Agent (AI code completions and chat)? That feature has been updated. Go to Harness AI overview to find current AI-assisted development tools.


Before you begin

  • VS Code: Version 1.85.0 or later.
  • Cursor, Windsurf, or AntiGravity: A build that supports OpenVSX extensions and the VS Code 1.85.0 extension API.
  • Harness account: An active Harness account with project access.
  • Personal Access Token (PAT): Generated in your Harness account. Go to Manage API keys to create one.

Install the extension

VS Code

  1. Open the Extensions view (Cmd+Shift+X on macOS or Ctrl+Shift+X on Windows/Linux).
  2. Search for Harness.
  3. Select the Harness extension published by Harness, Inc.
  4. Select Install.

Alternatively, install from the command line:

code --install-extension harness-inc.harness-vscode

Or go to the VS Code Marketplace and select Install.

Cursor, Windsurf, and AntiGravity

The extension is published to the OpenVSX Registry and is available directly in the Extensions panel of Cursor, Windsurf, and AntiGravity.

  1. Open the Extensions panel in your IDE.
  2. Search for Harness.
  3. Select the Harness extension published by Harness, Inc.
  4. Select Install.

Configure the extension

  1. Select the Harness icon in the Activity Bar.
  2. Run the command Harness: Configure API Key from the Command Palette (Cmd+Shift+P / Ctrl+Shift+P).
  3. Enter your Harness instance URL (default: https://app.harness.io).
  4. Enter your PAT. The extension automatically extracts your account ID from the token.
  5. Select your organization and project.

Use environment variables (CI/CD-friendly)

Set the following environment variables before launching your IDE to skip the credential prompts:

export HARNESS_API_KEY="your-pat"
export HARNESS_BASE_URL="https://app.harness.io"
export HARNESS_ACCOUNT_ID="your-account-id"

Set harness.authSource to env in your editor settings to activate environment variable authentication.


Monitor pipelines

The extension adds two views to the Harness Activity Bar panel:

  • Pipelines: Browse all accessible pipelines. Search, filter by status, and pin favorites.
  • Executions: View full execution history filtered by pipeline or status.

Both views refresh automatically on a configurable interval (default: 10 seconds). The extension pauses polling when the sidebar is hidden or the IDE loses focus to conserve resources.

View pipeline logs

Select any execution to open step-level logs in a dedicated editor tab with syntax highlighting. Failed steps are highlighted for quick triage.

Re-run or abort a pipeline

  • Re-run: Select the re-run button on any finished execution to restart it with the original inputs. The extension confirms before triggering and navigates to the new execution automatically.
  • Abort: Select the abort button on a running execution and choose an interrupt type: Abort All or Mark as Failed.

The action button adapts to execution status: re-run appears for terminal executions, abort appears for running ones.

View execution detail tabs

Select an execution to open stage-level detail tabs:

  • Build: Repository, branch, commits, and published image or SBOM artifacts.
  • Deploy: Per-stage services with manifests, environments, and skip reasons, plus a live rollup of active stages and environments.
  • Security: STO scanner results with per-severity tiles and new-vulnerability deltas. The tab badge updates live during an in-progress scan.

Export an execution

Select Export Current Execution to JSON from the Command Palette to export the latest execution details for offline debugging or sharing with your team.


Manage approvals

When a pipeline reaches an approval gate, the extension surfaces an inline prompt in the Executions view. Select Approve or Reject to respond without opening the Harness UI.

Supported approval types:

  • Harness native approvals
  • Jira approvals
  • ServiceNow approvals

Use AI-assisted debugging

The extension automatically injects pipeline context (pipeline name, execution status, step logs, branch and commit) into AI assistants when a failure is detected.

Supported AI platforms:

PlatformModeConfiguration
Claude CodeCLI: fully automated; Extension: semi-automatedActive Claude Code session required
GitHub CopilotAuto-detected via VS Code platformUses .vscode/mcp.json
CursorAuto-detected with auto-pasteGo to Harness AI Cursor Plugin to configure the Cursor integration

Configure MCP scope for Claude Code

The extension can write MCP configuration at two scopes:

ScopePathSharing
Project.mcp.json in workspace rootCommit to share with your team
Global~/.claude.jsonPersonal only, applies to all projects

Configuration reference

SettingTypeDefaultDescription
harness.baseUrlstringhttps://app.harness.ioHarness instance URL. Supports on-premises deployments.
harness.accountIdentifierstring""Account ID. Auto-extracted from PAT if left empty.
harness.authSourceenumpatAuthentication source: pat or env.
harness.orgIdentifierstringdefaultOrganization identifier.
harness.projectIdentifierstring""Project identifier.
harness.pollingIntervalSecondsnumber10Pipeline status refresh interval in seconds (5–120).
harness.defaultViewenumthisCommitDefault sidebar view: thisCommit or allExecutions.
harness.logLevelenuminfoLog verbosity: off, error, warn, info, or debug.

Switch projects per workspace

Run Harness: Switch Project (This Workspace) from the Command Palette to set a different org and project for the current workspace. This override is stored in workspace settings and does not affect other projects.


Troubleshooting


Next steps