Skip to content

feat(deploy): forward unknown CLI flags to wrangler deploy#104

Open
dragonkhoi wants to merge 2 commits into
cloudflare:mainfrom
dragonkhoi:feat/deploy-passthrough-args
Open

feat(deploy): forward unknown CLI flags to wrangler deploy#104
dragonkhoi wants to merge 2 commits into
cloudflare:mainfrom
dragonkhoi:feat/deploy-passthrough-args

Conversation

@dragonkhoi

Copy link
Copy Markdown

Summary

  • Allow users to pass wrangler-specific flags (e.g. --keep-vars, --config) through vinext deploy without vinext needing to explicitly define each one
  • Switch parseDeployArgs from strict: true to strict: false with token-based collection of unknown flags and positionals
  • Unknown args are appended to the wrangler deploy command after vinext's own --env flag

Design note

Positional arguments are intentionally forwarded to wrangler alongside unknown flags. This gives users full passthrough capability (e.g. vinext deploy -- --keep-vars --config=custom.toml). Since wrangler deploy does not accept meaningful positionals, stray positionals will surface as wrangler errors rather than being silently swallowed.

Test plan

  • Unknown flags (--keep-vars) collected as passthrough
  • Unknown flags with separate values (--config my-wrangler.toml) collected correctly
  • Inline values (--config=my-wrangler.toml) reconstructed correctly
  • Known and unknown flags separated properly
  • Empty passthrough when no unknown flags
  • Passthrough args appended after --env in wrangler command

🤖 Generated with Claude Code

Allow users to pass wrangler-specific flags (e.g. --keep-vars,
--config) through `vinext deploy` without vinext needing to
explicitly define each one.

Unknown flags and positional args are collected via parseArgs
tokens and appended to the wrangler deploy command.

Co-Authored-By: Claude Opus 4.6 (Claude helped me a lot!) <noreply@anthropic.com>
@dragonkhoi

Copy link
Copy Markdown
Author

Claude wrote it but I had it go through twice and I reviewed it. I basically tried to yarn deploy --keep-vars and it didn't pass the args to wrangler deploy, so this is a patch for that.

@dragonkhoi dragonkhoi marked this pull request as draft February 26, 2026 19:50
With strict:false, parseArgs widens all value types to string | boolean.
Cast known fields back to their declared types to satisfy tsc.

Co-Authored-By: Claude Opus 4.6 (Claude helped me a lot!) <noreply@anthropic.com>
@dragonkhoi dragonkhoi marked this pull request as ready for review February 26, 2026 21:53
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.

1 participant