# CLI Commands

{% hint style="success" %}
**Required programs**

* [GitBash](https://git-scm.com/downloads) to perform CLI commands
* [WinSCP](https://winscp.net/eng/download.php) for file uploading through CLI
  {% endhint %}

## How to use

1. In your terminal navigate where the **PatchManager** is located.
2. Run the program using `PatchManager.exe -i`
3. Perform your commands.

<figure><img src="/files/mtMUDs5ezXcy2OntaPsI" alt=""><figcaption><p>PatchManager ready to execute commands</p></figcaption></figure>

### Script for Create Patch and Upload to Host

This script will create the patch and then it will upload your App to your host automatically.\
Just put your game in the App folder.

{% code title="CreateAppPatch.bat" %}

```batch
@echo off
REM ====================================================
REM © Game Launcher - Create Patch and Upload to Host
REM ====================================================

REM ====================================================
REM Configuration
REM ====================================================
set "FTP_HOST=ftp.example.com"
set "FTP_USER=your_username"
set "FTP_PASS=your_password"

set "HOST_URL=https://game-launcher.net/GameLauncher/"
set "ENVIRONMENT=Release" REM Release or Beta
set "REMOTE_PATH=/public_html/GameLauncher/App/%ENVIRONMENT%"

REM ====================================================
REM Create the patch with PatchManager and then close it
REM ====================================================
(
  echo --app-workspace
  echo --url=%HOST_URL%
  echo -c
  echo --exit
) | PatchManager.exe -i

REM ====================================================
REM Upload files using WinSCP via a temporary script
REM ====================================================
(
  echo open ftp://%FTP_USER%:%FTP_PASS%@%FTP_HOST%/
  echo lcd "%CD%\App Workspace\%ENVIRONMENT%\Output"
  echo cd %REMOTE_PATH%
  echo put *
  echo exit
) > winscp_script.txt

REM Execute WinSCP with the temporary script file using the full path
"C:\Program Files (x86)\WinSCP\winscp.com" /script=winscp_script.txt

REM Delete the temporary WinSCP script file
del winscp_script.txt

echo Process completed. Patch created and files uploaded.
pause

```

{% endcode %}

## CLI Commands Documentation

### Initialization

#### `-i, --init`

**Description:** Initialize the CLI.

### General Commands

#### `-v, --version`

**Description:** Display the patch manager version.

#### `-c, --create`

**Description:** Create a new patch.

#### `-s, --switch-workspace`

**Description:** Switch between Launcher and App workspace.

#### `--app-workspace`

**Description:** Changes to the App workspace.

#### `--launcher-workspace`

**Description:** Changes to the Launcher workspace.

#### `-e, --switch-environment`

**Description:** Switch between environments. (Release/Beta)

#### `--release`

**Description:** Changes to the Release Environment.

#### `--beta`

**Description:** Changes to the Beta Environment.d

#### `--cleanworkspace`

**Description:** Clean the workspace. Deletes ALL THE FOLDERS from the current workspace.

#### `-r, --refresh`

**Description:** Refresh the workspace. (Useful for seeing any new files or changes).

#### `--settings`

**Description:** Show current project info settings.

### Project Settings Commands

#### `--name <ProjectName>`

**Description:** Set the project name.

#### `--url <BaseDownloadURL>`

**Description:** Set the base download URL.

#### `--setrepair <true|false>`

**Description:** Enable or disable repair patch creation.

#### `--setincremental <true|false>`

**Description:** Enable or disable incremental patch creation.

#### `--setinstaller <true|false>`

**Description:** Enable or disable installer patch creation.

#### `--setbinarydiff <QualityLevel>`

**Description:** Set the binary diff quality (1 to 5).

#### `--addignore <Path>`

**Description:** Add a path to ignored paths.

#### `--removeignore <Path>`

**Description:** Remove a path from ignored paths.

#### `-o, --open`

**Description:** Open the current workspace folder.

#### `--no-update`

**Description:** Do not check for updates at start.

#### `--exit`

**Description:** Exit the CLI.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gamelauncher.gitbook.io/documentation/game-launcher/patch-manager-app/cli-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
