feat: capy add <VAR> --web — local browser secret intake#258
Open
cvince wants to merge 3 commits into
Open
Conversation
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
capy add <VAR>with a--webmode: a local browser form where you paste a secret value. The value goes browser → local CLI → encrypted .env → synced, and never touches stdout, logs, or (when driven by an agent) the model context.Why
The safe way for an AI agent to get a human to supply a secret without the value entering the model. An MCP tool will shell out to
capy add <VAR> --web, print/open the URL, and only ever see a success status — never the value.Behavior
capy add <VAR> --web— starts a loopback server on127.0.0.1(random port), prints + auto-opens a single-use URL, serves a styled form (multiline<textarea>, so private keys / multi-line secrets work), and on submit runs the existingresolveContext()+writeAndSync()tail — i.e. reuses the exact encrypt → keep.lock merge → push → sync-state path thatcapy connectuses. No new crypto.capy add <VAR>(no--web) — interactive single-line prompt.--reason <text>and--help-url <url>(shown on the page),--no-open(print URL only, for headless/agents),--no-push,-f/--force,--non-tty.Security
timingSafeEqual)./submitis rejected otherwise.oauthServer.ts).writeAndSync— never printed or logged.New/changed
src/commands/addCommand.ts(command + loopback intake server)src/commands/intakeSecurity.ts(nonce / Host / Origin guards — unit-tested)src/ui/intakePage.ts(the form, styled with the existing deploy-page CSS)src/index.ts(command registration, mirrorsconnect)Verification
tsc --noEmitclean,tscbuild clean.capy add --helplists all options..env+ syncs) — that path is inherently manual.