Get started
Overview of the Nextmv Command Line Interface (CLI).
The CLI is currently only available as a private beta for use with Nextmv Cloud. To find out more or to request access, please contact support.
The Nextmv CLI is a command line interface that you can use to interact with Nextmv, including submitting and retrieving run results for Nextmv Cloud or creating custom models locally, with simple commands. You can find more information, including available commands, flags, and usage examples, in the sections below.

Usage

Bash
nextmv [command]

Available Commands

Available commands, subcommands, and their flags are detailed below.

configure

Configure the Nextmv CLI with your Nextmv Cloud API key and a base API endpoint. Running this command will create a .nextmv/config.yaml file in the directory where your nextmv binary is located. Note that the base API endpoint will be created automatically with the default when you pass your API key with the --apiKey flag.
Bash
nextmv configure --apiKey <your API key>
Available flags for configure
Flag
Description
-a, --apiKey string
Nextmv Cloud API key.
-e, --endpoint string
Base URL used for calls to Nextmv Cloud. Default is api.cloud.nextmv.io.

run submit

Submit an input file to Nextmv Cloud and start a run. The --input|-i flag is mandatory if data is not piped in through stdin.
Bash
nextmv run submit --input path/to/input.json
This submits the input to Nextmv Cloud and returns the run ID:
Bash
{
"runID": "45f3e1c6-..."
}
The returned format for the standard run submit command is always JSON.
--wait
Alternatively, the submit, status, and result run subcommands can be combined into a single command by adding the --wait flag to run submit:
Bash
nextmv run submit --input path/to/input.json --wait
When the status returns completed, this submits the input, retrieves the run ID, polls the status, and then returns the result. When the --wait flag is used, then all of the flags and functionality associated with run result are made available to run submit.
For example, use the --format flag to specify the format of the returned result:
Bash
nextmv run submit --input path/to/input.json --wait --format csv
Or, to save the output directly to a file, use the --output flag:
Bash
nextmv run submit --input path/to/input.json --wait --format csv --output
When using the --wait flag, the process will, by default, poll run status for 60 seconds until timing out. This amount of time can be adjusted with the --timeout flag:
Bash
nextmv run submit --input path/to/input.json --wait --timeout 10
Available flags for run submit
Flag
Description
--array
If used with --wait, and the format is JSON, the result is always returned in an array (see the run result section for more information).
-f, --format
When used with --wait, specifies the format of the returned result. Options are json (default) or csv.
-i, --input string
Path to the input file. Required if the input is not piped through stdin.
-o, --output
Default value is false. If true and used with the --watch flag, creates a <runid>.<format> file in an output directory instead of sending result data to stdout. The output directory is created if it does not exist.
-r, --runProfile string
Specify a run profile ID to use for the run.
-t, --timeout int
Set timeout when polling in seconds. Default is 60 seconds.
-w, --wait
Run the complete process including submit, polling for results, and results retrieval on success.

run result

The result of a completed run can be retrieved by passing the run ID to the run result command:
Bash
nextmv run result <runID>
By default, the result will be printed directly in stdout. To save the returned output in a file, use the --output flag:
Bash
nextmv run result <runID> --output
This will save the result in an output directory and the filename will be <runID>.json. (The output directory will be created if it doesn’t exist). If the run result is not available, a 404 error will be returned.
The run result command can also retrieve multiple run results by passing multiple run IDs:
Bash
nextmv run result <runID1> <runID2> <runID3>
If the format is JSON, the results of each run will be returned in a single array. The result can be specified to always return in an array with the --array flag:
Bash
# 3 results returned in array
nextmv run result <runID1> <runID2> <runID3> --array
# 1 result returned in array
nextmv run result <runID> --array
If CSV format is specified, the results will be combined into a single CSV file:
Bash
nextmv run result <runID1> <runID2> <runID3> --format csv
When using the --output flag with multiple run IDs, the CLI will prefix the file name with a multiple-runs slug followed by the first run ID specified.
Bash
# file name will be multiple-runs-<runID1>.json
nextmv run result <runID1> <runID2> <runID3> --output
To have run result continuously poll until results are available, add the --poll flag (default behavior is to not poll). The --timeout flag can be used with the --poll flag to adjust the polling duration.
Bash
nextmv run result <runID> --poll --timeout 10
Available flags for run result
Flag
Description
--array
If the format is JSON, then the result is always returned in an array.
-f, --format string
Specifies the format of the returned result. Options are json (default) or csv.
-o, --output
If true, creates a <runid>.<format> file in an output directory instead of sending result data to stdout. The output directory is created if it does not exist. Default value is false.
-p, --poll
Continuously poll until results are available. Default is false.
-t, --timeout int
Set timeout when polling in seconds. Default is 60 seconds.

run status

The status of a submitted run can be checked with the run ID.
Bash
nextmv run status <runID>
This will return the status of the run:
Bash
Run status <runId>
Status SUCCEEDED
Or, when used with the --format flag:
Bash
# command
nextmv run status <runId> --format json
# result
{
"status": "succeeded",
"error": ""
}

Shorthand for run

The run command can be called with a shorthand r:
Bash
nextmv r submit --input path/to/file.json
nextmv r status <runID>
nextmv r submit <runID>

sdk

NOTE: You must have access to a private beta for this feature. Contact support for more information.
sdk is used to interact with SDK commands:
Download the most recent SDK version for your architecture with the get command.
Bash
nextmv sdk get [flags]
The build command compiles the named main package that consumes SDK shared object files and Nextmv's SDK package. This is equivalent to go build -trimpath [packages].
Bash
nextmv sdk build package [flags]
Compile and run custom code consuming Nextmv's SDK package with the run command. This is equivalent to go run -trimpath package.
Bash
nextmv sdk run [packages] [flags]

help

Get help with any command or subcommand.
Bash
nextmv help run
nextmv help run result
Alternatively, the --help or -h flags can be added to the end of any command to view the help menu for that command (see global flags for usage).
Bash
nextmv run --help
nextmv run result --help

completion

Generate the autocompletion script for the specified shell. Running nextmv completion will display a list of available subcommands to support various platforms. Run any of the subcommands with the --help flag to see further instructions for that platform.
Bash
nextmv completion bash --help
Supported platforms:
  • bash
  • fish
  • powershell
  • zsh

Global Flags

These flags can be added to any command. The --help flag will display the help menu for the specified command. And the --config flag instructs the command to use the config file that is passed to the --config flag instead of the standard configuration file created with nextmv configure (though note that the existing configuration file is not modified in any way).
Flag
Description
-h, --help
Get help for command.
-c, --config string
Full path to config file
Export as PDF
Copy link