Skip to content

CLI Reference

The Wails CLI provides a comprehensive set of commands to help you develop, build, and maintain your Wails applications.

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>.

init

Initializes a new Wails project.

Terminal window
wails3 init [flags]

Flags

FlagDescriptionDefault
-pPackage namemain
-tTemplate name or URLvanilla
-nProject name
-dProject directory.
-qSuppress outputfalse
-lList templatesfalse
-gitGit repository URL
-productnameProduct nameMy Product
-productdescriptionProduct descriptionMy Product Description
-productversionProduct version0.1.0
-productcompanyCompany nameMy Company
-productcopyrightCopyright notice now, My Company
-productcommentsFile commentsThis is a comment
-productidentifierProduct identifier

The -git flag accepts various Git URL formats:

  • HTTPS: https://github.com/username/project
  • SSH: [email protected]:username/project or ssh://[email protected]/username/project
  • Git protocol: git://github.com/username/project
  • Filesystem: file:///path/to/project.git

When provided, this flag will:

  1. Initialize a git repository in the project directory
  2. Set the specified URL as the remote origin
  3. Update the module name in go.mod to match the repository URL
  4. Add all files

dev

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.

Terminal window
wails3 dev [flags]

Flags

FlagDescriptionDefault
-configConfig file path./build/config.yml
-portVite dev server port9245
-sEnable HTTPSfalse

build

Builds a debug version of your application. It defaults to building for the current platform and architecture.

Terminal window
wails3 build

package

Creates platform-specific packages for distribution.

Terminal window
wails3 package

Package Types

The following package types are available for each platform:

PlatformPackage Type
Windows.exe
macOS.app,
Linux.AppImage, .deb, .rpm, .archlinux

doctor

Performs a system check and displays a status report.

Terminal window
wails3 doctor

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

Generates bindings and models for your Go code.

Terminal window
wails3 generate bindings [flags] [patterns...]

Flags

FlagDescriptionDefault
-fAdditional Go build flags
-dOutput directoryfrontend/bindings
-modelsModels filenamemodels
-internalInternal filenameinternal
-indexIndex filenameindex
-tsGenerate TypeScriptfalse
-iUse TS interfacesfalse
-bUse bundled runtimefalse
-namesUse names instead of IDsfalse
-noindexSkip index filesfalse
-dryDry runfalse
-silentSilent modefalse
-vDebug outputfalse
-cleanClean output directoryfalse

generate build-assets

Generates build assets for your application.

Terminal window
wails3 generate build-assets [flags]

Flags

FlagDescriptionDefault
-nameProject name
-dirOutput directorybuild
-silentSuppress outputfalse
-companyCompany name
-productnameProduct name
-descriptionProduct description
-versionProduct version
-identifierProduct identifiercom.wails.[name]
-copyrightCopyright notice
-commentsFile comments

generate icons

Generates application icons.

Terminal window
wails3 generate icons [flags]

Flags

FlagDescriptionDefault
-inputInput PNG fileRequired
-windowsWindows output filename
-macmacOS output filename
-sizesIcon sizes (comma-separated)256,128,64,48,32,16
-exampleGenerate example iconfalse

generate syso

Generates Windows .syso file.

Terminal window
wails3 generate syso [flags]

Flags

FlagDescriptionDefault
-manifestPath to manifest fileRequired
-iconPath to icon fileRequired
-infoPath to version info file
-archTarget architectureCurrent GOARCH
-outOutput filenamersrc_windows_[arch].syso

generate .desktop

Generates a Linux .desktop file.

Terminal window
wails3 generate .desktop [flags]

Flags

FlagDescriptionDefault
-nameApplication nameRequired
-execExecutable pathRequired
-iconIcon path
-categoriesApplication categoriesUtility
-commentApplication comment
-terminalRun in terminalfalse
-keywordsSearch keywords
-versionApplication version
-genericnameGeneric name
-startupnotifyShow startup notificationfalse
-mimetypeSupported MIME types
-outputOutput filename[name].desktop

generate runtime

Generates the pre-built version of the runtime.

Terminal window
wails3 generate runtime

generate constants

Generates JavaScript constants from Go code.

Terminal window
wails3 generate constants

generate appimage

Generates a Linux AppImage.

Terminal window
wails3 generate appimage [flags]

Flags

FlagDescriptionDefault
-binaryPath to binaryRequired
-iconPath to icon fileRequired
-desktopPath to .desktop fileRequired
-builddirBuild directoryTemp directory
-outputOutput directory.

Base command: wails3 service

Service Commands

Service commands help manage Wails services. All service commands use the base command: wails3 service <command>.

service init

Initializes a new service.

Terminal window
wails3 service init [flags]

Flags

FlagDescriptionDefault
-nService nameexample_service
-dService descriptionExample service
-pPackage name
-oOutput directory.
-qSuppress outputfalse
-aAuthor name
-vVersion
-wWebsite URL
-rRepository URL
-lLicense

Base command: wails3 tool

Tool Commands

Tool commands provide utilities for development and debugging. All tool commands use the base command: wails3 tool <command>.

tool checkport

Checks if a port is open. Useful for testing if vite is running.

Terminal window
wails3 tool checkport [flags]

Flags

FlagDescriptionDefault
-portPort to check9245
-hostHost to checklocalhost

tool watcher

Watches files and runs a command when they change.

Terminal window
wails3 tool watcher [flags]

Flags

FlagDescriptionDefault
-configConfig file path./build/config.yml
-ignorePatterns to ignore
-includePatterns to include

tool cp

Copies files.

Terminal window
wails3 tool cp

tool buildinfo

Shows build information about the application.

Terminal window
wails3 tool buildinfo

tool package

Generates Linux packages (deb, rpm, archlinux).

Terminal window
wails3 tool package [flags]

Flags

FlagDescriptionDefault
-formatPackage format (deb, rpm, archlinux)deb
-nameExecutable nameRequired
-configConfig file pathRequired
-outOutput directory.

Flags

FlagDescriptionDefault
-formatPackage format (deb, rpm, archlinux)deb
-nameExecutable namemyapp
-configConfig file path
-outOutput directory.

Base command: wails3 update

Update Commands

Update commands help manage and update project assets. All update commands use the base command: wails3 update <command>.

update cli

Updates the Wails CLI to a new version.

Terminal window
wails3 update cli [flags]

Flags

FlagDescriptionDefault
-preUpdate to latest pre-releasefalse
-versionUpdate to specific version
-nocolourDisable colored outputfalse

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:

Terminal window
require github.com/wailsapp/wails/v3 v3.x.x

update build-assets

Updates the build assets using the given config file.

Terminal window
wails3 update build-assets [flags]

Flags

FlagDescriptionDefault
-configConfig file path
-dirOutput directorybuild
-silentSuppress outputfalse
-companyCompany name
-productnameProduct name
-descriptionProduct description
-versionProduct version
-identifierProduct identifier
-copyrightCopyright notice
-commentsFile comments

Base command: wails3

Utility Commands

Utility commands provide helpful shortcuts for common tasks. Use these commands directly with the base command: wails3 <command>.

docs

Opens the Wails documentation in your default browser.

Terminal window
wails3 docs

releasenotes

Shows the release notes for the current or specified version.

Terminal window
wails3 releasenotes [flags]

Flags

FlagDescriptionDefault
-vVersion to show release notes for
-nDisable colour outputfalse

version

Prints the current version of Wails.

Terminal window
wails3 version

Opens the Wails sponsorship page in your default browser.

Terminal window
wails3 sponsor