# Command Line Interface

## --compile

`--compile <input file path> [output file path]` - compiles the file and exits

```
sanny.exe --compile C:\myscm.txt C:\myscm.scm
```

{% hint style="info" %}
The `output file path` parameter is optional. If there is no output path parameter, the compiler uses the [format rules](https://github.com/sannybuilder/docs/blob/en/editor/broken-reference/README.md) to compute the output file name.
{% endhint %}

{% hint style="info" %}
The input file must have no errors. If there are errors found during compilation, they will be logged in the file `compile.log`. When compilation ends, the program shuts down.
{% endhint %}

Shortcut: `-c`

## --decompile

`--decompile <input file path> [output file path]` - decompiles the file and exits

```
sanny.exe --decompile C:\myscm.scm C:\myscm.txt
```

{% hint style="info" %}
The `output file path` parameter is optional. If there is no output path parameter, the compiler uses the [format rules](https://github.com/sannybuilder/docs/blob/en/editor/broken-reference/README.md) to compute the output file name.
{% endhint %}

{% hint style="info" %}
The input file must have no errors. If there are errors found during decompilation, they will be logged in the file `compile.log`. When decompilation ends, the program shuts down.
{% endhint %}

Shortcut: `-d`

**--use-source** - optional argument that makes the decompiler use the source code [embedded in the script](https://docs.sannybuilder.com/options/general#add-extra-info-to-scm) (if present). By default the source is ignored.

```
sanny.exe --decompile C:\1.cs --use-source
```

## --debug

`--debug` - toggles [debug options](https://docs.sannybuilder.com/editor/debug-options)

```
sanny.exe --debug 110000
```

## --game

`--game <game>` - selects the [default mode](https://docs.sannybuilder.com/edit-modes#type) for the given game. Known `game` values are:

* `gta3`
* `vc`
* `sa`
* `lcs`
* `vcs`
* `vc_mobile`
* `sa_mobile`

Shortcut: `-g`

```
sanny.exe --game sa
```

## --mode

`--mode <id>` - selects the mode by `id`. [Modes](https://docs.sannybuilder.com/edit-modes) and their ids are defined in respective `mode.xml` files.

Shortcut: `-m`

```
sanny.exe --mode vcs_psp
```

## --no-splash

`--no-splash` - runs Sanny Builder without the splash screen

```
sanny.exe --no-splash
```

## -x

`-x` - reloads [edit modes](https://docs.sannybuilder.com/edit-modes) configuration (useful for testing the mode changes)

```
sanny.exe -x
```

## --option

{% hint style="info" %}
Available since v3.8.0
{% endhint %}

`-o <option name> <value>` - sets the value of the specified [option](https://docs.sannybuilder.com/editor/options). To set multiple options, list each of them individually:

`-o <option1 name> <option1 value> -o <option2 name> <option2 value> ... -o <optionN name> <optionN value>`

Option name can be one of the following:

{% hint style="warning" %}
This list is not final and subject to change at any moment.
{% endhint %}

| Name                                                                                                                  | Allowed Values  | Options Tab |
| --------------------------------------------------------------------------------------------------------------------- | --------------- | ----------- |
| [Editor::ShowPanel](https://docs.sannybuilder.com/options/editor#editor-configuration)                                | 0, 1            | Editor      |
| [Editor::ShowOpcodeInfo](https://docs.sannybuilder.com/options/editor#editor-configuration)                           | 0, 1            | Editor      |
| [Editor::ShowLineNumbers](https://docs.sannybuilder.com/options/editor#editor-configuration)                          | 0, 1            | Editor      |
| [Editor::ShowGutterBorder](https://docs.sannybuilder.com/options/editor#editor-configuration)                         | 0, 1            | Editor      |
| [Editor::OpenLastFile](https://docs.sannybuilder.com/options/editor#editor-configuration)                             | 0, 1            | Editor      |
| [Editor::OpenAllClosedFiles](https://docs.sannybuilder.com/options/editor#editor-configuration)                       | 0, 1            | Editor      |
| [Editor::ConfirmExit](https://docs.sannybuilder.com/options/editor#editor-configuration)                              | 0, 1            | Editor      |
| [Editor::LanguageService](https://docs.sannybuilder.com/options/editor#editor-configuration)                          | 0, 1            | Editor      |
| [Editor::SemanticConstHighlighting](https://docs.sannybuilder.com/options/editor#editor-configuration)                | 0, 1            | Editor      |
| [Editor::IdentifiersListAuto](https://docs.sannybuilder.com/options/editor#code-scan-distance)                        | 0, 1            | Editor      |
| [Editor::ScanDistance](https://docs.sannybuilder.com/options/editor#code-scan-distance)                               | 0..65535        | Editor      |
| [Editor::Lang](https://docs.sannybuilder.com/options/general#interface-language)                                      | known locale id | General     |
| [Editor::QuickGameLoading](https://docs.sannybuilder.com/options/general#quick-game-loading)                          | 0, 1            | General     |
| [Editor::ShowProgress](https://docs.sannybuilder.com/options/general#show-progress)                                   | 0, 1            | General     |
| [Editor::ShowReport](https://docs.sannybuilder.com/options/general#show-report)                                       | 0, 1            | General     |
| [Decompiler::OverwriteOutputFile](https://docs.sannybuilder.com/options/general#always-overwrite-output-file)         | 0, 1            | General     |
| [Decompiler::ManualIMGOpening](https://docs.sannybuilder.com/options/general#manual-img-opening)                      | 0, 1            | General     |
| [Decompiler::HexadimalOffsets](https://github.com/sannybuilder/docs/blob/en/editor/broken-reference/README.md)        | 0, 1            | Formats     |
| [Decompiler::LabelsFormat](https://github.com/sannybuilder/docs/blob/en/editor/broken-reference/README.md)            | 0, 1, 2         | Formats     |
| [Decompiler::AlwaysWriteOpcodes](https://docs.sannybuilder.com/options/general#write-opcodes)                         | 0, 1            | General     |
| [Decompiler::ReplaceMissionNumbers](https://docs.sannybuilder.com/options/general#replace-mission-numbers)            | 0, 1            | General     |
| [Decompiler::InsertOriginalMissionNames](https://docs.sannybuilder.com/options/general#insert-original-mission-names) | 0, 1            | General     |
| [Compiler::ShowIMGWarning](https://docs.sannybuilder.com/options/general#show-warning)                                | 0, 1            | General     |
| [Compiler::CheckConditions](https://docs.sannybuilder.com/options/general#check-conditions)                           | 0, 1            | General     |
| [Compiler::CheckLocalVariables](https://docs.sannybuilder.com/options/general#ranges-check)                           | 0, 1            | General     |
| [Compiler::AddExtraInfo](https://docs.sannybuilder.com/options/general#add-extra-info-to-scm)                         | 0, 1            | General     |
| [CustomNames::UseCustomLabels](https://github.com/sannybuilder/docs/blob/en/editor/broken-reference/README.md)        | 0, 1            | Formats     |
| [CustomNames::UseCustomVariables](https://github.com/sannybuilder/docs/blob/en/editor/broken-reference/README.md)     | 0, 1            | Formats     |
| [CustomNames::UseCustomArrays](https://github.com/sannybuilder/docs/blob/en/editor/broken-reference/README.md)        | 0, 1            | Formats     |
| [CustomNames::Format](https://github.com/sannybuilder/docs/blob/en/editor/broken-reference/README.md)                 | 0, 1, 2         | Formats     |

{% hint style="info" %}
Options set via CLI are not persistent and only applied to the current session. On the next launch Sanny Builder will use values stored in the `settings.ini`.
{% endhint %}

Shortcut: `-o`

```
sanny.exe -o Compiler::CheckConditions 0 -o Editor::LanguageService 1
```
