|
| 1 | +# The Wails CLI |
| 2 | + |
| 3 | +The Wails CLI is a command line tool that allows you to create, build and run Wails applications. |
| 4 | +There are a number of commands related to tooling, such as icon generation and asset bundling. |
| 5 | + |
| 6 | +## Commands |
| 7 | + |
| 8 | +### run |
| 9 | + |
| 10 | +The run command is for running tasks defined in `Taskfile.yml`. |
| 11 | + |
| 12 | +| Flag | Type | Description | Default | |
| 13 | +|--------------------|--------|------------------------------------------------------|-----------------------| |
| 14 | +| `-t` | string | The name of the task to run | | |
| 15 | + |
| 16 | +### generate |
| 17 | + |
| 18 | +The `generate` command is used to generate resources and assets for your Wails project. |
| 19 | +It can be used to generate many things including: |
| 20 | + - application icons, |
| 21 | + - resource files for Windows applications |
| 22 | + - Info.plist files for macOS deployments |
| 23 | + |
| 24 | +#### icon |
| 25 | + |
| 26 | +The `icon` command generates icons for your project. |
| 27 | + |
| 28 | +| Flag | Type | Description | Default | |
| 29 | +|--------------------|--------|------------------------------------------------------|-----------------------| |
| 30 | +| `-example` | bool | Generates example icon file (appicon.png) | | |
| 31 | +| `-input` | string | The input image file | | |
| 32 | +| `-sizes` | string | The sizes to generate in .ico file (comma separated) | "256,128,64,48,32,16" | |
| 33 | +| `-windowsFilename` | string | The output filename for the Windows icon | icons.ico | |
| 34 | +| `-macFilename` | string | The output filename for the Mac icon bundle | icons.icns | |
| 35 | + |
| 36 | +```bash |
| 37 | +wails generate icon -input myicon.png -sizes "32,64,128" -windowsFilename myicon.ico -macFilename myicon.icns |
| 38 | +``` |
| 39 | + |
| 40 | +This will generate icons for mac and windows and save them in the current directory as `myicon.ico` |
| 41 | +and `myicons.icns`. |
| 42 | + |
| 43 | +#### syso |
| 44 | + |
| 45 | +The `syso` command generates a Windows resource file (aka `.syso`). |
| 46 | + |
| 47 | +```bash |
| 48 | +wails generate syso <options> |
| 49 | +``` |
| 50 | + |
| 51 | +| Flag | Type | Description | Default | |
| 52 | +|-------------|--------|--------------------------------------------|------------------| |
| 53 | +| `-example` | bool | Generates example manifest & info files | | |
| 54 | +| `-manifest` | string | The manifest file | | |
| 55 | +| `-info` | string | The info.json file | | |
| 56 | +| `-icon` | string | The icon file | | |
| 57 | +| `-out` | string | The output filename for the syso file | `wails.exe.syso` | |
| 58 | +| `-arch` | string | The target architecture (amd64,arm64,386) | `runtime.GOOS` | |
| 59 | + |
| 60 | +If `-example` is provided, the command will generate example manifest and info files |
| 61 | +in the current directory and exit. |
| 62 | + |
| 63 | +If `-manifest` is provided, the command will use the provided manifest file to generate |
| 64 | +the syso file. |
| 65 | + |
| 66 | +If `-info` is provided, the command will use the provided info.json file to set the version |
| 67 | +information in the syso file. |
| 68 | + |
| 69 | +NOTE: We use [winres](https://github.com/tc-hib/winres) to generate the syso file. Please |
| 70 | +refer to the winres documentation for more information. |
| 71 | + |
| 72 | +NOTE: Whilst the tool will work for 32-bit Windows, it is not supported. Please use 64-bit. |
| 73 | + |
| 74 | +#### defaults |
| 75 | + |
| 76 | +```bash |
| 77 | +wails icon -input myicon.png -sizes "32,64,128" -windowsFilename myicon.ico -macFilename myicon.icns |
| 78 | +``` |
| 79 | +This will generate all the default assets and resources in the current directory. I |
0 commit comments