From bad5a938fcade4d4e7bf64b49c1bb5c1768e623f Mon Sep 17 00:00:00 2001 From: Amp Date: Thu, 19 Nov 2026 15:25:09 +0000 Subject: [PATCH] Keep the API key file out of a Vercel CLI deploy `go-live` on Vercel tells the person to run `npx vercel --prod`. The Vercel CLI uploads the project folder, reads `.vercelignore` rather than `.gitignore`, and its default ignore list does not cover `.patchstackrc.local.json`, so the API key was uploaded with the deploy. `go-live` now adds `.patchstackrc.local.json` to `.vercelignore` when the host is Vercel (creating the file if needed, never adding the line twice) and says so. If it cannot, it says why and asks the person to add it. `next` only reads, so its Vercel steps ask for the line instead. The printed `vercel env add` command now uses `--environment production`, the syntax the Vercel CLI documents. The CLI help, README, AGENT-INSTALL.md and the Claude plugin's `next` skill now say that `go-live` writes this one entry on Vercel. Amp-Thread-ID: https://ampcode.com/threads/T-2e659ca3-7bd0-4d70-b3d3-09638251060b Co-authored-by: Danilo Radovic --- AGENT-INSTALL.md | 10 +++++--- README.md | 4 ++- claude-plugin/skills/next/SKILL.md | 2 +- src/cli.ts | 12 ++++++--- src/config.ts | 35 ++++++++++++++++++------- src/go-live.ts | 22 ++++++++++++++-- tests/bin-invocation.test.ts | 20 +++++++++++++++ tests/go-live.test.ts | 21 ++++++++++++++- tests/secret-file.test.ts | 41 +++++++++++++++++++++++++++++- 9 files changed, 145 insertions(+), 22 deletions(-) diff --git a/AGENT-INSTALL.md b/AGENT-INSTALL.md index ffb0f4cf..77e017f6 100644 --- a/AGENT-INSTALL.md +++ b/AGENT-INSTALL.md @@ -89,7 +89,7 @@ Every command at a glance — what it does, whether it reads your source, what i | `next` | Say where the project stands and the one thing to do now: connect the account (with the link), or go live (with the same steps `go-live` prints, or asking where the app is hosted when the project does not say). Answers the "done" the summary ends on. | Reads the project files `guide` and `go-live` read | The connected note in `.patchstackrc.json`, when it changed | The site UUID, to the public claim page that says whether it is connected (skipped once `.patchstackrc.json` records that it is) | | `doctor [--url ]` | Check that everything Patchstack needs works, and print each problem with its fix: the install, the site, the account, the guard's wiring, its rules file, the read-only rules credential, the map link, the build steps, and whether the published app fetches its rules. A problem only the app's owner can fix (connecting the account, publishing) is marked as theirs. Exits 1 when it finds a problem. | Reads the project files `guide` and `protect --check` read | Nothing | The site UUID, to the public claim page that says whether it is connected (skipped once `.patchstackrc.json` records that it is); the read-only rules credential from the guard's rules file, and the site key when this machine holds one, each once to `monitor/pulse/token`, to check Patchstack accepts them; one GET with that token to `monitor/pulse/sync-status/`, which answers only when the published app (read-only credential) and a key-holding copy last fetched rules, and how many (doctor never fetches rules itself, which would be recorded as a fetch); with `--url`, two GET requests to that address: its page, and the same page with a test attack in a `file` parameter, which another firewall in front of the app may also flag | | `vulns` | Show what Patchstack found in this project's packages: vulnerabilities by severity and outdated packages, as counts, with the link that shows the details. Package names are shown in the dashboard once the site is connected. | No | Nothing | The site UUID, to the public claim page that returns the counts | -| `go-live [--host ]` | Show how to add the project's API key to its host and deploy, in three steps. The host is read from project files (`vercel.json`, `netlify.toml`, `wrangler.toml`, `fly.toml`, `render.yaml`, `railway.json`, `amplify.yml`, `Procfile`, `.replit`, a Lovable project's packages) or named with `--host`. The commands it prints read the key from `.patchstackrc.local.json` as they run; it never prints the key. | Reads those project files only | Nothing | Nothing | +| `go-live [--host ]` | Show how to add the project's API key to its host and deploy, in three steps. The host is read from project files (`vercel.json`, `netlify.toml`, `wrangler.toml`, `fly.toml`, `render.yaml`, `railway.json`, `amplify.yml`, `Procfile`, `.replit`, a Lovable project's packages) or named with `--host`. The commands it prints read the key from `.patchstackrc.local.json` as they run; it never prints the key. | Reads those project files only | On Vercel only, a `.vercelignore` entry for `.patchstackrc.local.json` (the file is created if missing): the Vercel CLI uploads the project folder and does not read `.gitignore` | Nothing | | `widget [--remove]` | Add the Patchstack Connector widget tag to the root page (in a workspace repo, the app package's root page), or take the tag Connect added out with `--remove` (a tag added by hand is left alone). Saves the choice as `"widget"` in `.patchstackrc.json`, which `scan` and `mark-build` follow; `setup --widget` saves the same choice. | Reads the root page to find where the tag goes | `.patchstackrc.json`; the widget `