CLI Reference
The Wails CLI provides a comprehensive set of commands to help you develop, build, and maintain your Wails applications.
Core Commands
Section titled “Core Commands”Core commands are the primary commands used for project creation, development, and building.
All CLI commands are of the following format: wails3 <command>.
Initializes a new Wails project. During this initialization, the go mod tidy command is run to bring the project packages up to date. This can be bypassed by using the -skipgomodtidy flag with the init command.
wails3 init [flags]| Flag | Description | Default |
|---|---|---|
-p |
Go package name | main |
-t |
Template name or URL | vanilla |
-n |
Project name | |
-d |
Project directory | . |
-q |
Suppress output | false |
-l |
List templates | false |
-mod |
Go module path (computed from -git if omitted) |
|
-git |
Git repository URL | |
-s |
Skip the warning when using a remote template | false |
-productname |
Product name | My Product |
-productdescription |
Product description | My Product Description |
-productversion |
Product version | 0.1.0 |
-productcompany |
Company name | My Company |
-productcopyright |
Copyright notice | © now, My Company |
-productcomments |
File comments | This is a comment |
-productidentifier |
Product identifier | |
-skipgomodtidy |
Skip go mod tidy | false |
The -git flag accepts various Git URL formats:
- HTTPS:
https://github.com/username/project - SSH:
git@github.com:username/projectorssh://git@github.com/username/project - Git protocol:
git://github.com/username/project - Filesystem:
file:///path/to/project.git
When provided, this flag will:
- Initialize a git repository in the project directory
- Set the specified URL as the remote origin
- Update the module name in
go.modto match the repository URL - Add all files
Runs the application in development mode. This will give you a live view of your frontend code, and you can make changes and see them reflected in the running application without having to rebuild the entire application. Changes to your Go code will also be detected and the application will automatically rebuild and relaunch.
wails3 dev [flags]| Flag | Description | Default |
|---|---|---|
-config |
Config file path | ./build/config.yml |
-port |
Vite dev server port | 9245 |
-s |
Enable HTTPS | false |
Builds a debug version of your application. It defaults to building for the current platform and architecture.
wails3 build [flags] [CLI variables...]| Flag | Description | Default |
|---|---|---|
-tags |
Additional Go build tags (comma-separated) |
You can pass CLI variables to customize the build:
wails3 build PLATFORM=linux CONFIG=productionUse the -tags flag to pass custom Go build tags:
# Build with legacy GTK3 + WebKit2GTK 4.1 on Linux (default is GTK4 + WebKitGTK 6.0)wails3 build -tags gtk3
# Build in server mode (no GUI)wails3 build -tags server
# Multiple tagswails3 build -tags gtk3,customtagTags are forwarded as EXTRA_TAGS to the underlying Taskfile.
package
Section titled “package”Creates platform-specific packages for distribution.
wails3 package [CLI variables...]You can pass CLI variables to customize the packaging:
wails3 package VERSION=2.0.0 OUTPUT=myapp.pkgPackage Types
Section titled “Package Types”The following package types are available for each platform:
| Platform | Package Type |
|---|---|
| Windows | .exe |
| macOS | .app, |
| Linux | .AppImage, .deb, .rpm, .archlinux |
Runs tasks defined in your project’s Taskfile.yml. This is an embedded version of Taskfile that allows you to define and run custom build, test, and deployment tasks.
wails3 task [taskname] [CLI variables...] [flags]CLI Variables
Section titled “CLI Variables”You can pass variables to tasks in the format KEY=VALUE:
wails3 task build PLATFORM=linux CONFIG=productionwails3 task deploy ENV=staging VERSION=1.2.3These variables can be accessed in your Taskfile.yml using Go template syntax:
tasks: build: cmds: - echo "Building for {{.PLATFORM | default "darwin"}}" - echo "Config: {{.CONFIG | default "debug"}}"| Flag | Description | Default |
|---|---|---|
-h |
Shows Task usage | false |
-i |
Creates a new Taskfile.yml | false |
-list |
Lists tasks with descriptions | false |
-list-all |
Lists all tasks (with or without descriptions) | false |
-json |
Formats task list as JSON | false |
-status |
Exits with non-zero if task is not up-to-date | false |
-f |
Forces execution even when task is up-to-date | false |
-w |
Enables watch mode for the given task | false |
-v |
Enables verbose mode | false |
-version |
Prints Task version | false |
-s |
Disables echoing | false |
-p |
Executes tasks in parallel | false |
-dry |
Compiles and prints tasks without executing | false |
-summary |
Shows summary about a task | false |
-x |
Pass-through the exit code of the task | false |
-dir |
Sets directory of execution | |
-taskfile |
Choose which Taskfile to run | |
-output |
Sets output style: [interleaved | group |
-c |
Colored output (enabled by default) | true |
-C |
Limit number of tasks to run concurrently | |
-interval |
Interval to watch for changes (in seconds) |
Examples
Section titled “Examples”# Run the default taskwails3 task
# Run a specific taskwails3 task test
# Run a task with variableswails3 task build PLATFORM=windows ARCH=amd64
# List all available taskswails3 task --list
# Run multiple tasks in parallelwails3 task -p task1 task2 task3
# Watch for changes and re-run taskwails3 task -w devStarts the Wails project MCP server for agent-assisted project management. This is
separate from the MCP server compiled into a running application: wails3 mcp
manages project files and lifecycle commands, while the application MCP server
controls the running WebView.
wails3 mcp [flags]Transport is selected automatically:
- When an MCP host launches Wails with piped stdin/stdout, the server uses stdio.
- When run interactively in a terminal, the server uses Streamable HTTP on
127.0.0.1and asks the operating system for a free port.
Use --stdio or --http to select a transport explicitly. Use --port 0 to choose a
free loopback port in HTTP mode.
MCP flags
Section titled “MCP flags”| Flag | Description | Default |
|---|---|---|
--root |
Allowed project root. Paths and symlinks outside it are rejected. | Current directory |
--token |
Session/bearer token for mutating and process-control tools. Falls back to WAILS_MCP_TOKEN. |
Generated securely |
--stdio |
Force stdio transport. | Automatic |
--http |
Force Streamable HTTP transport. | Automatic |
--port |
HTTP port; 0 selects a free loopback port. |
0 |
In HTTP mode, Wails prints the endpoint and bearer token to stderr. In stdio mode,
the token is included in the MCP initialization instructions. The server does not
expose arbitrary shell execution. Remote templates and Git remotes require explicit
approval through the tool’s allowExternal input.
doctor
Section titled “doctor”Performs a system check and displays a status report.
wails3 doctorGenerate Commands
Section titled “Generate Commands”Generate commands help create various project assets like bindings, icons, and build files. All generate commands use the base command: wails3 generate <command>.
generate bindings
Section titled “generate bindings”Generates bindings and models for your Go code.
wails3 generate bindings [flags] [patterns...]| Flag | Description | Default |
|---|---|---|
-f |
Additional Go build flags | |
-d |
Output directory | frontend/bindings |
-models |
Models filename | models |
-index |
Index filename | index |
-ts |
Generate TypeScript | false |
-i |
Use TS interfaces | false |
-b |
Use bundled runtime | false |
-names |
Use names instead of IDs | false |
-noindex |
Skip index files | false |
-noevents |
Skip generating event-related bindings | false |
-dry |
Dry run | false |
-silent |
Silent mode | false |
-v |
Debug output | false |
-clean |
Clean output directory before generating | true |
generate build-assets
Section titled “generate build-assets”Generates build assets for your application.
wails3 generate build-assets [flags]| Flag | Description | Default |
|---|---|---|
-name |
Project name | |
-dir |
Output directory | build |
-silent |
Suppress output | false |
-company |
Company name | |
-productname |
Product name | |
-description |
Product description | |
-version |
Product version | |
-identifier |
Product identifier | com.wails.[name] |
-copyright |
Copyright notice | |
-comments |
File comments |
generate icons
Section titled “generate icons”Generates application icons.
wails3 generate icons [flags]| Flag | Description | Default |
|---|---|---|
-input |
Input PNG file | Required |
-windowsfilename |
Windows output filename | |
-macfilename |
macOS output filename | |
-sizes |
Icon sizes (comma-separated) | 256,128,64,48,32,16 |
-example |
Generate example icon | false |
-iconcomposerinput |
Input Icon Composer file (.icon) |
|
-macassetdir |
Output directory for Mac assets (Assets.car + icns) |
Icon Composer (macOS)
Section titled “Icon Composer (macOS)”On macOS 26+, you can use Icon Composer .icon files to generate Assets.car and icons.icns:
wails3 generate icons -iconcomposerinput build/appicon.icon -macassetdir buildThis compiles the .icon file using Apple’s actool command. Requires Xcode with actool version 26 or later.
When using Icon Composer, set cfBundleIconName in your build/config.yml to match the .icon filename (without extension):
info: cfBundleIconName: "appicon"If not set and Assets.car exists, this defaults to "appicon".
generate syso
Section titled “generate syso”Generates Windows .syso file.
wails3 generate syso [flags]| Flag | Description | Default |
|---|---|---|
-manifest |
Path to manifest file | Required |
-icon |
Path to icon file | Required |
-info |
Path to version info file | |
-arch |
Target architecture | Current GOARCH |
-out |
Output filename | rsrc_windows_[arch].syso |
generate .desktop
Section titled “generate .desktop”Generates a Linux .desktop file.
wails3 generate .desktop [flags]| Flag | Description | Default |
|---|---|---|
-name |
Application name | Required |
-exec |
Executable path | Required |
-icon |
Icon path | |
-categories |
Application categories | Utility |
-comment |
Application comment | |
-terminal |
Run in terminal | false |
-keywords |
Search keywords | |
-version |
Application version | |
-genericname |
Generic name | |
-startupnotify |
Show startup notification | false |
-mimetype |
Supported MIME types | |
-output |
Output filename | [name].desktop |
generate runtime
Section titled “generate runtime”Generates the pre-built version of the runtime.
wails3 generate runtimegenerate constants
Section titled “generate constants”Generates JavaScript constants from Go code.
wails3 generate constantsgenerate webview2bootstrapper
Section titled “generate webview2bootstrapper”Generates a Windows WebView2 bootstrap installer for distribution.
wails3 generate webview2bootstrapper [flags]generate template
Section titled “generate template”Scaffolds a new project template directory.
wails3 generate template [flags]generate appimage
Section titled “generate appimage”Generates a Linux AppImage.
wails3 generate appimage [flags]| Flag | Description | Default |
|---|---|---|
-binary |
Path to binary | Required |
-icon |
Path to icon file | Required |
-desktop |
Path to .desktop file | Required |
-builddir |
Build directory | Temp directory |
-output |
Output directory | . |
Service Commands
Section titled “Service Commands”Service commands help manage Wails services. All service commands use the base command: wails3 service <command>.
service init
Section titled “service init”Initializes a new service.
wails3 service init [flags]| Flag | Description | Default |
|---|---|---|
-n |
Service name | example_service |
-d |
Service description | Example service |
-p |
Package name | |
-o |
Output directory | . |
-q |
Suppress output | false |
-a |
Author name | |
-v |
Version | |
-w |
Website URL | |
-r |
Repository URL | |
-l |
License |
Tool Commands
Section titled “Tool Commands”Tool commands provide utilities for development and debugging. All tool commands use the base command: wails3 tool <command>.
tool checkport
Section titled “tool checkport”Checks if a port is open. Useful for testing if vite is running.
wails3 tool checkport [flags]| Flag | Description | Default |
|---|---|---|
-port |
Port to check | 9245 |
-host |
Host to check | localhost |
tool watcher
Section titled “tool watcher”Watches files and runs a command when they change.
wails3 tool watcher [flags]| Flag | Description | Default |
|---|---|---|
-config |
Config file path | ./build/config.yml |
-ignore |
Patterns to ignore | |
-include |
Patterns to include |
tool cp
Section titled “tool cp”Copies files.
wails3 tool cptool buildinfo
Section titled “tool buildinfo”Shows build information about the application.
wails3 tool buildinfotool version
Section titled “tool version”Bumps a semantic version based on the provided flags.
wails3 tool version [flags]| Flag | Description | Default |
|---|---|---|
-v |
Current version to bump | |
-major |
Bump major version | false |
-minor |
Bump minor version | false |
-patch |
Bump patch version | false |
-prerelease |
Bump prerelease version (e.g., alpha.5 to alpha.6) | false |
The command follows the precedence order: major > minor > patch > prerelease. It preserves the “v” prefix if present in the input version, as well as any prerelease and metadata components.
Example usage:
wails3 tool version -v 1.2.3 -major # Output: 2.0.0wails3 tool version -v v1.2.3 -minor # Output: v1.3.0wails3 tool version -v 1.2.3-alpha -patch # Output: 1.2.4-alphawails3 tool version -v v3.0.0-alpha.5 -prerelease # Output: v3.0.0-alpha.6tool package
Section titled “tool package”Generates Linux packages (deb, rpm, archlinux).
wails3 tool package [flags]| Flag | Description | Default |
|---|---|---|
-format |
Package format (deb, rpm, archlinux) | deb |
-name |
Executable name | myapp |
-config |
Config file path | |
-out |
Output directory | . |
tool lipo
Section titled “tool lipo”Creates a macOS universal binary by combining architecture-specific binaries.
wails3 tool lipo [flags]| Flag | Description | Default |
|---|---|---|
-output |
Output binary path |
tool capabilities
Section titled “tool capabilities”Checks system build capabilities (GTK4/GTK3 availability on Linux).
wails3 tool capabilitiestool docker-mounts
Section titled “tool docker-mounts”Generates Docker volume mount flags for cross-compilation. Outputs -v flags for the Go module cache and any local replace directives in go.mod, for use in Taskfile docker run commands.
wails3 tool docker-mountstool has
Section titled “tool has”Checks whether a tool or capability is available, printing true or false to stdout. Designed for use in Taskfile sh: variables as a cross-platform alternative to command -v.
Use | to check for any one of several alternatives.
wails3 tool has <tool>Examples
Section titled “Examples”# Check for a C compiler (gcc or clang)wails3 tool has gcc|clang
# Check for a specific toolwails3 tool has gitwails3 tool has nodeUsage in a Taskfile
Section titled “Usage in a Taskfile”vars: HAS_CC: sh: 'wails3 tool has gcc|clang'tool has-cc
Section titled “tool has-cc”A backward-compatible alias for wails3 tool has gcc|clang. Checks whether gcc or clang is available in PATH and prints true or false.
wails3 tool has-ccUpdate Commands
Section titled “Update Commands”Update commands help manage and update project assets. All update commands use the base command: wails3 update <command>.
update cli
Section titled “update cli”Updates the Wails CLI to a new version.
wails3 update cli [flags]| Flag | Description | Default |
|---|---|---|
-pre |
Update to latest pre-release | false |
-version |
Update to specific version | |
-nocolour |
Disable colored output | false |
The update cli command allows you to update your Wails CLI installation. By default, it updates to the latest stable release.
You can use the -pre flag to update to the latest pre-release version, or specify a particular version using the -version flag.
After updating, remember to update your project’s go.mod file to use the same version:
require github.com/wailsapp/wails/v3 v3.x.xupdate build-assets
Section titled “update build-assets”Updates the build assets using the given config file.
wails3 update build-assets [flags]| Flag | Description | Default |
|---|---|---|
-config |
Config file path | |
-dir |
Output directory | build |
-silent |
Suppress output | false |
-company |
Company name | |
-productname |
Product name | |
-description |
Product description | |
-version |
Product version | |
-identifier |
Product identifier | |
-copyright |
Copyright notice | |
-comments |
File comments |
Utility Commands
Section titled “Utility Commands”Utility commands provide helpful shortcuts for common tasks. Use these commands directly with the base command: wails3 <command>.
Opens the Wails documentation in your default browser.
wails3 docsreleasenotes
Section titled “releasenotes”Shows the release notes for the current or specified version.
wails3 releasenotes [flags]| Flag | Description | Default |
|---|---|---|
-v |
Version to show release notes for | |
-n |
Disable colour output | false |
version
Section titled “version”Prints the current version of Wails.
wails3 versionsponsor
Section titled “sponsor”Opens the Wails sponsorship page in your default browser.
wails3 sponsor