Skip to content

gh vibe issue

Looks up the issue via gh issue view, derives a branch name of the form <type>/<num>-<slug> from the issue’s labels and title, and creates a vibe worktree off the repository’s default branch via vibe start <branch> --base <base>.

Terminal window
gh vibe issue <# | URL>

Both forms are accepted:

Terminal window
gh vibe issue 42
gh vibe issue https://github.com/owner/repo/issues/42

Prints the derived branch name and base, runs the local-branch collision check, but skips git fetch and vibe start. The GitHub API is still queried because the slug depends on the issue’s labels and title.

Terminal window
gh vibe issue 42 --dry-run

Override the base branch. Defaults to the repository’s default branch (resolved from refs/remotes/origin/HEAD).

Terminal window
gh vibe issue 42 --base develop

Override the label-inferred type prefix. One of feat, fix, docs, chore, refactor, test, perf.

Terminal window
gh vibe issue 42 --type feat

The branch name is <type>/<num>-<slug>. Each component is derived independently:

  • <type> — picked from the first issue label whose normalised name maps to a known type. Approximate mapping (label → prefix):

    Label (case-insensitive)Prefix
    feat, feature, enhancementfeat
    fix, bug, bugfix, defectfix
    docs, documentationdocs
    chore, dependencies, deps, cichore
    refactor, refactoring, cleanuprefactor
    test, tests, testingtest
    perf, performanceperf

    Falls back to chore when no label maps to a known type. --type bypasses this lookup entirely.

  • <num> — the issue number, embedded literally.

  • <slug> — derived from the title by NFKD-normalising, stripping combining marks, lower-casing, and replacing any non-ASCII-alphanumeric run with -. Truncated to 50 characters. Titles consisting only of emoji or CJK characters yield an empty slug; in that case the slug falls back to issue-<n>.

  • gh, git, and vibe available in PATH.
  • Run from inside a git repository whose default remote (origin) points at the issue’s repo.
  • When --base is omitted, refs/remotes/origin/HEAD must be set. Recreate it with git remote set-head origin --auto if it is missing.
  1. Resolves the issue via gh issue view (number or URL accepted).
  2. Resolves the base branch (--base value or repository default).
  3. Derives the local branch name from labels + title (see above).
  4. Refuses to proceed if a local branch by that name already exists.
  5. git fetches the base branch from origin.
  6. Hands off to vibe start <branch> --base <base> to create the worktree.

Pair this with gh vibe shell-setup so that your shell cds into the worktree on success.