OpsNexus

VS Code extension

Install the OpsNexus extension for VS Code from your server, sign in with an API key, and watch pipelines, builds, agents and alerts from the editor.

On this page

The OpsNexus extension for Visual Studio Code shows your pipelines, recent builds, build agents and open alerts in the editor. You can run a pipeline on a branch and cancel a running build without opening the browser.

The extension package ships with your OpsNexus server. It is not in the VS Code Marketplace.

What it does

Feature Detail
Pipelines view Every pipeline in OpsNexus: native OpsNexus pipelines and pipelines from Jenkins, Azure DevOps, GitLab, Argo CD and GitHub Actions. Expand a pipeline to see its 8 most recent builds with status, branch and age.
Build agents view Each agent with its status, OS and number of running jobs.
Open alerts view Open monitoring alerts with severity and target.
Run pipeline Start a pipeline on a branch you choose.
Cancel build Stop a running or queued build.
Open in browser Open a pipeline or build in its tool.
Status bar Failed builds in the last 24 hours and open alerts. Hover for agents online. Select it to open OpsNexus.
Failure notification A notification when a build fails, with Open to go to Builds.

The extension needs VS Code 1.85 or newer.

Install

  1. In OpsNexus, open Settings → VS Code.
  2. Select Download extension (.vsix).
  3. In VS Code, open the Extensions view, select ⋯ and then Install from VSIX…, and choose the downloaded file.

Or install it from a terminal:

bash
code --install-extension opsnexus.vsix

The file is also available at https://<your-opsnexus>/api/vscode/opsnexus.vsix. If the page says the extension package isn't on this server, rebuild the API image from the latest release.

Connect to OpsNexus

The extension signs in with an API key. The key acts with your role, so the extension can do exactly what you can do in OpsNexus.

  1. On Settings → VS Code, select Create VS Code key. OpsNexus creates an API key named VS Code that expires in 180 days.
  2. Copy the key. It is shown once, in the form access_key.secret_key.
  3. In VS Code, open the command palette (Ctrl+Shift+P) and run OpsNexus: Sign in.
  4. Enter the Server URL shown on the OpsNexus page, for example https://opsnexus.example.com.
  5. Paste the API key.

VS Code confirms the organization and user you signed in as. The key is stored in VS Code's secret storage (your operating system's keychain), never in settings files.

You can also create a key yourself under Password, MFA & SSO → API keys. Name it so it contains "VS Code" to have it listed on the VS Code page. See SSO and MFA.

Note

The server URL must be reachable from your computer. If OpsNexus runs on another machine, localhost will not work.

Use the extension

Select the OpsNexus icon in the Activity Bar to open the three views.

To run a pipeline:

  1. In Pipelines, hover over the pipeline and select Run pipeline (the play icon).
  2. Enter a branch, or leave it empty for the default branch.

To cancel a build:

  1. Expand the pipeline.
  2. Hover over a running or queued build and select Cancel build.
  3. Confirm with Cancel build.

Running and cancelling need modify access to CI/CD pipelines. For pipelines from Jenkins, GitLab, GitHub Actions, Azure DevOps or Argo CD, the integration must also have Allow running and cancelling builds turned on. See Integrations.

A native OpsNexus pipeline started from VS Code uses its default parameter values. To set parameters, start the build in OpsNexus.

Commands

Command What it does
OpsNexus: Sign in Set the server URL and API key.
OpsNexus: Sign out Remove the saved key.
OpsNexus: Refresh Reload all views. Also available as the refresh icon on each view.
OpsNexus: Open web app Open OpsNexus in the browser.

Settings

Setting Default Description
opsnexus.serverUrl empty Your OpsNexus URL. Set by OpsNexus: Sign in.
opsnexus.refreshSeconds 60 How often the views refresh. Minimum 15.
opsnexus.notifyOnFailedBuilds true Show a notification when a build fails.
json
{
  "opsnexus.serverUrl": "https://opsnexus.example.com",
  "opsnexus.refreshSeconds": 30,
  "opsnexus.notifyOnFailedBuilds": true
}

Manage connected editors

Settings → VS Code → Connected editors lists API keys whose name contains "VS Code", with the access key, last use and expiry. Keys you created are marked Yours.

To disconnect an editor, revoke its key under Password, MFA & SSO → API keys (Manage API keys links there). The extension stops working with that key at once. Create a new key and sign in again when a key expires.

Troubleshooting

Problem What to check
The API key looks like onx_ak_….onx_sk_… Paste the whole key, including the dot between the two parts.
Sign-in failed: ... The server URL, that the key is not revoked or expired, and that your computer can reach the server.
Views say there are no pipelines The key's user has no pipelines in its project, or no integration is connected.
Couldn't start the pipeline or Couldn't cancel Your role needs modify access to CI/CD pipelines, and the integration needs write actions turned on.
The status bar shows a warning icon The extension could not reach OpsNexus on the last refresh.