> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deskofy.app/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Commands

The **Deskofy CLI** is a command-line tool for **creating, running, building, and managing Deskofy projects**. It provides a set of commands and options to simplify development workflows.

## **Global Options**

| Option      | Alias | Description                        |
| :---------- | :---- | :--------------------------------- |
| `--version` | `-v`  | Display the Deskofy CLI version    |
| `--help`    | `-h`  | Show help information for commands |

## **Available Commands**

### `create`

**Description:** Initializes a new Deskofy project in the current directory.

**Usage:**

```shellscript theme={null}
deskofy create
```

**Options:** None

**Example:**

```shellscript theme={null}
deskofy create
```

### `run`

**Description:** Runs a Deskofy project using the specified configuration file.

**Usage:**

```shellscript theme={null}
deskofy run

# or

deskofy run path/to/deskofy.config.json5
```

**Positional Arguments:**

| Name                  | Description                            | Type   | Default                |
| :-------------------- | :------------------------------------- | :----- | :--------------------- |
| `project-config-file` | Path to the project configuration file | string | `deskofy.config.json5` |

**Example:**

```shellscript theme={null}
deskofy run

# or

deskofy run ./myproject/deskofy.config.json5
```

### `build`

**Description:** Builds a Deskofy project for a specified target platform.

**Usage:**

```shellscript theme={null}
deskofy build --config deskofy.config.json5 --target <target>
```

**Options:**

| Option     | Description                            | Type   | Required | Default                |
| :--------- | :------------------------------------- | :----- | :------- | :--------------------- |
| `--config` | Path to the project configuration file | string | Yes      | `deskofy.config.json5` |
| `--target` | Output format for the build            | string | Yes      | -                      |

**Target Validation:** The `--target` must match the current operating system:

| Platform  | Supported Targets                            |
| :-------- | :------------------------------------------- |
| `linux`   | `deb`, `rpm`, `app-image`, `flatpak`, `snap` |
| `windows` | `msi`, `msi-wrapped`, `exe`                  |
| `mac`     | `dmg`                                        |

**Example:**

```shellscript theme={null}
deskofy build --target deb

deskofy build --config ./myconfig.json5 --target snap
```

<Note>
  If an unsupported target is specified for the current platform, Deskofy will display an error and exit.
</Note>

### `fmt`

**Description:** Automatically formats all source code in the project.

**Usage:**

```shellscript theme={null}
deskofy fmt
```

### `lint`

**Description:** Runs a linter to check code style and potential issues.

**Usage:**

```shellscript theme={null}
deskofy lint
```

### `types`

**Description:** Validates TypeScript types across the project.

**Usage:**

```shellscript theme={null}
deskofy types
```

## **Error Handling & Help**

* **Strict Mode:** Unknown commands or invalid arguments trigger errors.
* **Command Suggestions:** If a typo is detected, the CLI suggests correct commands.
* **Default Behavior:** Running `deskofy` without a command prints a default help message.
