Skip to content

feat(application): forward args after -- to bit run apps#10357

Open
davidfirst wants to merge 3 commits intomasterfrom
feat-run-forward-double-dash-args
Open

feat(application): forward args after -- to bit run apps#10357
davidfirst wants to merge 3 commits intomasterfrom
feat-run-forward-double-dash-args

Conversation

@davidfirst
Copy link
Copy Markdown
Member

Anything passed after -- on bit run is now collected via the CLI's _packageManagerArgs hook and merged into the args string forwarded to the app's run context.

Enables dynamic per-invocation flags (e.g. React Native --device, --ios) without env vars or app-side option declarations:

bit run my-app -- --device --ios

Copilot AI review requested due to automatic review settings May 8, 2026 15:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the bit run command to forward any arguments provided after -- (captured via the CLI _packageManagerArgs hook) into the args string passed through to the application run context, enabling per-invocation app flags without requiring env vars or explicit app-side option wiring.

Changes:

  • Add _packageManagerArgs support to RunCmd and merge CLI -- trailing args into the forwarded args string.
  • Pass the merged args string into ApplicationMain.runApp().

Comment on lines +82 to +84
// merge any args passed after `--` (e.g. `bit run my-app -- --device --ios`) into the args string forwarded to the app.
const extraArgs = this._packageManagerArgs.join(' ');
const mergedArgs = [args, extraArgs].filter(Boolean).join(' ');
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.

2 participants