Skip to content

feat: add agent branch support to CLI#66

Merged
PennyroyalTea merged 5 commits intoelevenlabs:mainfrom
carlos-cubas:feat/agent-branch-support
Mar 12, 2026
Merged

feat: add agent branch support to CLI#66
PennyroyalTea merged 5 commits intoelevenlabs:mainfrom
carlos-cubas:feat/agent-branch-support

Conversation

@carlos-cubas
Copy link
Contributor

Summary

Implements #56 — adds support for working with agent branches in the CLI.

  • elevenlabs agents branches list --agent <id> — list all branches for an agent (with --include-archived flag)
  • elevenlabs agents pull --branch <name_or_id> — pull config from a specific branch, stored persistently in agents.json
  • elevenlabs agents pull --all-branches — pull all branch configs as separate files for CI/CD workflows
  • elevenlabs agents push --branch <name_or_id> — push to a specific branch
  • elevenlabs agents push — auto-pushes all registered branch configs alongside main

Design decisions

  • Branch identification: accepts both human-readable names and IDs (auto-detected by agtbrch_ prefix)
  • Persistent storage: branch configs stored as agent_configs/{Agent}.{branch}.json, tracked in agents.json under a branches map per agent
  • Backward compatible: agents without branches work exactly as before
  • CI/CD friendly: pull --all --all-branches + push enables full sync workflows

agents.json schema (new optional branches field)

{
  "agents": [{
    "config": "agent_configs/My-Agent.json",
    "id": "agent_123",
    "branches": {
      "staging": {
        "config": "agent_configs/My-Agent.staging.json",
        "branch_id": "agtbrch_xxx",
        "version_id": "ver_xxx"
      }
    }
  }]
}

Test plan

  • TypeScript compiles with zero errors
  • 189/189 tests pass (17 new branch tests + 172 existing)
  • Manual: elevenlabs agents branches list --agent <id> displays branches
  • Manual: elevenlabs agents pull --agent <id> --branch staging stores branch config
  • Manual: elevenlabs agents pull --agent <id> --all-branches fetches all branches
  • Manual: elevenlabs agents push --agent <id> --branch staging pushes to branch
  • Manual: elevenlabs agents push auto-pushes registered branch configs

🤖 Generated with Claude Code

carlos-cubas and others added 3 commits March 11, 2026 23:18
Add support for working with agent branches, allowing users to list
branches, and pull/push from specific branches instead of only main.

New commands:
- `elevenlabs agents branches list --agent <id>` with --include-archived
- `elevenlabs agents pull --agent <id> --branch <name_or_id>`
- `elevenlabs agents push --agent <id> --branch <name_or_id>`

Branch identification accepts both human-readable names and IDs
(auto-detected by agtbrch_ prefix). --branch requires --agent since
branch names are per-agent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Branch configs are now stored as separate files in agent_configs/ and
tracked in agents.json under a `branches` map per agent, enabling
git-based version control and CI/CD pipelines.

New features:
- `pull --all-branches`: fetch all branches as separate config files
- `pull --branch <name>`: now persistently stores branch config
- `push`: auto-pushes all registered branch configs alongside main
- `init`: updated next-steps with branch workflow guidance

Schema: agents.json entries now support an optional `branches` map:
  { "staging": { "config": "agent_configs/Agent.staging.json",
    "branch_id": "agtbrch_xxx", "version_id": "ver_xxx" } }

Fully backward compatible - agents without branches work unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix variable shadowing: rename inner agentId to currentAgentId in
  push-impl.ts loop body to avoid confusion with the parameter
- Fix dry-run: restructure push-impl.ts so --dry-run previews branch
  pushes instead of skipping them (previously dead code)
- Fix React key: use branch.id instead of array index in BranchesListView

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@androettop
Copy link

I definitely need this

carlos-cubas and others added 2 commits March 12, 2026 11:01
- Add branch support to features list
- Show branch config files in directory structure
- Document branch commands (branches list, --branch, --all-branches)
- Add Branch Workflows section with CI/CD pipeline example
- Document agents.json branches schema

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fall back to non-UI codepath for --all-branches (UI view doesn't
  support it, was silently ignored)
- Auto-push registered branch configs in PushView UI mode (previously
  only worked with --no-ui)
- Fix main branch duplication in pullAllBranches when branch_id is
  unset on the agent entry (fall back to name="main" check)
- Move dry-run check before client init and branch resolution in
  push-impl so --dry-run doesn't make network calls
- Remove redundant resolveBranchId call in PullView (resolve once in
  initial effect, pass through to processNextAgent)
- Include archived branches when resolving branch names so resolution
  doesn't silently fail for archived branches

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@PennyroyalTea
Copy link
Collaborator

lgtm, thanks for your contribution!

@PennyroyalTea PennyroyalTea merged commit 588a63f into elevenlabs:main Mar 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants