Try our new documentation site (beta).

Gurobi Command-Line Tool

The Gurobi command-line tool allows you to perform simple commands without the overhead or complexity of an interactive interface. While the most basic usage of the command-line tool is quite straightforward, the tool has a number of uses that are perhaps less obvious. This section talks about its full capabilities.

To use this tool, you'll need to type commands into a command-line interface. Linux and Mac users can use a Terminal window. Windows users will need to open a Command Prompt (also known as a Console window or a cmd window). To launch one, hold down the Start and R keys simultaneously, and then type cmd into the Run box that appears.

The command to solve a model using the command-line tool is:

gurobi_cl [parameter=value]* modelfile
The Gurobi log file is printed to the screen as the model solves, and the command terminates when the solve is complete. Parameters are chosen from among the Gurobi parameters. The final argument is the name of a file that contains an optimization model, stored in MPS or LP format. You can learn more about using the command-line tool to solve models in this section.

The command-line tool can also be used to replay recordings of API calls. The command for this usage is:

gurobi_cl recordingfile
A recording file is a binary file generated by Gurobi with a .grbr extension. You can learn more about using the command-line tool to replay recordings in this section.

The command-line tool can also be used to check on the status of a Gurobi token server. The command is:

gurobi_cl --tokens
This command will show you whether the token server is currently serving tokens, and which users and machines are currently using tokens.

You can also type:

gurobi_cl --help
to get help on the use of the tool, or:
gurobi_cl --version
to get version information, or:
gurobi_cl --license
to get the location of the current Gurobi license file.


Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.