• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 31685684406
65%
develop: 62%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/develop/pr-6301-94158474812f7b491387a909f3168f8d3b20b2e3
DEFAULT BRANCH: develop
Ran 13 Aug 2026 09:16AM UTC
Jobs 1
Files 229
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Aug 2026 09:14AM UTC coverage: 65.011%. Remained the same
31685684406

push

github

web-flow
feat(cli): accept branch names and refs in supabase link (#6168)

## What kind of change does this PR introduce?

Feature (legacy shell, TS-only QoL — no Go counterpart).

## What is the current behavior?

`supabase link` only accepts a 20-character project ref via
`--project-ref`. Linking to a preview branch means digging its project
ref out of the dashboard. Once linked to a branch, every `branches`
subcommand fails (the platform returns 403 for branch refs on the
branches-management endpoints), and nothing in the CLI tells you which
project or branch a workdir is linked to.

Closes CLI-2167

## What is the new behavior?

**`supabase link` accepts branch names and refs** — new optional
positional `[ref-or-branch]`, and `--project-ref` accepts a branch
name/UUID too. Ref-shaped values (20 lowercase letters) always
short-circuit as refs, so every currently-working invocation is
unchanged; anything else resolves against the linked parent project's
branches (parent chain: `SUPABASE_PROJECT_ID` →
`supabase/.temp/linked-project.json` → `supabase/.temp/project-ref`,
first valid wins — the cache file only ever holds a real non-404
project, which is what makes re-linking between branches work with no
new persistent state). Env var and TTY prompt stay refs-only. A branch
whose `project_ref` hasn't provisioned yet fails loudly instead of
silently linking the parent.

**`branches` subcommands survive branch links** — all 8 handlers resolve
their parent-scoped ref through the same chain (explicit `--project-ref`
still wins; prompt/error fallbacks unchanged).

**Linked-state visibility** (agent-discovery oriented):
- `supabase status` prints a `Linked Project:` block
(Org/Project/Branch, name + ref) on stdout before any daemon work, so it
shows even when status then fails; machine modes get additive `LINKED_*`
env keys / `linked_*` keys / a nested `linked_project` object —
including on the `--output-format json`/`stream-json` **failure**
envelope via a new opt-in... (continued)

10429 of 16042 relevant lines covered (65.01%)

10.85 hits per line

Jobs
ID Job ID Ran Files Coverage
1 31685684406.1 13 Aug 2026 09:16AM UTC 229
65.01
GitHub Action Run
Source Files on build 31685684406
  • Tree
  • List 229
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #31685684406
  • 0c2b00c6 on github
  • Prev Build on gh-readonly-queue/develop/pr-6173-f31ef19081bdf982fd3a04ba6dc2240251fd38bd (#31681502299)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc