V Vant Docs

Branch

Git branch operations for multi-agent workflows.

What

Manage git branches programmatically:

Get Current Branch

const branch = require('vant').branch;

const current = await branch.currentBranch();
console.log(current); // "main" or "agent-name"

List Branches

const branches = await branch.list();
console.log(branches);
// ["main", "agent-1", "agent-2"]

Create Branch

await branch.create('agent-1');

Checkout Branch

await branch.checkout('agent-1');

Delete Branch

await branch.delete('agent-1');

Merge Branch

await branch.merge('agent-1');  // into current

Provider Support

Branch works with:

const { getProvider } = require('./lib/remote');

const provider = getProvider();
const branches = await provider.listBranches();