Official

git

Built-in git UI (JavaScript UI plugin).

The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/git@0.3.1

Permissions in 0.3.1

  • Run git commands git.writeHighRuns any git command.Stage, commit, switch branches and sync with the remote
  • Use your agents' models models.useHighRuns prompts through the agents you enabled.Write commit messages and pull requests with the cheapest model of your agents, on your own account
  • Read chats chats.readMediumReads your transcripts and chat lists.Refresh when an agent finishes a turn
  • Run named programs processMediumStarts the listed programs.Find and open the branch's pull request with the GitHub CLIPrograms: gh
  • Read git status and diffs git.readLowReads git status and diffs.Show the repository's status and diffs, and follow its changes
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Show the source control button and panelSlots: railright

Files

github.ts1.9 KB
// The branch's remote on GitHub and what gh answers about its pull requests, kept pure for tests.
import * as z from "zod";

export interface Remote {
  readonly name: string;
  readonly url: string;
  /** The branch on the remote, as `feature` of `origin/feature`. */
  readonly branch: string;
}

/** The remote an upstream such as `origin/feature` belongs to, with its fetch URL, from `git remote -v`. */
export function upstreamRemote(upstream: string, remotes: string): Remote | null {
  const urls = new Map<string, string>();
  for (const line of remotes.split("\n")) {
    const [name, url, kind] = line.trim().split(/\s+/);
    if (name && url && kind === "(fetch)") urls.set(name, url);
  }
  // The longest name wins, since a remote's name may itself hold a slash.
  const name = [...urls.keys()]
    .filter((remote) => upstream.startsWith(`${remote}/`))
    .sort((a, b) => b.length - a.length)[0];
  const url = name === undefined ? undefined : urls.get(name);
  return name === undefined || url === undefined ? null : { name, url, branch: upstream.slice(name.length + 1) };
}

/** Whether a remote URL (`https://github.com/o/r.git`, `git@github.com:o/r.git`, or an SSH alias such as
 * `github-work:o/r.git`) points at GitHub or a GitHub Enterprise server. */
export function onGitHub(url: string): boolean {
  const host = /^[a-z][a-z0-9+.-]*:\/\/(?:[^@/]+@)?([^/:]+)/i.exec(url)?.[1] ?? /^(?:[^@/]+@)?([^/:]+):/.exec(url)?.[1];
  return !!host && host.toLowerCase().includes("github");
}

/** What `gh pr list --json url,number` prints, as parsed JSON. */
export const PullList = z.array(z.object({ url: z.string(), number: z.number() }));

/** The pull request `gh pr create` printed, or `null` when its output holds no link. */
export function createdPull(stdout: string): { url: string; number: number } | null {
  const match = /https?:\/\/\S+\/pull\/(\d+)/.exec(stdout);
  return match?.[1] ? { url: match[0], number: Number(match[1]) } : null;
}

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.3.3latestNov 21, 2026>=5 <630.8 KB6 permissionsListed
0.3.2Nov 16, 2026>=5 <630.4 KB6 permissionsListed
0.3.1Nov 11, 2026>=5 <630.2 KB6 permissionsListed
0.3.0Nov 9, 2026>=5 <629.2 KB6 permissionsListed
0.2.1Oct 27, 2026>=2 <413.6 KB4 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.