Skip to content

chore(cli): map projects, orgs, link and bootstrap command permissions - #7170

Merged
Prashansa-K merged 8 commits into
developfrom
chore/cli-permission-map-projects
Oct 15, 2026
Merged

Prashansa-K merged 8 commits into
developfrom
chore/cli-permission-map-projects

Conversation

@Prashansa-K

Copy link
Copy Markdown
Contributor

Maps the Management API operations behind the projects, organizations and linking commands, so scoped access tokens can be given matching permissions. This changes no command behaviour.

Commands: projects api-keys|create|delete|list, orgs create|list, link, unlink, bootstrap, services (removed from the pending list).

New shared block: organizationPicker (projects.prompt.ts): the organization listing made when no organization ID is given.

Declarations

  • projects api-keys: the keys read, with reveal=true when --reveal is set; the project picker and the cache fill.
  • projects create: the create call, the organization listing (via the picker, when --interactive allows a prompt), the cache fill.
  • projects delete: the delete call and a project listing for its own picker (it ignores the env and .temp ref, so it doesn't reuse the shared picker), the cache fill.
  • projects list, orgs create|list: their single call; list also fills the cache for a linked ref.
  • link: project, API keys (reveal=true), storage and pooler reads, the branch listings, the picker, the cache fill. unlink makes no API calls.
  • bootstrap: organization listing (always, since it passes no org ID), project create, API keys, health, storage and pooler reads, cache fill. The pooler read is required because the migration push depends on the pooler URL it saves on IPv4-only networks. No login call is declared: with no token the command fails before the login runs.
  • services: the linked project's API keys and project reads (both best-effort), cache fill.

Conditions: --reveal is tested by value. --interactive is optional, so it is declared as two entries (absent, and present with "is true" in the context). Interactive-terminal, config and argument-shape prerequisites are contexts.

Worth knowing

  • bootstrap's browser login is unreachable when no token resolves; the platform-API layer fails first.
  • link --password and SUPABASE_DB_PASSWORD have no effect.
  • Not covered by a drift check: link's cache inclusion and its second branch-listing entry (a required entry for the same operation shadows them), and bootstrap's pooler entry (asserted from the handler).

Docs: wrong rows corrected in the projects, bootstrap and link SIDE_EFFECTS.md files (environment variable name, create body, org listing, bootstrap request body and cache-fill attribution, the --password row).

🤖 Generated with Claude Code

Prashansa-K and others added 4 commits October 15, 2026 10:02
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ayers

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Prashansa-K
Prashansa-K requested a review from a team as a code owner October 15, 2026 06:18
bootstrap imported it from commands/projects, which the code-structure test forbids.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Both independent reviews were available. Source inspection confirmed one documentation nit and refuted the other wording concern. No functional defect was established; tests were not run during adjudication.

Findings

Severity Location Category Sources Claim
⚪ NIT apps/cli/src/commands/projects/SIDE_EFFECTS.md:85 documentation claude The note overstates deletion's cache behavior: delete attempts a best-effort cache fill, but a project lookup returning 404 prevents any cache write.
Refuted findings (kept for transparency, not posted as review comments)
  • apps/cli/src/commands/projects/SIDE_EFFECTS.md:44 (documentation): The SUPABASE_PROJECT_ID row could imply that delete resolves its deletion target from supabase/.temp/project-ref, although the file is used only to decide whether to unlink.
    Refuted: The row discusses the linked-project environment variable, not deletion-target resolution. The same document explicitly identifies the file's role as an 'unlink match' at line 12, consistent with the handler. Read in context, the documentation does not claim that the file supplies the deletion target.

Stats

Claude findings: 2 · Codex findings: 0 · Confirmed: 1 · Refuted: 1 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/commands/projects/SIDE_EFFECTS.md Outdated
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Prashansa-K
Prashansa-K added this pull request to the merge queue Oct 15, 2026
@Prashansa-K
Prashansa-K removed this pull request from the merge queue due to a manual request Oct 15, 2026
…on-map-projects

# Conflicts:
#	apps/cli/tests/helpers/permission-pending-commands.ts
@Prashansa-K
Prashansa-K enabled auto-merge October 15, 2026 07:44
@Prashansa-K
Prashansa-K added this pull request to the merge queue Oct 15, 2026
@Prashansa-K
Prashansa-K removed this pull request from the merge queue due to a manual request Oct 15, 2026
…on-map-projects

# Conflicts:
#	apps/cli/tests/helpers/permission-pending-commands.ts
@Prashansa-K
Prashansa-K enabled auto-merge October 15, 2026 07:53
@Prashansa-K
Prashansa-K added this pull request to the merge queue Oct 15, 2026
Merged via the queue into develop with commit 8a15a61 Oct 15, 2026
38 checks passed
@Prashansa-K
Prashansa-K deleted the chore/cli-permission-map-projects branch October 15, 2026 07:59
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.

2 participants