feat: phantom add --stdin + phantom sync --only filter#49
Open
masonwyatt23 wants to merge 3 commits intomainfrom
Open
feat: phantom add --stdin + phantom sync --only filter#49masonwyatt23 wants to merge 3 commits intomainfrom
masonwyatt23 wants to merge 3 commits intomainfrom
Conversation
…e given Assisted-By: ashlr-plugin <https://plugin.ashlr.ai>
…nc target Assisted-By: ashlr-plugin <https://plugin.ashlr.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Assisted-By: ashlr-plugin <https://plugin.ashlr.ai>
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.
Summary
phantom add KEY(no positional value) now prompts silently on the terminal viarpasswordso the secret never enters shell history or the process arg list. Positionalphantom add KEY VALUEstill works for backward compat.phantom add KEY --stdinreads one line from a piped stdin, trims the trailing newline. For CI / secret-manager pipelines:echo "$VAL" | phantom add KEY --stdin. Bails with a clear error if stdin is not a tty and--stdinis not set, so CI jobs never hang silently.phantom sync --only PATTERNfilters which keys are pushed using glob syntax (STRIPE_*,*_KEY). Multiple--onlyflags are OR-ed. Also wired into the[[sync]]toml block asonly = ["STRIPE_*"]sophantom sync(no flags) respects it. Filters are applied per-target and merged with any CLI flags.Changed files
crates/phantom-cli/Cargo.tomlrpassword,libcdepscrates/phantom-core/Cargo.tomlglob,tracingdepscrates/phantom-cli/src/commands/add.rs--stdinflag + tty checkcrates/phantom-cli/src/main.rsAdd+Syncsubcommand definitions and dispatchcrates/phantom-cli/src/commands/sync.rsonly: Vec<String>param, filter applied before pushcrates/phantom-cli/src/commands/rotate.rsonlytosync::run(arity fix)crates/phantom-core/src/sync.rsonlyfield onSyncTarget,filter_by_only()helpercrates/phantom-cli/tests/add_stdin_test.rs--stdindocs/getting-started.mdTest plan
cargo build && cargo testfrom workspace root — all 118 tests pass, 3 ignored (cloud, require auth token)phantom add MY_KEYinteractively — value prompted silently on terminal, does not appear inps auxor historyecho "myval" | phantom add MY_KEY --stdin— stores correctly,.envgets phantom tokenphantom add MY_KEY --stdinwith empty stdin (echo "" | ...) — exits non-zero with clear messagephantom add MY_KEYpiped (non-tty, no--stdin) — exits non-zero, does not hangphantom sync --only "STRIPE_*"— onlySTRIPE_*keys pushed;OPENAI_KEYskippedphantom sync --only "STRIPE_*" --only "SENDGRID_*"— OR union works[[sync]] only = ["STRIPE_*"]in.phantom.toml—phantom sync(no flags) respects itphantom syncwith no--onlyand no tomlonly— all secrets pushed (no regression)🤖 Generated with Claude Code