---
title: "Work with ShogunPostCL"
canonical: "https://help.vicon.com/space/ShogunPost121/1253736791/Work%20with%20ShogunPostCL"
format: markdown
---
ShogunPostCL is a command-line version of Shogun Post and is mainly used as a worker when batch farming multiple files. However, ShogunPostCL can be used outside of batch processing, for example, to use the software to run a script on an input file and then save an output file. 

The following information describes how to use ShogunPostCL.

> Macro (toc)

> Macro (anchor)



## Open ShogunPostCL

You can open ShogunPostCL in Normal mode in the following ways. In this mode, ShogunPostCL runs as a controller (master). After you have opened ShogunPostCL in Normal mode, if required, you can set it to Worker mode, as described in [Run ShogunPostCL in Worker mode](#ShogunPostCLWorkerMode).

**Open ShogunPostCL from the Command Prompt:**

1. Open the Command Prompt (enter `CMD` into the Search field in the Windows taskbar).
2. Change the directory to *C:\Program Files\Vicon\ShogunPost#.#*.
3. Enter `ShogunPostCL.`  
ShogunPostCL runs in Normal mode.

**Open ShogunPostCL using the executable (.*****exe***** file):**

1. Go to *C:\Program Files\Vicon\ShogunPost#.#*.
2. Double-click *ShogunPostCL.exe*.  
ShogunPostCL runs in Normal mode.

> ℹ️ **Open ShogunPostCL from within Shogun Post**  
> ℹ️ You can open ShogunPostCL in Worker mode from within Shogun Post (see [Run ShogunPostCL in Worker mode](#ShogunPostCLWorkerMode)).

For a full list of arguments or options you can use with ShogunPostCL, enter `ShogunPostCL -help` into the command line.

In all modes, to quit ShogunPostCL, enter `exit`.

For more information about controller and worker modes, see [Run ShogunPostCL in Worker mode](#ShogunPostCLWorkerMode) and [Batch process files in Shogun Post](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737847).

## ShogunPostCL additional modes

In addition to running ShogunPostCL in Normal mode, as described in [Open ShogunPostCL](#ShogunPostNormalMode), you can run ShogunPostCL in the following additional modes.

> Macro (toc)

> Macro (anchor)



### Run ShogunPostCL in Worker mode

To use ShogunPostCL as a worker for processing multiple files with a batch farm, you must put ShogunPostCL into Worker mode.

To run ShogunPostCL in Worker mode, after you have opened ShogunPostCL (see [Open ShogunPostCL](#ShogunPostNormalMode)), enter the following command:

`slave on`

ShogunPostCL connects to the controller (main instance of Post which is distributing the batch work) and is ready to run batch work.

> ![ShogunPostCL-slave-on.png](media://48a845c9-57fa-4915-80a7-76e755d9b56a)

You can also run ShogunPostCL as a worker by opening it from within Shogun Post:

1. Open the **Batching** panel.
2. Expand **Farm** and click **Launch ShogunPostCL**.

For more information on batch farming, see [Batch process files in Shogun Post](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737847).

> Macro (anchor)



#### Group workers and a controller

If required, you can group workers and their controller so that, for example, workers in a specified workgroup only process files from the controller in the same workgroup. For example, if you specify the workgroup name as **A** for the relevant workers and controller, workers in workgroup **A** only process files from controller **A**. 

To view or specify the name of the workgroup and port: 

- In the instance of Shogun Post you are using as the controller of the batch farm, open the **Batching** panel, expand the **Farm** section, and note or change the name in **Work Group** and the port number in **Broadcast Port**.
- In the worker instances, to specify the workgroup name and port, when you open ShogunPostCL in worker mode, use the following options:   
`ShogunPostCL -slave WorkgroupName Port`  
The `Port` option enables you to specify the port for the worker to use when communicating with the controller. Set it to the same port as the broadcast port used in the Farm section of the controller.  
For example:  
`ShogunPostCL -slave A 5419`

> Macro (scroll-pagebreak)

> Macro (anchor)



### Run a startup script with ShogunPostCL

You can run a script as a startup option to ShogunPostCL, for example to run a script that handles file input and output or to configure settings on startup before connecting to the Python API.

To run a script on starting ShogunPostCL, enter this command:

`ShogunPostCL -runscript "script"`

Where:

`"script"` - Name (including the full path and filename with .*hsl* extension) of the script that you want ShogunPostCL to run. (If you enter the name of a non-existent script, ShogunPostCL displays an error message.)

For example:

`ShogunPostCL -runScript C:\MyFolder\MyScripts\ScriptName.hsl`

After running the script, ShogunPostCL remains open in the command prompt window until you enter `exit`, unless the script it ran contained an exit command.

### Run ShogunPostCL in Old mode

Old mode processes files using a given HSL script. To run ShogunPostCL in Old mode, enter this command:

`ShogunPostCL -old "InFile" "Script" "OutFile"`

Where:

`-old` - Runs ShogunPostCL in the original ShogunPostCL processing mode

`"InFile"` – The path to the file to process, including the name of the file

`"Script"` – The name of the HSL script to run

`"OutFile"` – The path to where you want to save the processed file, including the name of the file

> Macro (16dcb1b2-c6fb-4c23-a096-38455b87e6a8/1fa5e51a-a28e-46e1-9b5c-734b339f025f/static/scroll-pagebreak)

### Run ShogunPostCL in Batch mode

Batch mode is a legacy mode from older versions of ShogunPostCL. We do not advise using ShogunPostCL in Batch mode as it is easier to run processes using the user interface in Shogun Post (see [Batch process files in Shogun Post](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737847)).

However, if you need to use the legacy mode, enter the following command to run ShogunPostCL in Batch mode.

`ShogunPostCL -batch FilePath`

This mode processes files based on the batch values in an .*ini* file. Provide the file path to the .*ini *file containing the batch files.