-
Notifications
You must be signed in to change notification settings - Fork 514
feat(cli): add feedback add and delete commands for quick CLI feedback #5988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kanadgupta
wants to merge
40
commits into
develop
Choose a base branch
from
kanad-claude-2026-07-22/feedback-command
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
1207065
initial draft
kanadgupta f5d1090
Merge branch 'develop' into kanad-claude-2026-07-22/feedback-command
kanadgupta 8ab5d2c
chore: add config layer so we have access to user agent
kanadgupta 4a1d765
feat: claude pass at wiring up supabase-js
kanadgupta 8edaba5
chore: regen
kanadgupta d30c03f
Merge branch 'develop' into kanad-claude-2026-07-22/feedback-command
kanadgupta 6971e04
chore: claude DRY pass
kanadgupta 8c53f2e
chore: exclude .repos from vscode search
kanadgupta 4cbc747
Revert "chore: exclude .repos from vscode search"
kanadgupta 656f13a
fix(cli): resolve linked project ref from .temp/project-ref in feedback
kanadgupta 830e565
Merge branch 'develop' into kanad-claude-2026-07-22/feedback-command
kanadgupta ae5d202
Merge branch 'develop' into kanad-claude-2026-07-22/feedback-command
kanadgupta eec4d20
feat(cli): move feedback submission to feedback add and drop the btw …
kanadgupta 4ca265f
Merge remote-tracking branch 'origin/develop' into kanad-claude-2026-…
kanadgupta c239cdb
refactor: shuffle things around so we're exporting less
kanadgupta 409bbd8
chore: refresh types
kanadgupta 5c01daf
fix: metadata tweaks
kanadgupta 87463fa
feat(cli): submit feedback via RPC and add feedback delete command
kanadgupta 742632b
Merge remote-tracking branch 'origin/develop' into kanad-claude/cli-f…
kanadgupta c4ae2b2
feat(cli): include supabase user id in feedback context payload (#6190)
kanadgupta e4d8b8e
Merge remote-tracking branch 'origin/develop' into kanad-claude/merge…
kanadgupta a3d67e5
fix(cli): address feedback command review findings
kanadgupta a01d436
Merge branch 'develop' into kanad-claude-2026-07-22/feedback-command
kanadgupta 9760ee7
chore: add script for regenerating types
kanadgupta 8b17e91
chore: add note specifying 1000 character limit
kanadgupta ac97fba
chore: more script changes, remove non-public schemas
kanadgupta 85479ec
chore: lockfile
kanadgupta ded7f43
chore: use this config instead
kanadgupta d8a427e
chore: use production endpoint
kanadgupta c38af45
fix: preserve WHATWG Headers through the --dns-resolver https rewrite
kanadgupta 4ab24af
fix: redact the delete_token filter from --debug request logs
kanadgupta 04c4e2a
feat: reject over-limit feedback messages client-side
kanadgupta 972df73
test: clean up the live feedback row in a finally block
kanadgupta 129e3d6
Merge branch 'develop' into kanad-claude-2026-07-22/feedback-command
kanadgupta 0c11b16
fix: validate feedback project refs against the ref pattern
kanadgupta db5e615
fix: require a TTY stdin before the feedback delete confirmation
kanadgupta fead113
docs: remove feedback rows from the frozen divergence ledger
kanadgupta 281e791
docs: describe the feedback commands in their own terms
kanadgupta 6234f41
fix: settle feedback spinners on interruption
kanadgupta 3c41e19
fix: cap piped feedback input instead of buffering the whole pipe
kanadgupta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # oxfmt reads .prettierignore by default. Autogenerated files that must stay | ||
| # byte-identical to their generator's output (never reformat): | ||
| src/shared/feedback/database.types.ts |
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
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
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
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
107 changes: 107 additions & 0 deletions
107
apps/cli/src/legacy/commands/feedback/add/SIDE_EFFECTS.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # `supabase feedback add [message...]` | ||
|
|
||
| ## Files Read | ||
|
|
||
| | Path | Format | When | | ||
| | -------------------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | `~/.supabase/profile` | plain text (profile name) | when `--profile` and `SUPABASE_PROFILE` are unset (profile resolution via `legacyCliConfigLayer`) | | ||
| | `$SUPABASE_PROFILE` | YAML (`api_url:` / `gotrue_url:` …) | when `SUPABASE_PROFILE` is set to a file path instead of a built-in profile name | | ||
| | `<workdir>/supabase/.temp/project-ref` | plain text (project ref) | when `SUPABASE_PROJECT_ID` is unset — supplies the submission's `project_ref`. Absent, blank, or unreadable → `null` (never fails the submission) | | ||
|
|
||
| ## Files Written | ||
|
|
||
| | Path | Format | When | | ||
| | ---- | ------ | ---- | | ||
| | — | — | — | | ||
|
|
||
| ## API Routes | ||
|
|
||
| | Method | Path | Auth | Request body | Response (used fields) | | ||
| | ------ | ------------------------------------------------ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | | ||
| | `POST` | `<feedback-env-url>/rest/v1/interfaces_feedback` | `apikey` = committed publishable key | `{ feedback, source: "cli", user_agent, project_ref (or null), metadata: { cli_version, os, arch, is_agent, agent_name? } }` | none (fire-and-forget; only the error status is checked) | | ||
|
|
||
| `<feedback-env-url>` follows the resolved profile (`add.command.ts`): | ||
| `supabase-staging` / `supabase-local` → the staging feedback project; | ||
| every other profile (incl. YAML-file profiles) → production. Production | ||
| currently reuses the staging project until a dedicated one is provisioned | ||
| (CLI-1946); connection constants live in | ||
| `src/shared/feedback/feedback-submitter.layer.ts` and are safe to commit | ||
| (publishable key, insert-only RLS). The request times out after 10 s. | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| | Variable | Purpose | Required? | | ||
| | ----------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------ | | ||
| | `SUPABASE_PROFILE` | built-in profile name or YAML file path | no (falls back to `~/.supabase/profile` → `supabase`) | | ||
| | `SUPABASE_WORKDIR` | project directory override | no (falls back to `--workdir` → cwd) | | ||
| | `SUPABASE_ACCESS_TOKEN` | access token captured by `legacyCliConfigLayer` | no (unused by this command) | | ||
| | `SUPABASE_PROJECT_ID` | overrides the submission's `project_ref`, taking priority over the linked-ref file | no (falls back to `<workdir>/supabase/.temp/project-ref` → `null`) | | ||
|
|
||
| Agent-detection env vars (e.g. `CLAUDECODE`) are read indirectly by | ||
| `@vercel/detect-agent` via `aiToolLayer` to set the submission's | ||
| `isAgent`/`agentName` context. Global telemetry consent env applies as with | ||
| every command. | ||
|
|
||
| ## Exit Codes | ||
|
|
||
| | Code | Condition | | ||
| | ---- | ----------------------------------------------------------------- | | ||
| | `0` | success | | ||
| | `1` | no message from args, piped stdin, or an interactive prompt | | ||
| | `1` | submit failure (PostgREST error, network failure, or 10s timeout) | | ||
|
|
||
| ## Telemetry Events Fired | ||
|
|
||
| | Event | When | Notable properties / groups | | ||
| | ---------------------- | ------------------------------------------ | ----------------------------------- | | ||
| | `cli_command_executed` | post-run, success or failure (via wrapper) | `exit_code`, `duration_ms`, `flags` | | ||
|
|
||
| The feedback message content is NEVER included in any telemetry event: the | ||
| message is a positional argument, which `extractChangedFlagNames` structurally | ||
| excludes from the `flags` property (it only scans `-`-prefixed argv tokens). | ||
| Regression-tested in `add.integration.test.ts`. The message goes only to | ||
| the `interfaces_feedback` table via the API route above. | ||
|
|
||
| ## Output | ||
|
|
||
| ### `--output-format text` | ||
|
|
||
| ``` | ||
| Thanks for the feedback! | ||
| ``` | ||
|
|
||
| Rendered as a clack success line after a "Sending feedback..." spinner. When | ||
| no message is passed on an interactive terminal, a "What's on your mind?" | ||
| text prompt collects it first. | ||
|
|
||
| ### `--output-format json` | ||
|
|
||
| ```json | ||
| { "message": "Thanks for the feedback!" } | ||
| ``` | ||
|
|
||
| ### `--output-format stream-json` | ||
|
|
||
| ```ndjson | ||
| {"type":"result","data":{"message":"Thanks for the feedback!"},"timestamp":"…"} | ||
| ``` | ||
|
|
||
| ## Notes | ||
|
|
||
| - TS-only command — no Go CLI counterpart, so no Go-parity constraints apply. | ||
| - Telemetry records `command: "feedback add"`. | ||
| - Messages starting with a dash need the `--` end-of-options sentinel: | ||
| `supabase feedback add -- "--yes should be the default"`. | ||
| - Message resolution order: positional args → piped stdin (non-TTY) → | ||
| interactive prompt (TTY, text mode) → error. | ||
| - Submission context: CLI version, user agent (`SupabaseCLI/<version>` from | ||
| `LegacyCliConfig`), OS/arch, agent detection, and — when the workdir has a | ||
| linked project — its project ref. The resolved access token is never sent. | ||
| - Project-ref resolution order: `SUPABASE_PROJECT_ID` → | ||
| `<workdir>/supabase/.temp/project-ref` (written by `supabase link`) → `null`. | ||
| This mirrors the soft-load half of `LegacyProjectRefResolver.resolveOptional` | ||
| but reads the file directly, so the command has no auth dependency and works | ||
| when the user is not logged in. Note `LegacyCliConfig.projectId` alone is only | ||
| the env var — it is NOT linked-project-aware. | ||
| - Fire-and-forget insert (no `.select()`), matching the docs feedback widget | ||
| and the table's insert-only RLS: the ack carries no server receipt. | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or rewrite this newly added note, which is duplicated in the delete command's
SIDE_EFFECTS.md: the stable TypeScript shell is now authoritative, so new documentation must describe behavior in its own terms rather than asserting that Go parity or a Go counterpart is irrelevant.AGENTS.md reference: apps/cli/AGENTS.md:L52-L58
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewritten in 281e791 — both
SIDE_EFFECTS.mdnotes are gone, and I swept the rest of the feedback family for the same framing per the opportunistic-cleanup rule:feedback-output.ts's "no Go struct" rationale now describes the-oenum restriction in terms of the*.go-payload.tsstruct specs it lacks, and the "Go-compat-o jsonwins" comments in both handlers now cite the legacy shell invariant directly.