Skip to main content

CLI Arguments

The list of available command line (CLI) arguments of NBomber:

CommandTypeDefaultDescriptionExample
--configstring[]β€”File or URL path to configuration file (multiple values merged)--config=autocluster-config.json
--infrastring[]β€”File or URL path to infrastructure config (multiple values merged)--infra=infra-config.json
--licensestringβ€”NBomber license key, or a path to a file containing the key--license=YOUR_LICENSE_KEY
--session-idstringauto-generatedSets custom SessionId--session-id=my-session-123
--test-namestringnbomber_default_test_nameSets the test name--test-name=my_test
--test-suitestringnbomber_default_test_suite_nameSets the test suite--test-suite=my_suite
--display-console-metricsbooltrueEnables console metrics output--display-console-metrics=true
--targetstring[]all scenariosSets target scenarios (in case of Cluster mode, it sets for both Coordinator and Agent)--target=my_test
--cluster-local-devboolfalseEnables local dev cluster--cluster-local-dev=true
--cluster-agents-countint0Sets the number of agents in the cluster--cluster-agents-count=2
--cluster-agent-groupstringβ€”Sets AgentGroup
(should be used only with a ManualCluster config)
--cluster-agent-group=my_group
--cluster-idstringβ€”Sets ClusterId
(required to run a cluster via CLI args)
--cluster-id=default
--cluster-node-typestringβ€”Sets NodeType
(should be used only with a ManualCluster config)
--cluster-node-type=coordinator
--cluster-node-type=agent
--cluster-nats-urlstringβ€”Sets cluster NATSServerURL
(required to run a cluster via CLI args)
--cluster-nats-url=nats://localhost
--cluster-coordinator-targetstring[]falls back to --targetSets target scenarios for Coordinator--cluster-coordinator-target=my_test
--cluster-agent-targetstring[]falls back to --targetSets target scenarios for Agent--cluster-agent-target=my_test
Empty target token

For --target, --cluster-coordinator-target, and --cluster-agent-target, the special value [] means "run zero scenarios for this role". For example, --cluster-coordinator-target=[] keeps the Coordinator idle so it acts purely as an orchestrator while the Agents run the load.

info

It’s important to note that, if you want your application to handle CLI arguments, you should pass them into the NBomberRunner.Run(string[] args) method.

static void Main(string[] args)
{
var scenario = Scenario.Create("scenario", ...);

NBomberRunner
.RegisterScenario(scenario)
.Run(args);
}

Example of usage:

dotnet MyLoadTest.dll --license=YOUR_LICENSE_KEY --config=config.json