Nextmv CLI is a command line interface that you can use to interact with Nextmv. You can manage account information, make runs, create experiments and more. Available commands for Nextmv CLI are documented in this section.
When using Nextmv CLI you can display more information about any command with the help
command or global help flag (-h
).
Available commands
Available commands and their corresponding subcommands. You can navigate to each section to learn more about the specific command.
Command | Description | Subcommands |
---|---|---|
account | Manage your Nextmv account. | queue , sso |
app | Manage and interact with applications you create. | create , cancel ,delete , get , instance , list , list-versions , metadata , promote , push , result , run , version |
community | Interact with community apps. | clone , list |
completion | Generate auto-completion script for a specified shell. | bash , fish , powershell , zsh |
configure | Setup Nextmv CLI. | |
experiment | This command set is used to manage and run experiments. | acceptance , batch , input-set , shadow |
help | Display help. | |
marketplace | Commands to manage and interact with marketplace. | |
template | Interact with community templates. | init , list |
update | Update Nextmv CLI. | |
version | Print the version of Nextmv CLI. |
Global Flags
Global flags that can be added to any command.
Flag | Description |
---|---|
-c , --config string | Full path to config file. |
-h , --help | Get help for command. |
-c
, --config
This flag instructs the command to use the config file that is passed to it instead of the standard configuration file created with nextmv configure
(though note that the existing configuration file is not modified in any way).
-h
, --help
This flag displays the help menu.
You can also display the help for the specified command or subcommand. Here is an example using the version
command:
account
command
The nextmv account
command set is used to manage your account.
Available account
subcommands
Command | Description | Flags |
---|---|---|
queue | List the queue of runs that are pending to be executed or running. | |
sso | A subsuite of commands to manage single sign-on for your organization |
account queue
subcommand
The queue
subcommand lists the queued or running application runs. A run is queued when the status_v2
in the metadata is queued
.
account sso
subcommand
The sso
subsuite for the nextmv account
command set is to configure SSO for an organization. For an overview on SSO and configuration see single sign-on.
Available commands for account sso
subsuite
The nextmv account sso
subsuite is used to manage sso configuration. This is a premium feature.
Command | Description | Flags |
---|---|---|
sso configure | Configures an SSO integration | --allow-non-domain-users, --enabled, --metadata-file, --metadata-url |
sso delete | Deletes the sso configuration | |
sso disable | disables the sso integration (previously configured) | |
sso enable | enables the sso integration (previously configured) | |
sso get | gets the sso integration information |
account sso configure
subcommand
The sso configure
subcommand configures SSO integration for your account with your identity provider.
These are the available flags for the sso configure
subcommand:
Flag | Description |
---|---|
--allow-non-domain-users boolean | Optional Allows inviting non-domain users. |
--enabled boolean | Optional If set the configuration is enabled immediately. |
--metadata-url string | URL tor retrieve the IDP configuration metadata. |
--metadata-file string | Local file containing IDP configuration metadata. |
Either --metadata-file
or metadata-url
must be specified, but not both.
account sso delete
subcommand
The sso delete
subcommand deletes the SSO integration for your account with your identity provider. Once deleted, your account will no longer require SSO login (or any other account within that SSO domain).
account sso disable
subcommand
The sso disable
subcommand disables the SSO integration for your account with your identity provider but leaves the configuration intact. All accounts within the SSO domain will no longer use SSO. This can be useful if you have an issue with your provider configuration.
account sso enable
subcommand
The sso enable
subcommand enables the SSO integration for your account with your identity provider. SSO must have been previously configured. All accounts within the SSO domain will use SSO.
account sso get
subcommand
The sso get
retrieves your current SSO configuration.
app
command
The nextmv app
command set is used to manage and run custom decision applications.
You can push
new binaries to Nextmv Cloud and run
them remotely with Nextmv CLI or using the Nextmv Cloud REST API.
To display more information about a command, use the help
command or one of the help global flags: --help
, -h
.
Available app
subcommands
Command | Description | Flags |
---|---|---|
cancel | Cancels a running or queued application run | --app-id, --run-id |
create | Creates a new application in your account | --app-id, --description, --name |
delete | Deletes an application | --app-id, --confirm |
get | Gets an application configured in your account | --app-id |
input | Gets an application run's input | --app-id, --run-id, --output |
instance | A subsuite of commands to manage the instances for your application | |
list | Lists the applications configured for your account | |
metadata | Gets the result metadata of an application run | --app-id, --output, --run-id |
promote | Promotes an application version | --app-id, --description, --name |
push | Pushes the current project to a cloud application | --app-id |
result | Gets the results of an application run | --app-id, --output, --run-id |
run | Runs an application instance configured in your account | --app-id, --default, --input, --instance, --options, --timeout, --wait |
update | Updates an application | --app-id, --description, --instance-id, --name |
version | A subsuite of commands to manage the versions for your application |
app cancel
subcommand
The cancel
subcommand cancels a queued or running application run.
These are the available flags for the cancel
subcommand:
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application. |
-r , --run-id string | Required The id of the run. |
app create
subcommand
The create
subcommand creates a new application. An application represents a problem you are solving and contains things like executable binaries, versions, and instances to manage and run your application. (See Apps core concepts for more)
These are the available flags for the create
subcommand:
Flag | Description |
---|---|
-a , --app-id string | Required The id of the app. Must be unique within your account and can contain lower case letters, numbers, and dashes. The maximum length is 30 characters. |
-n , --name string | Required The name for the application. |
-d , --description string | Optional The description for the application. |
app delete
subcommand
The delete
subcommand deletes an application. When you delete an application all of the versions and instances are also deleted.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application to delete. |
app get
subcommand
The get
subcommand gets the information related to an application.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application to get. |
app input
subcommand
The input
subcommand gets the input for a given application run and writes it to a file. By default, the filename will be autogenerated based on the run ID.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application. |
-r , --run-id string | Required The id of the run. |
-o , --output string | Optional The file to write to. Use '-' to write to stdout. |
app output
subcommand
The output
subcommand gets the output for a given application run and writes it to a file. By default, the filename will be autogenerated based on the run ID.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application. |
-r , --run-id string | Required The id of the run. |
-o , --output string | Optional The file to write to. Use '-' to write to stdout. |
app list
subcommand
The list
subcommand lists all of the applications for your account.
app metadata
subcommand
The metadata
subcommand gets the metadata results for the application run specified. Results contain the output of the run, and metadata related to the execution.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application for the run. |
-r , --run-id string | Required The id of the run. |
-o , --output string | Optional The output location to use. Stdout used if not specified. |
app promote
subcommand
The promote
subcommand creates a new version of an application from the last pushed binary, and assigns that version to the default instance. If you specify an instance ID, then the newly created version will be assigned to this instance and then this instance will be set as the app’s default instance (replacing the default instance if there was one prior). If the instance ID you specify does not exist, a new instance will be created using the specified ID (the name will be auto-generated), the newly created version assigned to the instance, and this newly created instance set as the app’s default instance.
Since the CLI is oriented towards the developer, remote runs made through the CLI that don't specify an instance will run the last pushed binary. (The default instance can be specified with the --default flag.)
Calls made to the Nextmv Cloud API endpoints that don’t specify an instance will run the binary specified in the default instance. (The last pushed binary can be specified in the API call with the reserved instance name devint
which designates the latest binary.)
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application to promote. |
-n , --name string | Optional The name to assign to the version. Set to the app name + a unique ID if not specified. |
-d , --description string | Optional The description for the version. |
-v , --version-id string | Optional The ID to assign to the version. Set to app ID + a unique ID if not specified. |
-i , --instance-id string | Optional The ID to assign to the default instance. Set to the app ID if not specified. |
app push
subcommand
You must be inside your project when running this command.
The push
subcommand updates the latest binary in the cloud with your local application build. You must run this from the directory containing your application project.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application to push to. |
app result
subcommand
The result
subcommand gets the results for the application specified. Results contain the output of the run, and metadata related to the execution. If the run failed or is still in progress, then only metadata will be present in the results.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application for the run. |
-r , --run-id string | Required The id of the run. |
-o , --output string | Optional The output file to write. Stdout used if not specified. |
app run
subcommand
The run
subcommand starts a run of an application.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application to run. |
-i , --input string | Optional The input file to use (Stdin if not specified). |
-d , --input string | Optional Run the default instance. Runs the last pushed application binary if not specified. |
-w , --wait string | Optional Waits for the run to complete, and outputs results to stdout. |
-t , --timeout string | Optional The maximum time in seconds to poll for results (default 60 seconds). |
--instance string | Optional The id of the instance to use. |
-o , --options stringArray | Optional The options used in an app run. Format: --options "solve.duration=10s,other.key=value". |
Some examples of using app run
are given below.
Complete run workflow
Execute the complete run workflow (submit a run, poll for status, get the results). The output
key will contain the actual output of the run. This is an aggregation of the other steps.
New run
Submit a new run. The run_id
is returned.
Run metadata
Get a run metadata. The metadata.status
key will contain the status of the run. Use the run_id
obtained from submitting a run.
Run result
Get a run result. The output
key will contain the actual output of the run, if the output format is JSON. Use the run_id
obtained from submitting a run.
Run output
While the run result typically already contains the output, you can also get the output of a run directly. Use the run_id
obtained from submitting a run. By default, the command writes the output to an automatically generated file. The output will be written out as recorded and without any formatting.
You can get the input of a run in the same way by using the nextmv app input
command.
Get the logs of a run
You can get the logs of a run after it is finished. The logs contain everything that was printed to stderr
during the run.
Running with log tailing
You can also tail logs while running, which will show you any output your application prints to stderr
about every 30 seconds. If you use the --verbose
flag then the results will also show when the run completes.
Cancel a run
To cancel a run, use the nextmv app cancel
command.
app update
subcommand
The update
subcommand allows updating the mutable information on the specified application. The mutable information is limited to the name, description, and ID of the default instance. If the name, description, or default instance ID tag is undefined the corresponding value will not be updated.
Flag | Description |
---|---|
-a , --app-id string | Required The ID of the application to update. |
-d , --description string | Optional The application description. Will remain unchanged if not specified. |
-i , --instance-id string | Optional The default instance ID. Will remain unchanged if not specified. |
-n , --name string | Optional The application name. Will remain unchanged if not specified. |
app version
subcommand
The version
subsuite for the nextmv app
command set is used to directly and explicitly manage application versions. The default workflow for the nexmtmv app
command set handles most of the functionality of this subsuite implicitly.
Available commands for version
subsuite
Command | Description | Flags |
---|---|---|
version create | Creates a new version for your application | --app-id --version-id --name --description |
version delete | Deletes the specified application version. | --app-id --version-id --confirm |
version get | Gets the specified application version. | --app-id --version-id |
version list | Lists the versions for your application | --app-id |
version update | Updates information about an application version. | --app-id --version-id --name --description |
version create
The version create
subcommand creates a new application version with the underlying binary defined by the current active development instance (i.e. the latest binary pushed to the app)
Flag | Description |
---|---|
-a , --app-id string | Required The ID of the application to create a version for. |
-d , --description string | Optional The version description. |
-n , --name string | Optional The version name. Will be set to app name + unique id if not specified. |
-v , --version-id string | Optional The ID of the version to create. Must be unique within the application. Version ID will be generated automatically if this flag is unset. |
version delete
The version delete
subcommand deletes a specified version from your application. Note that the version cannot be deleted if there are any instances running it.
Flag | Description |
---|---|
-a , --app-id string | Required The application ID for the application to delete a version from. |
-v , --version-id string | Required The ID of the version to delete. |
--confirm boolean | Optional Set to skip prompt to delete. |
version get
The version get
subcommand gets the information related to an application version.
Flag | Description |
---|---|
-a , --app-id string | Required The application ID for the application to get a version from. |
-v , --version-id string | Required The ID of the version to get. |
version list
The version list
subcommand lists all of the versions for an application.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application to list versions for. |
version update
The version update
subcommand allows updating the mutable information on the specified version of your application. The mutable information is limited to the name and description of the version. If either the name or description tag are undefined, the corresponding value will not be updated.
Flag | Description |
---|---|
-a , --app-id string | Required The ID of the application to update the version of. |
-v , --version-id string | Required The ID of the version to update. |
-d , --description string | Optional The version description. Will remain unchanged if not specified. |
-n , --name string | Optional The version name. Will remain unchanged if not specified. |
app instance
subcommand
The instance
subsuite for the nextmv app
command set is used to directly and explicitly manage application instances. The default workflow for the nexmtmv app
command set handles limited functionality from this subsuite implicitly.
Available commands for instance
subsuite
Command | Description | Flags |
---|---|---|
instance create | Creates a new instance for your application | --app-id --instance-id --version-id --name --description --options |
instance delete | Deletes the specified application instance. | --app-id --instance-id --confirm |
instance get | Gets the specified application instance. | --app-id --instance-id |
instance list | Lists the instances for your application | --app-id |
instance update | Updates information about an application instance. | --app-id --instance-id --version-id --name --description --options |
instance create
The instance create
subcommand creates a new application instance with the underlying version specified by user input.
Flag | Description |
---|---|
-a , --app-id string | Required The ID of the application to create an instance for. |
v , --version-id string | Required The ID of the underlying version to be used by the instance. |
-d , --description string | Optional The instance description. |
-n , --name string | Optional The instance name. Will be set to app name + unique id if not specified. |
-i , --instance-id string | Optional The ID of the instance to create. Must be unique within the application. Instance ID will be generated automatically if this flag is unset. |
-o , --options stringArray | Optional The options passed to the instance. Format: --options "solve.duration=10s,other.key=value". |
instance delete
The instance delete
subcommand deletes a specified instance from your application.
Flag | Description |
---|---|
-a , --app-id string | Required The application ID for the application to delete an instance from. |
-i , --instance-id string | Required The ID of the instance to delete. |
--confirm boolean | Optional Set to skip prompt to delete. |
instance get
The instance get
subcommand gets the information related to an application instance.
Flag | Description |
---|---|
-a , --app-id string | Required The application ID for the application to get an instance from. |
-i , --instance-id string | Required The ID of the instance to get. |
instance list
The instance list
subcommand lists all of the instances for an application.
Flag | Description |
---|---|
-a , --app-id string | Required The id of the application to list instances for. |
instance update
The instance update
subcommand allows updating the information on the specified instance of your application. The instance's name, description, and the ID of the underlying version it uses can be modified. If any of these values are not defined via flags, they will not be modified
Flag | Description |
---|---|
-a , --app-id string | Required The ID of the application to update the instance of. |
-i , --instance-id string | Required The ID of the instance to update. |
-v , --version-id string | Optional The ID of the underlying version the instance uses. Will remain unchanged if not specified. |
-d , --description string | Optional The instance description. Will remain unchanged if not specified. |
-n , --name string | Optional The instance name. Will remain unchanged if not specified. |
-o , --options stringArray | Optional The options passed to the instance. Format: --options "solve.duration=10s,other.key=value". |
community
command
The community
command suite contains commands for interacting with community apps.
These are the available subcommands for the community
command:
Subcommand | Description |
---|---|
clone | Clone a community app locally. Learn more here. |
list | List the community apps and/or their versions. Learn more here |
clone
subcommand
The clone
subcommand clones a community app locally.
These are the available flags for the clone
subcommand:
Flag | Description |
---|---|
-a , --app string | The name of the app you want to clone locally. |
-d , --directory string | The directory in which to initialize the app. |
-v , --version string | The version of the app you want to clone. If not provided, the "latest" version will be used. |
list
subcommand
The list
subcommand lists the available community apps. Use the corresponding flag to list an app’s versions instead.
These are the available flags for the list
subcommand:
Flag | Description |
---|---|
-a , --app string | List the versions of the given app. |
-f , --flat boolean | Flat list of apps’s names. Flat list of an app’s versions when using the "app" flag. |
completion
command
The completion
command generates the autocompletion script for the Nextmv CLI for the specified shell.
Here is an example on displaying the completion
for zsh
:
configure
command
The configure
command adds or modifies your Nextmv API key for use with the Nextmv CLI. Running this command will create a config.yaml
file (or modify it if already present) in the directory where your nextmv
binary is located. Note that the base API endpoint will be set automatically with the default value when you pass your API key with the --api-key
flag. This command is typically run once.
These are the available flags for the configure
command:
Flag | Description |
---|---|
-a , --api-key string | Nextmv API key. |
-s , --show | Prints the current configuration. |
Here is an example where the configure
command is used to update the Nextmv API key with an environment variable.
experiment
command
To try out experiments with Nextmv, you must have a Nextmv account and be signed up for a free trial or paid account. For questions, please contact Nextmv support.
Experiments are used to test the performance of your models by running and comparing the results of various models, or a single model with multiple inputs.. From the CLI, you can create input sets and start new experiments. Experiments are run remotely on Nextmv Cloud and accessible via the Nextmv console.
Below is a list of available CLI subcommands
Command | Description |
---|---|
acceptance | A subsuite of commands to manage acceptance tests |
batch | A subsuite of commands to start batch experiments |
input-set | A subsuite of commands to manage input sets |
shadow | Commands to manage shadow tests |
acceptance
Acceptance tests are used to obtain a go/no-go decision on deploying a new version of an application. The decision is based on the results of a list of user-defined metrics.
Below is a list of available CLI subcommands
Command | Description | Flags |
---|---|---|
delete | Deletes an acceptance test. | --app-id , --experiment-id , --confirm |
init | Initializes metrics template for an acceptance test. | --metrics |
start | Starts an acceptance test. | --app-id , --baseline-instance-id , --candidate-instance-id , --confirm , --definition , --description , --experiment-id , --input-set-id , --metrics , --name , --option-sets |
acceptance delete
Delete an acceptance test.
Flag | Description |
---|---|
-a , --app-id string | The identifier for the app that the acceptance test ran on. |
--confirm | Set to skip prompt to confirm. |
-e , --experiment-id string | The identifier for the experiment - acceptance test. |
acceptance init
Initialize the template for the metrics that an acceptance test uses.
Flag | Description |
---|---|
-m , --metrics string | The location to write the metrics file to. (default "metrics.json"). |
acceptance start
Start an acceptance test.
Flag | Description |
---|---|
-a , --app-id string | The identifier for the app to use for the experiment. |
--baseline-instance-id string | The instance ID to use as the baseline for the experiment. |
--candidate-instance-id string | The instance ID to use as the candidate for the experiment. |
--confirm | Set to skip prompt to confirm. |
--definition string | The path to a definition file to use to start the experiment. |
-d , --description string | The experiment description. |
-e , --experiment-id string | The identifier for the experiment. |
-s , --input-set-id string | The input set ID to use. If not specified, a new input set will be created. |
-m , --metrics string | The location of the metrics configuration file. |
-n , --name string | The experiment name. |
-o , --option-sets string | The option sets for the experiment. Formatted as JSON, e.g '{"option1":{"diagram.expansion.limit":"1"},"option2":{"limits.duration":"100ms"}}' |
batch
Batch experiments are used to run a set of inputs against a number of application instances on Nextmv Cloud. The results are aggregated and made available to the user in the Nextmv console.
Command | Description | Flags |
---|---|---|
delete | Delete a batch experiment. | --app-id , --experiment-id , --confirm |
start | Start a batch experiment run. | --app-id , --experiment-id , --description , --name , --input-set-id , --instance-ids , --option-sets , --definition |
result | Gets the result of a batch experiment run. | --app-id , --experiment-id , --output |
batch delete
Delete a batch experiment.
Flag | Description |
---|---|
-a , --app-id string | The identifier for the app that the experiment ran on. |
--confirm | Set to skip prompt to confirm. |
-e , --experiment-id string | The identifier for the experiment. |
batch start
Start a batch experiment run.
batch result
Get the result of a batch experiment run.
input-set
Input sets are used to define named inputs for a batch experiment that can be reused across experiments.
Command | Description | Flags |
---|---|---|
create | Create an input set from historic runs | --app-id, --name, --description, --input-set-id, --instance-id, --start-time, --end-time, --run-ids --limit |
list | List input sets | --app-id |
get | Show an input set | --app-id, --input-set-id |
update | Update an input set | --app-id, --input-set-id, --name, --description |
input-set create
input-set list
input-set get
input-set update
For more information use the --help
flags for each command.
shadow
A shadow test is an experiment that runs in the background and compares the results of a baseline instance against a candidate instance. When the shadow test has started, any run made on the baseline instance will trigger a run on the candidate instance using the same input and options. For more information see the shadow tests reference.
Command | Description | Flags |
---|---|---|
create | Creates a new shadow test. |
|
list | Gets a list of all shadow tests. |
|
result | Gets the result of a shadow test. |
|
runs | Gets the runs of a shadow test. |
|
start | Starts a shadow test. |
|
stop | Stops a shadow test. |
|
shadow create
shadow list
shadow result
shadow runs
shadow start
shadow stop
help
command
The help
command displays the main help menu.
You can use help
to display the help menu for any specified command or subcommand.
marketplace
command
The marketplace
command set is used to manage marketplace commands.
These are the available Marketplace Subcommands
Command | Description |
---|---|
app | A subsuite of commands to manage marketplace applications. |
subscription | A subsuite of commands to manage marketplace subscriptions |
marketplace app
subsuite
Available marketplace app
Subcommands
Command | Description |
---|---|
create | Creates a new marketplace application. |
get | Gets a marketplace application. |
list | Lists the marketplace applications. |
update | Updates a marketplace application. |
version | Commands to manage marketplace application versions. |
marketplace subscription
subsuite
Available marketplace subscription
Subcommands
Command | Description |
---|---|
create | Creates a new marketplace subscription. |
delete | Deletes a marketplace subscription. |
get | Gets a marketplace subscription. |
list | Lists the marketplace subscriptions. |
template
command
The template
command suite contains commands for interacting with templates.
These are the available subcommands for the template
command:
Subcommand | Description |
---|---|
init | Initialize a template locally. Learn more here. |
list | List the templates and/or their versions. Learn more here |
init
template subcommand
The init
subcommand initializes a template locally.
These are the available flags for the init
subcommand:
Flag | Description |
---|---|
-t , --template string | The name of the template you want to initialize locally. |
-d , --directory string | The directory in which to initialize the template. |
-v , --version string | The version of the template you want to initialize. If not provided, the "latest" version will be used. |
list
template subcommand
The list
subcommand lists the available templates. Use the corresponding flag to list the template's versions instead.
These are the available flags for the list
subcommand:
Flag | Description |
---|---|
-t , --template string | List the versions of the given template. |
-f , --flat boolean | Flat list of template's names. Flat list of an template's version when using the "template" flag. |
update
command
The update
command updates the Nextmv CLI. If the version is not specified, it will update to the latest one.
version
command
The version
command prints the Nextmv CLI version.
App options
Apps can typically be controlled via arguments. The structure and available options may vary depending on the app. For example, the Vehicle Routing solver nextroute
accepts -model.objectives.cluster
, which receives a float value and controls the importance of the clustering objective in comparison to the other objectives. Another common use case is to control the duration limit of the solver, which can be done via -solve.duration
in the case of the unmodified nextroute
solver (e.g.: -solve.duration 10s
).
There are two cases where we want to pass options to the app:
When running the app locally.
- In case of a Nextmv SDK based app, we can pass options to the app via the
--
separator flag. For example:
- In case of a third-party app, like a Python OR-Tools based app, we can pass options just like the app expects them. For example:
- In case of a Nextmv SDK based app, we can pass options to the app via the
When running the app remotely on the platform.
- In this case, we need to pass the options via the
--options
flag. Here, options are passed as a list ofkey=value
strings separated by commas. For example:
- Note that we provide the input file separately via the
--input
flag. Nextmv CLI will upload the input file for us and the app will receive the input file via stdin on platform. Hence, the app needs to be able to read the input from stdin.
- In this case, we need to pass the options via the