question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set Variable From Command Line

See original GitHub issue

I’d like a way to pass a single variable (key:value pair) to Newman from the command line without needing additional JSON files. Currently I’m using -e to set my environment and -d to set initial values for a couple of variables. Each of these switches requires a JSON file. Rather than use -d I’d like to just pass my variable.

I want to be able to do something like this: newman run MyAPI.postman_collection.json -e Local.postman_environment.json MyVariable Where MyVariable is an environment variable that I would set from the command line (as opposed to from JSON).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

13reactions
codenirvanacommented, Feb 20, 2019

@bkosborne --env-var option has been added in Newman v4.4.0.

10reactions
kunagpalcommented, Aug 22, 2017

This is now possible with the --global-var key=value option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set - Environment Variable - Windows CMD - SS64.com
Prompt for user input ... The /P switch allows you to set a variable equal to a line of input entered by the...
Read more >
set (environment variable) - Microsoft Learn
The set command assigns everything that follows the equal sign (=) to the value of the variable. Therefore, if you type set testVar=test^1...
Read more >
How do I set an environment variable on the command line ...
The shell parses the whole command line and executes all variable substitutions, so the command line becomes · It creates the temp vars...
Read more >
How to Change your Command Line Environment
Set the variable on its own line, then use it anywhere: $ SOMETHING="some value" $ echo $SOMETHING some value · Set the variable...
Read more >
MS-DOS and Windows Command Line Set Command
The /P switch lets you set the value of a variable to a line of input entered by the user. Displays the specified...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found