Using Varjo Command-line interface (Beta)

The Varjo Command-line interface (Beta) is a tool that gives you scriptable access to control Varjo Base. For example, you can adjust settings, and initiate calibrations directly from the tool without opening Varjo Base user interface. Note that the command-line interface is not a replacement for Varjo API. It is meant to be used for automation, not integration.  

The command-line interface is included in the Varjo Base installation package. To locate the tool, navigate to C:\Program Files\Varjo\varjo-cli or to the folder where you have saved the Varjo Base installation files. 

We recommend saving the tool files to PATH. This makes it easier to call the tool anywhere. Read more about How to: Add Tool Locations to the PATH Environment Variable | Microsoft Learn

Note that the command-line interface is available with Varjo Base release version 4.12 onwards, and running commands requires a Varjo Base Pro license.

How to use commands 

To run commands in the command-line interface, always start with varjocli and then write the command you want to run. The following is an example of the structure: 

varjocli [Global options] Command [Subcommand] [Options] 

Example command: 

varjocli --timestamps settings import --file=example.json 

Note that when you update your Varjo Base version, remember to check if there have been any changes to the commands.

Available commands and options

The following tables list all possible commands, subcommands and options that you can run with the command-line interface: 

Global options 

Description 

--help 

 

Prins a help message. 

--help-all 

Prints a help message, commands, and subcommands. 

--version 

Prints the program version information. 

--timestamps 

Shows the time for each message in the tool. 

--exit-codes 

Prints a list of exit codes and their meanings. 


Command and subcommand 

Options 

Description 

Requires a connected headset 

start 
  • --skip-ftu: First-time setup is skipped. 
  • --skip-base: Varjo Base user interface will not start. 

Starts Varjo Base.  

No 

stop 

 

Closes Varjo Base user interface and stops Varjo System. 

No 

restart 

 

Restarts Varjo System. 

No 

settings import 
  • --file: Specify the file which includes the settings that are imported. 
  • --allow-partial: Allows a set of settings to be imported. 
  • --allow-extra: Allow unknown fields in the settings file.  
  • --allow-restart: Allows Varjo System to restart without a separate prompt after importing the settings. 
  • --skip-restart: Varjo System will not restart after the settings are imported. 

 

Import settings from stdin or a file. 

By default, the file needs to include all settings values, and it cannot contain any extra fields that the current Varjo Base version does not recognize. Use --allow-partial and --allow-extra to use files that contain extra fields or do not include all necessary fields.   

Importing settings will prompt a restart if one is needed. Disable the prompt with --allow-restart or --skip-restart option. 

Yes 

settings export 
  • --file: Specify the file where the settings are exported. 

Exports Varjo Base settings to either stdout or to a separate file. 

Yes 

settings list 

 

Prints all available keys and values for get and set commands. 

No 

settings set <key=value> <key=value> ... 
  • --allow-restart: Allows Varjo System to restart without a separate prompt after the settings are changed. 
  • --skip-restart: Varjo System will not restart after the settings are changed. 
  • --show-allowed-values: Lists all available values for the setting. 

Changes Varjo Base settings according to the given values.  

 

Changing settings will prompt a restart if one is needed. Disable the prompt with --allow-restart or --skip-restart option. 

 

Yes, for the following settings: 

  • AutoExposure 
  • Exposure 
  • FlickerCompensation 
  • FocusDistance
  • ISO 
  • MixedRealityBrightness 
settings get <key> 
  • --show-allowed-values: Lists all available values for the setting. 

Prints the current value of the requested setting.  

Yes, for the following settings: 

  • AutoExposure 
  • Exposure 
  • FlickerCompensation 
  • FocusDistance 
  • ISO 
  • MixedRealityBrightness 
settings reset 

 

All settings are reset to their default state. 

No 

show state 

 

Prints the overall Varjo System state. 

You can run other commands when the system is in RUNNING state. 

All possible system states are: 

  • STARTING: The system is in the process of initiating. 
  • RUNNING: The system is fully operational and functioning as expected. 
  • STOPPING: The system is in the process of shutting down. 
  • STOPPED: The system has been completely shut down and is not operational. 
  • ERROR: The system has encountered an issue and is not functioning correctly. 

No 

show info 

 

Prints Varjo Base information including details about any attached hardware. 

No 

show errors 

 

Prints the current errors. 

No 

calibrate gaze 

 

Calibrates eye tracking using the calibration method that is selected in the settings. 

Yes 

calibrate room 

 

Starts the room setup for Varjo inside-out tracking. 

 

Yes 

capture video 
  • --start: Starts the recording. 
  • --stop: Stops the recording. 

 

Records a video of the headset view. 

Yes 

capture screenshot 

 

 

Captures a screenshot of the headset view. 

Yes 

Note that each command exposes help texts in the tool itself. 

Return codes 

After running a command, the command-line interface will display a return code stating if the command was run successfully or if there was an error. The following return codes are possible: 

Return code 

Description 

RETURN_SUCCESS (0) 

The command was successful. 

RETURN_FAIL (1) 

The command failed. 

RETURN_FILE_ERROR (2) 

Given input or output file could not be read or written. 

RETURN_VARJO_SYSTEM_NOT_RUNNING (3) 

The command cannot be performed because Varjo System is not running. Start Varjo System and try again. 

RETURN_HARDWARE_FAULT (4) 

The command failed due to hardware. 

RETURN_OPERATION_INVALID (5) 

The command is not valid. 

RETURN_OPERATION_USER_CANCELLED (6) 

The command was canceled by the user. 

RETURN_NO_LICENSE (7) 

This command requires a Varjo Base Pro license.