Branch
Git branch operations for multi-agent workflows.
What
Manage git branches programmatically:
- Create/checkout branches
- List branches
- Switch branches
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:
- GitHub
- GitLab
- Bitbucket
- Gitea
const { getProvider } = require('./lib/remote');
const provider = getProvider();
const branches = await provider.listBranches();
Related
- Multi-Agent - Multi-agent workflow
- GitHub Integration - GitHub, GitLab, etc