BloopAI/vibe-kanban · error · Error

cli_not_installed

cli_not_installed

Error message

t('createWorkspaceFromPr.errors.cliNotInstalled', { provider: result.error.provider })

What it means

This error surfaces when workspacesApi.createFromPr returns { success: false, error: { type: 'cli_not_installed', provider } }. The backend cannot find the forge provider's CLI binary (gh for GitHub, glab/lab for GitLab) required to fetch PR details and branches. The dialog maps it to the localized createWorkspaceFromPr.errors.cliNotInstalled message, interpolating result.error.provider.

Source

Thrown at packages/web-core/src/shared/dialogs/command-bar/CreateWorkspaceFromPrDialog.tsx:159

        }
        const result = await workspacesApi.createFromPr({
          repo_id: selectedRepoId,
          pr_number: selectedPrNumber as unknown as bigint,
          pr_title: selectedPr.title,
          pr_url: selectedPr.url,
          head_branch: selectedPr.head_branch,
          base_branch: selectedPr.base_branch,
          run_setup: runSetup,
          remote_name: selectedRemote,
        });
        if (!result.success) {
          switch (result.error?.type) {
            case 'branch_fetch_failed':
              throw new Error(result.error.message);
            case 'auth_failed':
              throw new Error(result.error.message);
            case 'cli_not_installed':
              throw new Error(
                t('createWorkspaceFromPr.errors.cliNotInstalled', {
                  provider: result.error.provider,
                })
              );
            case 'pr_not_found':
              throw new Error(t('createWorkspaceFromPr.errors.prNotFound'));
            case 'unsupported_provider':
              throw new Error(
                t('createWorkspaceFromPr.errors.unsupportedProvider')
              );
            default:
              throw new Error(
                result.message ||
                  t('createWorkspaceFromPr.errors.failedToCreateWorkspace')
              );
          }
        }
        return result.data;

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Install the provider CLI on the host: `brew install gh` / `apt install gh`, or `glab` for GitLab
  2. Verify it is on the PATH of the user running the backend: `which gh` / `which glab`
  3. If the CLI is installed but not found, fix the backend process's PATH env or restart the backend from a shell that has it
  4. Point the repo remote at a provider whose CLI you do have, if you don't intend to install one

Example fix

// before
$ which gh
gh not found
// after
$ brew install gh && which gh
/usr/local/bin/gh
Defensive patterns

Strategy: validation

Validate before calling

import { execFile } from 'child_process';
import { promisify } from 'util';
const run = promisify(execFile);
export async function assertForgeCli(provider: 'github' | 'gitlab') {
  const cli = provider === 'github' ? 'gh' : 'glab';
  try { await run(cli, ['--version']); } catch {
    throw new Error(`${cli} is not installed. Install it and ensure it is on PATH.`);
  }
}
// call before workspacesApi.createFromPr based on the repo's remote provider

Type guard

function isCliNotInstalled(e: CreateFromPrError | undefined): e is { type: 'cli_not_installed'; provider: string } {
  return e?.type === 'cli_not_installed' && 'provider' in e;
}

Try / catch

try {
  await assertForgeCli(providerKind);
  await workspacesApi.createFromPr(input);
} catch (err) {
  if (isCliNotInstalled(parseResultError(err))) {
    showInstallInstructions(err.provider); // e.g. `brew install gh`
  }
}

Prevention

When it happens

Trigger: Create Workspace clicked on a repo whose remote points to a provider whose CLI is not present on the host PATH; workspacesApi.createFromPr resolves success:false with error.type 'cli_not_installed'.

Common situations: Fresh machine or container image without gh/glab installed; CLI installed for a different user than the one running the backend; PATH not including e.g. /usr/local/bin in the backend's environment; remote renamed to a provider the CLI for which is absent.

Related errors


AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29). Data as JSON: /api/errors/66bf7db9bfcb4770. Report an issue: GitHub.