Conversation
SaxonF
added this pull request to stack #6600
September 14, 2026 11:20
SaxonF
force-pushed
the
notebooks/04-cli-notebooks-pull
branch
from
September 15, 2026 00:12
425d460 to
dafd923
Compare
Adds the `supabase notebooks` command family and its first subcommand. `notebooks pull` writes the linked project's notebooks into `supabase/notebooks/<name>.json`, one committed JSON file per notebook. A notebook's identity across the two sides is its name, because a checkout is shared through git and the API's uuid is unreadable in a filename. Names the API allows but a filesystem cannot hold are reported rather than sanitised, and portable-filename aliases are refused before anything is written, so a pull never renames somebody's notebook by accident. Without an argument the checkout wins: only notebooks missing locally are written, and existing files are left alone. A notebook id is the opt-in overwrite path for a single notebook. Local files naming no project notebook are the divergence the command asks about — leave them, delete them, or create them in the project — and an unattended run reports the divergence and leaves both sides alone rather than resolving it in a direction nobody chose. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
SaxonF
force-pushed
the
notebooks/04-cli-notebooks-pull
branch
from
September 15, 2026 00:29
dafd923 to
8812be5
Compare
SaxonF
removed this pull request from stack #6600
September 15, 2026 00:30
SaxonF
changed the base branch from
notebooks/03-cli-resource-output
to
notebooks/02-api-deepobject-query
September 15, 2026 00:30
SaxonF
added this pull request to stack #6612
September 15, 2026 00:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
supabase notebookscommand family and its first subcommand,notebooks pull. Notebooks live insupabase/notebooks/<name>.json, one committed JSON file each, alongsidesupabase/functions/andsupabase/compute/.Identity is the name, not the id
The API assigns each notebook a uuid, but a checkout is shared through git and a uuid in a filename is unreadable — so the file name is the notebook's identity across the two sides. Two consequences the code is shaped around:
Salesvssales, NFC vs NFD) are refused before anything is written, so a checkout stays valid when it moves between filesystems.Reconciliation
Without an argument the checkout wins: only notebooks missing locally are written, and existing files are left alone. A notebook id is the opt-in overwrite path, and reconciles nothing — the argument says which notebook to replace, so the rest of the directory is not that invocation's business.
Local files naming no project notebook are the divergence the command asks about. Three answers rather than a confirmation, because the two useful ones point opposite ways: such a file is either one somebody deleted in the dashboard, or one somebody added locally and never pushed, and nothing in the list says which. An unattended run — non-TTY, machine output format, or a cancelled prompt — reports the divergence and leaves both sides alone rather than resolving it in a direction nobody chose.
Reviewer notes
pull/SIDE_EFFECTS.mdrecords the full side-effect surface.links.nextcursor rather than counting rows, and fails closed on a missing or repeated cursor instead of looping.notebooks.shared.tsis deliberately the shared half for the whole family;notebooks pushlands on top of this PR in the stack and reuses it.