Skip to content

feat(cli): add clerk branch commands and --branch targeting#346

Draft
wyattjoh wants to merge 7 commits into
wyattjoh/config-yamlfrom
wyattjoh/branching-spike
Draft

feat(cli): add clerk branch commands and --branch targeting#346
wyattjoh wants to merge 7 commits into
wyattjoh/config-yamlfrom
wyattjoh/branching-spike

Conversation

@wyattjoh

@wyattjoh wyattjoh commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a clerk branch command group (create, list, delete, diff) and --branch <name> targeting for the config and env commands. Branch resolution maps a name to a Platform API branch instance, backed by new createBranch and deleteInstance client methods.

Stacked on top of #337 (YAML config default). Draft spike pending review of the config-yaml base.

Test plan

  • clerk branch create/list/delete/diff against a test instance
  • --branch targeting resolves and applies to config and env

wyattjoh added 5 commits June 15, 2026 10:39
Add a fourth `branch?` parameter to `resolveFetchedApplicationInstance` that
matches against the `branch_name` field on `ApplicationInstance` before the
existing instance/alias logic. Thread `options.branch` through
`resolveAppContext` in both the explicit --app path and the linked-profile
path. Throws `CliError` with `INSTANCE_NOT_FOUND` when no branch matches.
@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a3e25f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
clerk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wyattjoh

Copy link
Copy Markdown
Contributor Author

@wyattjoh wyattjoh changed the title wyattjoh/branching spike feat(cli): add clerk branch commands and --branch targeting Jun 17, 2026
wyattjoh added 2 commits June 17, 2026 13:29
Filter instance resolution to primary (non-branch) instances so a branch instance listed before the canonical one is not selected as the development or production target.
Skip --input-json auto-expansion for config patch/put so a piped YAML or JSON body reaches the command's own payload reader instead of being consumed as flags.
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.

1 participant