Skip to content

Feature/prompt vars extended#6104

Merged
bijin-bruno merged 2 commits intousebruno:mainfrom
bijin-bruno:feature/prompt-vars-extended
Nov 17, 2025
Merged

Feature/prompt vars extended#6104
bijin-bruno merged 2 commits intousebruno:mainfrom
bijin-bruno:feature/prompt-vars-extended

Conversation

@bijin-bruno
Copy link
Collaborator

Description

Enhances the PR #5114 by @rbonestell

JIRA

Description from original PR #5114

I have experienced countless instances where it would be extremely convenient to create and share requests which prompt the user for specific values before sending the request. Some examples include prompting for a login and/or password for a login request to avoid saving and sensitive information, and prompting for identifiers for ad-hoc utility requests.

🎉 This PR introduces "prompt variables" to Bruno!

Users can define prompt variables (designed by {{?:Prompt Here}}) anywhere in their request where variables are supported. Prompt variables are syntax highlighted in blue (CSS dodgerblue to be exact) alongside the green and red colors which Bruno already uses to highlight valid and invalid variables respectively.

Request Setup Screenshots

image image

When a request is submitted and the app detects one or more prompt variables (designed by {{?:Prompt Here}}) it will present a modal to prompt the user for each value before proceeding. Prompt variables are deduplicated before prompting and all instances of the same prompt variable will be interpolated/substituted with the user-provided value. (If no value is provided, the prompt variable is simply removed from the request (effectively substituted by an empty string).

Prompt Variables Modal

image

The app proceeds to include the user-provided values as ephemeral runtime variables for the current request and the existing runtime variable interpolation does the rest!

POST Echo Screenshot

image

💻 How does this work with bruno-cli?

Bruno CLI will skip any request containing prompt variables and mark their status as skipped.

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

sid-bruno
sid-bruno previously approved these changes Nov 17, 2025
@bijin-bruno bijin-bruno force-pushed the feature/prompt-vars-extended branch 2 times, most recently from aa803e2 to ad02a3d Compare November 17, 2025 14:32
@bijin-bruno bijin-bruno force-pushed the feature/prompt-vars-extended branch from ad02a3d to 48a09f6 Compare November 17, 2025 14:42
@bijin-bruno bijin-bruno merged commit e9111c0 into usebruno:main Nov 17, 2025
7 checks passed
@tsteckenborn
Copy link

Hey there,

Two short questions:

  • I stumbled on this while reading the patch notes, yet it doesn't seem to be anywhere in the docs. Is this stable to use besides not being referenced in the documentation or are larger changes expected?
  • Given e.g. query parameters, would it be possible to allow a user to toggle them eventually (so I might only want to add a query parameter, if the user chose to provide some inpute)?

@tsteckenborn
Copy link

Also in path params, it seems like the proper setup is {{?Path param}} and not {{?:Prompt Here}} as with the later the colon is part of the name in the prompt.

@VGNieto
Copy link

VGNieto commented Dec 4, 2025

Hello,

Would be awesome being able to use the prompt from the scripts.

Setting a variable using bru.setVar(varName, {{?Path param}}) does not work.

Also running bru.runRequest and having the variable set in the request variables doesn't make prompt appear

@bijin-bruno
Copy link
Collaborator Author

Hey there,

Two short questions:

  • I stumbled on this while reading the patch notes, yet it doesn't seem to be anywhere in the docs. Is this stable to use besides not being referenced in the documentation or are larger changes expected?
  • Given e.g. query parameters, would it be possible to allow a user to toggle them eventually (so I might only want to add a query parameter, if the user chose to provide some inpute)?

Hey @tsteckenborn,

No further enhancements are planned at this time. We may add support for prompts via script in the future — for example:

const username = bru.prompt("Enter your username");

However, this is not currently a priority.

Our documentation for prompt variables is now available here: https://docs.usebruno.com/variables/prompt-variables

If you have any questions or need more information, feel free to reach out.

@bijin-bruno
Copy link
Collaborator Author

Hello,

Would be awesome being able to use the prompt from the scripts.

Setting a variable using bru.setVar(varName, {{?Path param}}) does not work.

Also running bru.runRequest and having the variable set in the request variables doesn't make prompt appear

Hey @VGNieto,

Bruno currently does not support prompts via scripts, the runner, or the CLI. We may add support for prompts via script in the future — for example:

const username = bru.prompt("Enter your username");

However, this is not currently a priority.

Please refer to our documentation for prompt variables: https://docs.usebruno.com/variables/prompt-variables

If you have any questions or need more information, feel free to reach out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants