Reference

Nextmv CLI

Technical reference for the Nextmv Command Line Interface (CLI).

Nextmv CLI is a command line interface that you can use to interact with Nextmv.

go          Provides passthrough access to the packaged Go toolchain.
Copy

To display more information about a command, use the help command or one of the help global flags: --help, -h.

nextmv help
Copy

Available commands

Available commands and their corresponding subcommands. You can navigate to each section to learn more about the specific command.

CommandDescriptionSubcommands
activateActivate nextmv CLI.
appManage and interact with applications you create.create, delete, get, list, list-versions, promote, push, result, run, metadata
completionGenerate auto-completion script for a specified shell.bash, fish, powershell, zsh
configureSetup Nextmv CLI.
experimentThis command set is used to manage and run experiments.batch, input-set
goProvides passthrough access to the packaged Go toolchain.
helpDisplay help.
marketplaceCommands to manage and interact with marketplace.
sdkInstall dev tools, initialize optimization apps and run models locallyinit, install, run
updateUpdate Nextmv CLI.
versionPrint the version of Nextmv CLI.

Global Flags

Global flags that can be added to any command.

FlagDescription
-c, --config stringFull path to config file.
-h, --helpGet 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). Here is an example using the sdk run command:

nextmv sdk run main.go -c ~/.nextmv/another-config.yaml
Copy

-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:

nextmv version -h
Copy

activate command

nextmv activate [flags]
Copy

Note: Tokens auto-renew, and there is no longer an activation required to extend a token

If you receive an error message containing "Your token expired and couldn't be updated" it is advised to run the activate command. In case of any questions or issues, please contact support.

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.

This command set is used to manage and run applications. 

For this first release you can push new binaries to Nextmv Cloud and run them
remotely with Nextmv CLI or using the Nextmv Cloud API endpoints.
		
The push command publishes the local binary to Nextmv Cloud. The most recently
pushed binary will be the binary used for the remote run.
	
The promote command designates the current remote binary as a version and 
assigns it to the default application instance. For this release, a single
default application instance is supported. In the future, an application 
will have the ability to contain multiple instances with different
configurations and more.
	
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.)
	
You can access this feature by signing up for a trial, or entering into 
a paid subscription. Please contact support@nextmv.io for more information.

Usage:
  nextmv app [command]

Available Commands:
  create      Creates a new application in your account.
  delete      Deletes an application.
  get         Gets an application configured in your account.
  input       Gets an application run's input.
  instance    Commands to manage application instances.
  list        Lists the applications configured for your account.
  metadata    Gets the result metadata of an application run.
  promote     Promotes an application version.
  push        pushes the current project to a cloud application.
  result      Gets the results of an application run.
  run         Runs an application instance configured in your account.
  status      Gets the status of an application run.
  update      Updates an application.
  version     Commands to manage application versions.

Flags:
  -h, --help   Help for app.

Global Flags:
  -c, --config string   Full path to config file.

Use "nextmv app [command] --help" for more information about a command.
Copy

Available app subcommands

CommandDescriptionFlags
createCreates a new application in your account--app-id, --description, --name
deleteDeletes an application--app-id, --confirm
getGets an application configured in your account--app-id
inputGets an application run's input--app-id, --run-id, --output
instanceA subsuite of commands to manage the instances for your application
listLists the applications configured for your account
metadataGets the result metadata of an application run--app-id, --output, --run-id
promotePromotes an application version--app-id, --description, --name
pushPushes the current project to a cloud application--app-id
resultGets the results of an application run--app-id, --output, --run-id
runRuns an application instance configured in your account--app-id, --default, --input, --instance, --options, --timeout, --wait
updateUpdates an application--app-id, --description, --instance-id, --name
versionA subsuite of commands to manage the versions for your application

app create subcommand

nextmv app create [flags]
Copy

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:

FlagDescription
-a, --app-id stringRequired 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 stringRequired The name for the application.
-d, --description stringOptional The description for the application.

app delete subcommand

Deletes the application and all associated versions and instance information.

Usage:
  nextmv app delete [flags]

Examples:
  $ nextmv app delete --app-id pizza-delivery

Flags:
  -a, --app-id string   The application ID for the application to delete.
      --confirm         Set to skip prompt to delete.
  -h, --help            Help for delete.
      --json            The output to stdout is formatted as a JSON string.

Global Flags:
  -c, --config string   Full path to config file.
Copy

The delete subcommand deletes an application. When you delete an application all of the versions and instances are also deleted.

FlagDescription
-a, --app-id stringRequired The id of the application to delete.

app get subcommand

nextmv app get [flags]
Copy

The get subcommand gets the information related to an application.

FlagDescription
-a, --app-id stringRequired The id of the application to get.

app input subcommand

nextmv app input [flags]
Copy

The input subcommand gets the input for a given application run.

FlagDescription
-a, --app-id stringRequired The id of the application.
-r, --run-id stringRequired The id of the run.
-o, --output stringOptional The output file to write. Stdout used if not specified.

app list subcommand

nextmv app list [flags]
Copy

The list subcommand lists all of the applications for your account.

app metadata subcommand

Gets a run's metadata. This includes information about your run.

Usage:
  nextmv app metadata [flags]

Examples:

  $ nextmv app metadata \
    --app-id "pizza-delivery" \
    --run-id "pizza-nyc-x8AngS54g"


Flags:
  -a, --app-id string   The ID of the application used for the run.
  -h, --help            Help for metadata.
      --json            The output to stdout is formatted as a JSON string.
  -o, --output string   The output location to use. Stdout is used if not specified.
  -r, --run-id string   The ID of the run to get the results for.

Global Flags:
  -c, --config string   Full path to config file.
Copy

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.

FlagDescription
-a, --app-id stringRequired The id of the application for the run.
-r, --run-id stringRequired The id of the run.
-o, --output stringOptional The output location to use. Stdout used if not specified.

app promote subcommand

nextmv app promote [flags]
Copy

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.)

FlagDescription
-a, --app-id stringRequired The id of the application to promote.
-n, --name stringOptional The name to assign to the version. Set to the app name + a unique ID if not specified.
-d, --description stringOptional The description for the version.
-v, --version-id stringOptional The ID to assign to the version. Set to app ID + a unique ID if not specified.
-i, --instance-id stringOptional The ID to assign to the default instance. Set to the app ID if not specified.

app push subcommand

Updates the latest binary for an application in the cloud with the current 
project.

Usage:
  nextmv app push [flags]

Examples:

  $ nextmv app push --app-id pizza-delivery


Flags:
  -a, --app-id string   The ID of the application to push to.
  -h, --help            Help for push.
      --json            The output to stdout is formatted as a JSON string.

Global Flags:
  -c, --config string   Full path to config file.
Copy

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.

FlagDescription
-a, --app-id stringRequired The id of the application to push to.

app result subcommand

Gets a run result. If status is succeeded then it will return the output of
the run as well.

Usage:
  nextmv app result [flags]

Examples:

  $ nextmv app result \
    --app-id "pizza-delivery" \
    --run-id "pizza-nyc-x8AngS54g"


Flags:
  -a, --app-id string   The ID of the application used for the run.
  -h, --help            Help for result.
      --json            The output to stdout is formatted as a JSON string.
  -o, --output string   The output location to use. Stdout is used if not specified.
  -r, --run-id string   The ID of the run to get the results for.

Global Flags:
  -c, --config string   Full path to config file.
Copy

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.

FlagDescription
-a, --app-id stringRequired The id of the application for the run.
-r, --run-id stringRequired The id of the run.
-o, --output stringOptional The output file to write. Stdout used if not specified.

app run subcommand

Runs an application you have configured for your account.

Note: runs are limited to 5 minutes duration by default, please contact sales
for longer run times.

An instance indicates what binary + config you want to run. If none is
specified, then it will run the current development instance for custom apps (which Nextmv
manages for you as the latest pushed binary), or the latest instance for subscriptions. 
If the `--default` flag is set, then it will run the default instance configured
for the application. Otherwise, it will run the instance specified by the instance identifier.

Usage:
  nextmv app run [flags]

Examples:

# uses 'dev-int' instance for custom apps, and 'latest' instance for subscription apps 

  $ nextmv app run \
    --app-id "pizza-delivery" \
    --input "./input.json"
  
# using default instance (latest promoted version)

  $ nextmv app run
    --app-id "pizza-delivery" \
    --input "./input.json" \
    --default

# input via stdin with built-in polling and results display

  $ cat "./input.json" | nextmv app run \
    --app-id "pizza-delivery" \
    --wait


Flags:
  -a, --app-id string            The ID of the application to run
  -d, --default                  Run the default instance.
  -h, --help                     Help for run.
  -i, --input string             The input location to use. Input takes precedence if defined.
      --instance string          The instance ID is only required when executing an explicit instance.
      --json                     The output to stdout is formatted as a JSON string.
  -o, --options stringToString   Options passed to the run. Format: --options "solve.duration=10s,other.key=value" (default [])
  -t, --timeout int              Timeout when polling in seconds. (default 60)
  -w, --wait                     Continuously poll until results are available. Default is false.

Global Flags:
  -c, --config string   Full path to config file.
Copy

The run subcommand starts a run of an application.

FlagDescription
-a, --app-id stringRequired The id of the application to run.
-i, --input stringOptional The input file to use (Stdin if not specified).
-d, --input stringOptional Run the default instance. Runs the last pushed application binary if not specified.
-w, --wait stringOptional Waits for the run to complete, and outputs results to stdout.
-t, --timeout stringOptional The maximum time in seconds to poll for results (default 60 seconds).
--instance stringOptional The id of the instance to use.
-o, --options stringArrayOptional The options used in an app run. Format: --options "solve.duration=10s,other.key=value".

app update subcommand

nextmv app update [flags]
Copy

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.

FlagDescription
-a, --app-id stringRequired The ID of the application to update.
-d, --description stringOptional The application description. Will remain unchanged if not specified.
-i, --instance-id stringOptional The default instance ID. Will remain unchanged if not specified.
-n, --name stringOptional 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.

nextmv help app version
Copy

Available commands for version subsuite

CommandDescriptionFlags
version createCreates a new version for your application--app-id --version-id --name --description
version deleteDeletes the specified application version.--app-id --version-id --confirm
version getGets the specified application version.--app-id --version-id
version listLists the versions for your application--app-id
version updateUpdates information about an application version.--app-id --version-id --name --description

version create

nextmv app version create [flags]
Copy

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)

FlagDescription
-a, --app-id stringRequired The ID of the application to create a version for.
-d, --description stringOptional The version description.
-n, --name stringOptional The version name. Will be set to app name + unique id if not specified.
-v, --version-id stringOptional 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

nextmv app version delete [flags]
Copy

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.

FlagDescription
-a, --app-id stringRequired The application ID for the application to delete a version from.
-v, --version-id stringRequired The ID of the version to delete.
--confirm booleanOptional Set to skip prompt to delete.

version get

nextmv app version get [flags]
Copy

The version get subcommand gets the information related to an application version.

FlagDescription
-a, --app-id stringRequired The application ID for the application to get a version from.
-v, --version-id stringRequired The ID of the version to get.

version list

nextmv app version list [flags]
Copy

The version list subcommand lists all of the versions for an application.

FlagDescription
-a, --app-id stringRequired The id of the application to list versions for.

version update

nextmv app version update [flags]
Copy

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.

FlagDescription
-a, --app-id stringRequired The ID of the application to update the version of.
-v, --version-id stringRequired The ID of the version to update.
-d, --description stringOptional The version description. Will remain unchanged if not specified.
-n, --name stringOptional 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.

nextmv help app instance
Copy

Available commands for instance subsuite

CommandDescriptionFlags
instance createCreates a new instance for your application--app-id --instance-id --version-id --name --description --options
instance deleteDeletes the specified application instance.--app-id --instance-id --confirm
instance getGets the specified application instance.--app-id --instance-id
instance listLists the instances for your application--app-id
instance updateUpdates information about an application instance.--app-id --instance-id --version-id --name --description --options

instance create

nextmv app instance create [flags]
Copy

The instance create subcommand creates a new application instance with the underlying version specified by user input.

FlagDescription
-a, --app-id stringRequired The ID of the application to create an instance for.
v, --version-id stringRequired The ID of the underlying version to be used by the instance.
-d, --description stringOptional The instance description.
-n, --name stringOptional The instance name. Will be set to app name + unique id if not specified.
-i, --instance-id stringOptional 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 stringArrayOptional The options passed to the instance. Format: --options "solve.duration=10s,other.key=value".

instance delete

nextmv app instance delete [flags]
Copy

The instance delete subcommand deletes a specified instance from your application.

FlagDescription
-a, --app-id stringRequired The application ID for the application to delete an instance from.
-i, --instance-id stringRequired The ID of the instance to delete.
--confirm booleanOptional Set to skip prompt to delete.

instance get

nextmv app instance get [flags]
Copy

The instance get subcommand gets the information related to an application instance.

FlagDescription
-a, --app-id stringRequired The application ID for the application to get an instance from.
-i, --instance-id stringRequired The ID of the instance to get.

instance list

nextmv app version list [flags]
Copy

The instance list subcommand lists all of the instances for an application.

FlagDescription
-a, --app-id stringRequired The id of the application to list instances for.

instance update

nextmv app instance update [flags]
Copy

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

FlagDescription
-a, --app-id stringRequired The ID of the application to update the instance of.
-i, --instance-id stringRequired The ID of the instance to update.
-v, --version-id stringOptional The ID of the underlying version the instance uses. Will remain unchanged if not specified.
-d, --description stringOptional The instance description. Will remain unchanged if not specified.
-n, --name stringOptional The instance name. Will remain unchanged if not specified.
-o, --options stringArrayOptional The options passed to the instance. Format: --options "solve.duration=10s,other.key=value".

completion command

nextmv completion [command]
Copy

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:

nextmv help completion zsh
Copy

configure command

nextmv configure [flags]
Copy

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:

FlagDescription
-a, --api-key stringNextmv API key.
-s, --showPrints the current configuration.

Here is an example where the configure command is used to update the Nextmv API key with an environment variable.

nextmv configure -a $API_KEY
Copy

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.

shadow      Commands to manage shadow tests
Copy

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

Available Experiment Commands

CommandDescription
batchA subsuite of commands to start batch experiments
input-setA subsuite of commands to manage input sets
shadowCommands to manage shadow tests

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.

CommandDescriptionFlags
startStart a batch experiment run.--app-id, --experiment-id, --description, --name, --input-set-id, --instance-ids, --option-sets, --definition
resultGets the result of a batch experiment run.--app-id, --experiment-id, --output

batch start

Starts a batch run for an experiment. By default, it will
create a new input set from up to the last 20 runs in the last 24 hours on the 
default instance, create a new version from the current binary and assign the
version to the default test instance, and then run the batch experiment using the
test instance and default instance for the app. 

If instance-id(s) are given with no input set id, an input set is created with
up to the last 20 runs in the last 24 hours from first instance-id given.

A batch experiment tests each instance id against each input from the input set.
The number of runs this command creates is the number of instances times the number
of inputs. You can use the Nextmv Console to view the results of the batch run.

In addition you can define a batch experiment using a definition file. The definition
file is the payload sent to the API to start the experiment. More information on the
definition file can be found in the HTTP API documentation.

Usage:
  nextmv experiment batch start [flags]

Examples:
  # simple start
  $ nextmv experiment batch start \
      --experiment-id "pizza-delivery-v1-compare" \
      --app-id "pizza-delivery" \
      --name "Pizza Delivery V1 Compare"


  # complex start
  $ nextmv experiment batch start \
      --app-id "pizza-delivery" \
      --experiment-id "pizza-delivery-region-compare" \
      --name "Pizza Delivery Region Compare" \
      --description "Compares NYC and Philly region configuration" \
      --input-set-id "past-day-runs-nyc-pizza" \
      --instance-ids "nyc-pizza-region,philly-pizza-region"

  # initiate an experiment from a definition file
  $ nextmv experiment batch start \
      --app-id "pizza-delivery" \
      --definition "experiment.json"


Flags:
  -a, --app-id string          The identifier for the app to use 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.
  -h, --help                   Help for start.
  -s, --input-set-id string    The input set ID to use. If not specified, a new input set will be created.
  -i, --instance-ids strings   The instance IDs to compare. If not specified uses the current dev binary and default instance.
  -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"}}'

Global Flags:
  -c, --config string   Full path to config file.
Copy

batch result

nextmv experiment batch result [flags]
Copy

input-set

Input sets are used to define named inputs for a batch experiment that can be reused across experiments.

CommandDescriptionFlags
createCreate an input set from historic runs--app-id, --name, --description, --input-set-id, --instance-id, --start-time, --end-time, --run-ids --limit
listList input sets--app-id
getShow an input set--app-id, --input-set-id
updateUpdate an input set--app-id, --input-set-id, --name, --description

input-set create

nextmv experiment input-set create [flags]
Copy

input-set list

nextmv experiment input-set list [flags]
Copy

input-set get

nextmv experiment input-set get [flags]
Copy

input-set update

nextmv experiment input-set update [flags]
Copy

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 DescriptionFlags
createCreates a new shadow test.
  • -a, --app-id (string)
  • -x, --baseline-instance-id (string)
  • -y, --candidate-instance-id (string)
  • -d, --description (string)
  • -e, --end-time (string)
  • -h, --help
  • -m, --maximum-runs (int)
  • -n, --name (string)
  • -i, --shadow-test-id (string)
  • -s, --start-time (string)
listGets a list of all shadow tests.
  • -a, --app-id (string)
  • -h, --help
resultGets the result of a shadow test.
  • -a, --app-id (string)
  • -h, --help
  • -i, --shadow-test-id (string)
runsGets the runs of a shadow test.
  • -a, --app-id (string)
  • -h, --help
  • -i, --shadow-test-id (string)
startStarts a shadow test.
  • -a, --app-id (string)
  • -h, --help
  • -i, --shadow-test-id (string)
stopStops a shadow test.
  • -a, --app-id (string)
  • -h, --help
  • -r, --intent (string)
  • -i, --shadow-test-id (string)

shadow create

nextmv experiment shadow create \
  --app-id "pizza-delivery" \
  --shadow-test-id "pizza-shadow-test" \
  --name "pizza-delivery-region-compare" \
  --baseline-instance-id "pizza-delivery-nyc-production" \
  --candidate-instance-id "pizza-delivery-nyc-candidate" \
  --start-time "2021-09-01T16:00:00Z" \
  --end-time "2023-09-30T00:00:00Z" \
  --maximum-runs 50
Copy

shadow list

nextmv experiment shadow list \
  --app-id "pizza-delivery"
Copy

shadow result

nextmv experiment shadow result \
  --app-id "pizza-delivery" \
  --shadow-test-id "pizza-shadow-test"
Copy

shadow runs

nextmv experiment shadow runs \
  --app-id "pizza-delivery" \
  --shadow-test-id "pizza-shadow-test"
Copy

shadow start

nextmv experiment shadow start \
  --app-id "pizza-delivery" \
  --shadow-test-id "pizza-shadow-test"
Copy

shadow stop

nextmv experiment shadow stop \
  --app-id "pizza-delivery" \
  --shadow-test-id "pizza-shadow-test" \
  --intent "complete"
Copy

For more information use the --help flags for each command.

go command

nextmv go [go command] [arguments] [flags]
Copy

The go command provides a passthrough to the Nextmv-managed Go toolchain.

Provides passthrough access to the packaged Go toolchain.

Usage:
  nextmv go [go command] [arguments] [flags]

Examples:
  $ nextmv go version

Flags:
  -h, --help   Help for go.

Global Flags:
  -c, --config string   Full path to config file.
Copy

help command

nextmv help [command] [flags]
Copy

The help command displays the main help menu.

A Command Line Interface (CLI) to interact with the Nextmv Platform.

Usage:
  nextmv [command]

Available Commands:
  activate    Activate nextmv CLI.
  app         Commands to manage and interact with your applications.
  community   Interact with community apps.
  completion  Generate the autocompletion script for the specified shell
  configure   Configure the Nextmv CLI.
  experiment  Commands to run and manage experiments (beta).
  go          Provides passthrough access to the packaged Go toolchain.
  help        Help about any command
  marketplace Commands to manage and interact with marketplace.
  sdk         Install dev tools, initialize optimization templates and run models locally.
  update      Updates the CLI tool.
  version     Prints the Nextmv CLI version.

Flags:
  -c, --config string   Full path to config file.
  -h, --help            Help for nextmv.

Use "nextmv [command] --help" for more information about a command.
Copy

You can use help to display the help menu for any specified command or subcommand.

Here is an example where the help command is used to display the help for the sdk run command:

nextmv help sdk run
Copy

marketplace command

The marketplace command set is used to manage marketplace commands.

This command set is used to manage marketplace commands.

Usage:
  nextmv marketplace [command]

Available Commands:
  app          Commands to manage marketplace applications.
  subscription Commands to manage marketplace subscriptions.

Flags:
  -h, --help   Help for marketplace.

Global Flags:
  -c, --config string   Full path to config file.

Use "nextmv marketplace [command] --help" for more information about a command.
Copy

Available Marketplace Subcommands

CommandDescription
appA subsuite of commands to manage marketplace applications.
subscriptionA subsuite of commands to manage marketplace subscriptions

marketplace app subsuite

This command set is used to directly handle marketplace applications.
	
Unlike the top level application command set, this one can be used to manage marketplace
applications instances explicitly.

Usage:
  nextmv marketplace app [command]

Available Commands:
  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.

Flags:
  -h, --help   Help for app.

Global Flags:
  -c, --config string   Full path to config file.

Use "nextmv marketplace app [command] --help" for more information about a command.
Copy

Available marketplace app Subcommands

CommandDescription
createCreates a new marketplace application.
getGets a marketplace application.
listLists the marketplace applications.
updateUpdates a marketplace application.
versionCommands to manage marketplace application versions.

marketplace subscription subsuite

This command set is used to directly handle marketplace subscriptions.

Usage:
  nextmv marketplace subscription [command]

Available Commands:
  create      Creates a new marketplace subscription.
  delete      Deletes a marketplace subscription.
  get         Gets a marketplace subscription.
  list        Lists the marketplace subscriptions.

Flags:
  -h, --help   Help for subscription.

Global Flags:
  -c, --config string   Full path to config file.

Use "nextmv marketplace subscription [command] --help" for more information about a command.
Copy

Available marketplace subscription Subcommands

CommandDescription
createCreates a new marketplace subscription.
deleteDeletes a marketplace subscription.
getGets a marketplace subscription.
listLists the marketplace subscriptions.

sdk command

This command set is used to interact with local development tools.

Dev tools can be downloaded, templates can be initialized, and models can be run
through this command package. In order to run templates locally, dev tools must
first be installed.

Usage:
  nextmv sdk [command]

Available Commands:
  install     Installs latest or specified version of SDK.
  run         Run app locally.

Flags:
  -h, --help   Help for sdk.

Global Flags:
  -c, --config string   Full path to config file.

Use "nextmv sdk [command] --help" for more information about a command.
Copy

The sdk command suite contains commands for downloading and using Nextmv plugins for local development.

These are the available subcommands for the sdk command:

SubcommandDescription
initInitialize a new Nextmv template. Learn more here.
installInstalls Nextmv plugin dependencies. Learn more here
runRun app locally. Learn more here.

init subcommand

DEPRECATED, use "nextmv community clone" instead.

Generate a new Nextmv model from a template.

Usage:
  nextmv sdk init [flags]

Examples:

# Example generating nextroute template (in a nextroute directory)
nextmv sdk init -t nextroute

# Example generating nextroute template in ~/sample/my_app
nextmv sdk init -t nextroute -d ~/sample/my_app


Flags:
  -d, --directory string   The directory in which to generate the template files, default is the name of the template at current directory.
  -h, --help               Help for init.
  -t, --template string    The type of Nextmv model template you wish to generate.

Global Flags:
  -c, --config string   Full path to config file.
Copy

The init subcommand initializes a new Nextmv template. A template is a ready-to-run application that solves a decision automation problem.

Available apps

Nextmv CLI comes with a set of apps to help you start building your own apps. Currently, the apps cover the areas Vehicle Routing and Mixed Integer Problems using different solvers. For a more in depth understanding of how to use each of these apps, visit the SDK reference page.

These are the available flags for the init subcommand:

FlagDescription
-d, --directory stringThe directory in which to initialize the template.
-t, --template stringThe type of Nextmv template you wish to generate.

Here is an example where the init subcommand is used to generate the knapsack template.

nextmv community clone -a knapsack-gosdk
Copy

After initializing the template, you can use the tree command to check the contents of the knapsack dir:

ls -v knapsack-gosdk
Copy

install subcommand

nextmv sdk install [version] [flags]
Copy

The install subcommand downloads the latest version of the SDK shared object files (or the version specified, if given) and the Nextmv-managed Go executable for your architecture.

These are the available flags for the install subcommand:

FlagDescription
-r, --root stringThe GOROOT used.

Here is an example where the install subcommand is used to check that all the necessary files and the Nextmv-managed Go executable are already installed:

nextmv sdk install
Copy

run subcommand

  • It is best practice to set a duration limit when running locally. Do this by passing the -- -limits.duration flag. You can read more about solver flags here.
  • When running a Nextmv application, if no input path is given, you may provide input via stdin.
nextmv sdk run package [flags]
Copy

The run subcommand allows you to compile and run custom code consuming the Nextmv SDK.

These are the available flags for the run subcommand:

FlagDescription
-d, --debug-flagsIf set, this will insert -gcflags='all=-N -l' and -tags=debug to Go for debugging Nextmv applications.
-r, --root stringThe GOROOT used.

Runner and solver options are passed using --.

Here is an example where the sdk init and sdk run commands are used to run the routing template. The input is read from the input.json file and the output is saved to an output.json file.

update command

nextmv update [version] [flags]
Copy

The update command updates the Nextmv CLI. If the version is not specified, it will update to the latest one.

version command

nextmv version [flags]
Copy

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:

  1. 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:
    nextmv sdk run . -- -runner.input.path input.json -solve.duration 10s
    
    Copy
    • 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:
    python main.py -input input.json -duration 10
    
    Copy
  2. 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 of key=value strings separated by commas. For example:
    nextmv app run \
      --app-id routing-app \
      --input input.json \
      --options "solve.duration=10s,model.objectives.cluster=1.0"
    
    Copy
    • 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.

Page last updated

Go to on-page nav menu