commands

package
v3.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildSettings = map[string]string{}

BuildSettings contains the CLI build settings

View Source
var DisableFooter bool
View Source
var ErrMacAssetNotSupported = errors.New("mac asset generation is only supported on macOS")

ErrMacAssetNotSupported is returned by generateMacAsset when mac asset generation is not supported on the current platform (e.g., non-macOS systems).

Functions

func Build

func Build(_ *flags.Build, otherArgs []string) error

func BuildInfo

func BuildInfo(_ *BuildInfoOptions) error

func CopyFile

func CopyFile(source string, target string) error

func Cp

func Cp(_ *CpOptions) error

func Dev

func Dev(options *DevOptions) error

func Doctor

func Doctor(_ *DoctorOptions) error

func DoctorNg

func DoctorNg(options *DoctorNgOptions) error

func EntitlementsSetup

func EntitlementsSetup(options *flags.EntitlementsSetup) error

EntitlementsSetup runs the interactive entitlements configuration wizard

func GenerateAppImage

func GenerateAppImage(options *GenerateAppImageOptions) error

func GenerateBindings

func GenerateBindings(options *flags.GenerateBindingsOptions, patterns []string) error

func GenerateBuildAssets

func GenerateBuildAssets(options *BuildAssetsOptions) error

GenerateBuildAssets generates the build assets for the project.

func GenerateConstants

func GenerateConstants(options *GenerateConstantsOptions) error

func GenerateDotDesktop

func GenerateDotDesktop(options *DotDesktopOptions) error

func GenerateIcons

func GenerateIcons(options *IconsOptions) error

func GenerateRuntime

func GenerateRuntime(options *RuntimeOptions) error

func GenerateSyso

func GenerateSyso(options *SysoOptions) (err error)

func GenerateTemplate

func GenerateTemplate(options *templates.BaseTemplate) error

func GenerateTemplateIcon

func GenerateTemplateIcon(data []byte, outputFilename string) (err error)

func GenerateWebView2Bootstrapper

func GenerateWebView2Bootstrapper(options *GenerateWebView2Options) error

func IOSOverlayGen

func IOSOverlayGen(options *IOSOverlayGenOptions) error

IOSOverlayGen generates a Go build overlay JSON that injects a generated main_ios.gen.go exporting WailsIOSMain() which calls main().

It writes: - <Out> : overlay JSON file - <dir>/gen/main_ios.gen.go : the generated Go file referenced by the overlay

The overlay maps <appDir>/main_ios.gen.go -> <dir>/gen/main_ios.gen.go

func IOSOverlayGenCmd

func IOSOverlayGenCmd() error

IOSOverlayGenCmd is a CLI entry compatible with NewSubCommandFunction. Defaults:

config: ./build/config.yml (optional)
out:    ./build/ios/xcode/overlay.json

func IOSXcodeGen

func IOSXcodeGen(options *IOSXcodeGenOptions) error

IOSXcodeGen generates an Xcode project skeleton for the current app.

func IOSXcodeGenCmd

func IOSXcodeGenCmd() error

IOSXcodeGenCmd is a CLI entry compatible with NewSubCommandFunction. Defaults:

config: ./build/config.yml (optional)
out:    ./build/ios/xcode

func Init

func Init(options *flags.Init) error

func InstallMSIXTools

func InstallMSIXTools() error

InstallMSIXTools installs the required tools for MSIX packaging

func Package

func Package(_ *flags.Package, otherArgs []string) error

func ReleaseNotes

func ReleaseNotes(options *ReleaseNotesOptions) error

func RunTask

func RunTask(options *RunTaskOptions, otherArgs []string) error

func ServiceInit

func ServiceInit(options *flags.ServiceInit) error

func Setup

func Setup(_ *SetupOptions) error

func Sign

func Sign(options *flags.Sign) error

Sign signs a binary or package

func SignWrapper

func SignWrapper(_ *flags.SignWrapper, otherArgs []string) error

func SigningSetup

func SigningSetup(options *flags.SigningSetup) error

SigningSetup configures signing variables in platform Taskfiles

func ToolCapabilities

func ToolCapabilities(_ *ToolCapabilitiesOptions) error

func ToolCheckPort

func ToolCheckPort(options *ToolCheckPortOptions) error

func ToolLipo

func ToolLipo(options *flags.Lipo) error

func ToolMSIX

func ToolMSIX(options *flags.ToolMSIX) error

ToolMSIX creates an MSIX package for Windows applications

func ToolPackage

func ToolPackage(options *flags.ToolPackage) error

ToolPackage generates a package in the specified format

func ToolVersion

func ToolVersion(options *ToolVersionOptions) error

ToolVersion bumps a semantic version based on the provided flags

func UpdateBuildAssets

func UpdateBuildAssets(options *UpdateBuildAssetsOptions) error

UpdateBuildAssets updates the build assets for the project.

func UpdateCLI

func UpdateCLI(options *UpdateCLIOptions) error

func Version

func Version(_ *VersionOptions) error

func Watcher

func Watcher(options *WatcherOptions) error

Types

type BuildAssetsOptions

type BuildAssetsOptions struct {
	Dir                   string `description:"The directory to generate the files into"            default:"."`
	Name                  string `description:"The name of the project"`
	BinaryName            string `description:"The name of the binary"`
	ProductName           string `description:"The name of the product" default:"My Product"`
	ProductDescription    string `description:"The description of the product" default:"My Product Description"`
	ProductVersion        string `description:"The version of the product" default:"0.1.0"`
	ProductCompany        string `description:"The company of the product" default:"My Company"`
	ProductCopyright      string `description:"The copyright notice" default:"\u00a9 now, My Company"`
	ProductComments       string `description:"Comments to add to the generated files" default:"This is a comment"`
	ProductIdentifier     string `description:"The product identifier, e.g com.mycompany.myproduct"`
	CFBundleIconName      string `description:"The macOS icon name (for Assets.car icon bundles)"`
	Publisher             string `description:"Publisher name for MSIX package (e.g., CN=CompanyName)"`
	ProcessorArchitecture string `description:"Processor architecture for MSIX package" default:"x64"`
	ExecutablePath        string `description:"Path to executable for MSIX package"`
	ExecutableName        string `description:"Name of executable for MSIX package"`
	OutputPath            string `description:"Output path for MSIX package"`
	CertificatePath       string `description:"Certificate path for MSIX package"`
	Silent                bool   `description:"Suppress output to console"`
	Typescript            bool   `description:"Use typescript" default:"false"`
}

BuildAssetsOptions defines the options for generating build assets.

type BuildConfig

type BuildConfig struct {
	BuildAssetsOptions
	FileAssociations []FileAssociation `yaml:"fileAssociations"`
	Protocols        []ProtocolConfig  `yaml:"protocols,omitempty"`
}

BuildConfig defines the configuration for generating build assets.

type BuildInfoOptions

type BuildInfoOptions struct{}

type CFBundleIconNameSetter

type CFBundleIconNameSetter interface {
	GetCFBundleIconName() string
	SetCFBundleIconName(string)
}

CFBundleIconNameSetter is implemented by types that can get and set CFBundleIconName (used to keep options and config in sync when defaulting the macOS icon name).

type Capabilities

type Capabilities struct {
	Platform string             `json:"platform"`
	Arch     string             `json:"arch"`
	Linux    *LinuxCapabilities `json:"linux,omitempty"`
}

type CpOptions

type CpOptions struct{}

type DevOptions

type DevOptions struct {
	flags.Common

	Config   string `description:"The config file including path" default:"./build/config.yml"`
	VitePort int    `name:"port" description:"Specify the vite dev server port"`
	Secure   bool   `name:"s" description:"Enable HTTPS"`
}

type DoctorNgOptions

type DoctorNgOptions struct {
	NonInteractive bool `name:"n" description:"Run in non-interactive mode (no TUI)"`
}

type DoctorOptions

type DoctorOptions struct{}

type DotDesktopOptions

type DotDesktopOptions struct {
	OutputFile    string `description:"The output file to write to"`
	Type          string `description:"The type of the desktop entry" default:"Application"`
	Name          string `description:"The name of the application"`
	Exec          string `description:"The binary name + args to execute"`
	Icon          string `description:"The icon name or path for the application"`
	Categories    string `description:"Categories in which the application should be shown e.g. 'Development;IDE;'"`
	Comment       string `description:"A brief description of the application"`
	Terminal      bool   `description:"Whether the application runs in a terminal" default:"false"`
	Keywords      string `description:"Keywords associated with the application e.g. 'Editor;Image;'" default:"wails"`
	Version       string `description:"The version of the Desktop Entry Specification" default:"1.0"`
	GenericName   string `description:"A generic name for the application"`
	StartupNotify bool   `description:"If true, the app will send a notification when starting" default:"false"`
	MimeType      string `description:"The MIME types the application can handle e.g. 'image/gif;image/jpeg;'"`
}

type Entitlement

type Entitlement struct {
	Key         string
	Name        string
	Description string
	Category    string
}

Entitlement represents a macOS entitlement

type FileAssociation

type FileAssociation struct {
	Ext         string `yaml:"ext"`
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	IconName    string `yaml:"iconName"`
	Role        string `yaml:"role"`
	MimeType    string `yaml:"mimeType"`
}

FileAssociation defines the structure for a file association.

type GenerateAppImageOptions

type GenerateAppImageOptions struct {
	Binary      string `description:"The binary to package including path"`
	Icon        string `description:"Path to the icon"`
	DesktopFile string `description:"Path to the desktop file"`
	OutputDir   string `description:"Path to the output directory" default:"."`
	BuildDir    string `description:"Path to the build directory"`
}

type GenerateConstantsOptions

type GenerateConstantsOptions struct {
	ConstantsFilename string `name:"f" description:"The filename for the models file" default:"constants.go"`
	OutputFilename    string `name:"o" description:"The output file" default:"constants.js"`
}

type GenerateWebView2Options

type GenerateWebView2Options struct {
	Directory string `name:"dir" json:"directory"`
}

type IOSOverlayGenOptions

type IOSOverlayGenOptions struct {
	Out    string `description:"Path to write overlay.json" default:"build/ios/xcode/overlay.json"`
	Config string `description:"Path to build/config.yml (optional)" default:"build/config.yml"`
}

IOSOverlayGenOptions holds parameters for overlay generation.

type IOSXcodeGenOptions

type IOSXcodeGenOptions struct {
	OutDir string `description:"Output directory for generated Xcode project" default:"build/ios/xcode"`
	Config string `description:"Path to build/config.yml (optional)" default:"build/config.yml"`
}

IOSXcodeGenOptions holds parameters for Xcode project generation.

type IconsOptions

type IconsOptions struct {
	Example           bool   `description:"Generate example icon file (appicon.png) in the current directory"`
	Input             string `description:"The input image file"`
	Sizes             string `description:"The sizes to generate in .ico file (comma separated)" default:"256,128,64,48,32,16"`
	WindowsFilename   string `description:"The output filename for the Windows icon"`
	MacFilename       string `description:"The output filename for the Mac icon bundle"`
	IconComposerInput string `description:"The input Icon Composer file (.icon)"`
	MacAssetDir       string `description:"The output directory for the Mac assets (Assets.car and icons.icns)"`
}

type LinuxCapabilities

type LinuxCapabilities struct {
	GTK4Available        bool   `json:"gtk4_available"`
	GTK3Available        bool   `json:"gtk3_available"`
	WebKitGTK6Available  bool   `json:"webkitgtk_6_available"`
	WebKit2GTK4Available bool   `json:"webkit2gtk_4_1_available"`
	Recommended          string `json:"recommended"`
}

type MSIXOptions

type MSIXOptions struct {
	// Info from project config
	Info struct {
		CompanyName       string `json:"companyName"`
		ProductName       string `json:"productName"`
		ProductVersion    string `json:"version"`
		ProductIdentifier string `json:"productIdentifier"`
		Description       string `json:"description"`
		Copyright         string `json:"copyright"`
		Comments          string `json:"comments"`
	}
	// File associations
	FileAssociations []struct {
		Ext         string `json:"ext"`
		Name        string `json:"name"`
		Description string `json:"description"`
		IconName    string `json:"iconName"`
		Role        string `json:"role"`
		MimeType    string `json:"mimeType,omitempty"`
	} `json:"fileAssociations"`
	// MSIX specific options
	Publisher             string `json:"publisher"`
	CertificatePath       string `json:"certificatePath"`
	CertificatePassword   string `json:"certificatePassword,omitempty"`
	ProcessorArchitecture string `json:"processorArchitecture"`
	ExecutableName        string `json:"executableName"`
	ExecutablePath        string `json:"executablePath"`
	OutputPath            string `json:"outputPath"`
	UseMsixPackagingTool  bool   `json:"useMsixPackagingTool"`
	UseMakeAppx           bool   `json:"useMakeAppx"`
}

MSIXOptions represents the configuration for MSIX packaging

type ProtocolConfig

type ProtocolConfig struct {
	Scheme      string `yaml:"scheme"                json:"scheme"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
}

ProtocolConfig defines the structure for a custom protocol in wails.json/wails.yaml

type ReleaseNotesOptions

type ReleaseNotesOptions struct {
	Version  string `name:"v" description:"The version to show release notes for"`
	NoColour bool   `name:"n" description:"Disable colour output"`
}

type RunTaskOptions

type RunTaskOptions struct {
	Name             string `pos:"1"`
	Help             bool   `name:"h" description:"shows Task usage"`
	Init             bool   `name:"i" description:"creates a new Taskfile.yml"`
	List             bool   `name:"list" description:"tasks with description of current Taskfile"`
	ListAll          bool   `name:"list-all" description:"lists tasks with or without a description"`
	ListJSON         bool   `name:"json" description:"formats task list as json"`
	Status           bool   `name:"status" description:"exits with non-zero exit code if any of the given tasks is not up-to-date"`
	Force            bool   `name:"f" description:"forces execution even when the task is up-to-date"`
	Watch            bool   `name:"w" description:"enables watch of the given task"`
	Verbose          bool   `name:"v" description:"enables verbose mode"`
	Version          bool   `name:"version" description:"prints version"`
	Silent           bool   `name:"s" description:"disables echoing"`
	Parallel         bool   `name:"p" description:"executes tasks provided on command line in parallel"`
	Dry              bool   `name:"dry" description:"compiles and prints tasks in the order that they would be run, without executing them"`
	Summary          bool   `name:"summary" description:"show summary about a task"`
	ExitCode         bool   `name:"x" description:"pass-through the exit code of the task command"`
	Dir              string `name:"dir" description:"sets directory of execution"`
	EntryPoint       string `name:"taskfile" description:"choose which Taskfile to run."`
	OutputName       string `name:"output" description:"sets output style: [interleaved|group|prefixed]"`
	OutputGroupBegin string `name:"output-group-begin" description:"message template to print before a task's grouped output"`
	OutputGroupEnd   string `name:"output-group-end" description:"message template to print after a task's grouped output"`
	Color            bool   `name:"c" description:"colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable" default:"true"`
	Concurrency      int    `name:"C" description:"limit number tasks to run concurrently"`
	Interval         int64  `name:"interval" description:"interval to watch for changes"`
}

type RuntimeOptions

type RuntimeOptions struct {
	Directory string `name:"d" description:"Directory to generate runtime file in" default:"."`
}

type SetupOptions

type SetupOptions struct{}

type SysoOptions

type SysoOptions struct {
	Manifest string `description:"The manifest file"`
	Info     string `description:"The info.json file"`
	Icon     string `description:"The icon file"`
	Out      string `description:"The output filename for the syso file"`
	Arch     string `description:"The target architecture"`
}

func (*SysoOptions) Default

func (i *SysoOptions) Default() *SysoOptions

type ToolCapabilitiesOptions

type ToolCapabilitiesOptions struct{}

type ToolCheckPortOptions

type ToolCheckPortOptions struct {
	URL  string `name:"u" description:"URL to check"`
	Host string `name:"h" description:"Host to check" default:"localhost"`
	Port int    `name:"p" description:"Port to check"`
}

type ToolVersionOptions

type ToolVersionOptions struct {
	Version    string `name:"v" description:"Current version to bump"`
	Major      bool   `name:"major" description:"Bump major version"`
	Minor      bool   `name:"minor" description:"Bump minor version"`
	Patch      bool   `name:"patch" description:"Bump patch version"`
	Prerelease bool   `name:"prerelease" description:"Bump prerelease version (e.g., alpha.5 to alpha.6)"`
}

type UpdateBuildAssetsOptions

type UpdateBuildAssetsOptions struct {
	Dir                string `description:"The directory to generate the files into"            default:"build"`
	Name               string `description:"The name of the project"`
	BinaryName         string `description:"The name of the binary"`
	ProductName        string `description:"The name of the product"                             default:"My Product"`
	ProductDescription string `description:"The description of the product"                      default:"My Product Description"`
	ProductVersion     string `description:"The version of the product"                          default:"0.1.0"`
	ProductCompany     string `description:"The company of the product"                          default:"My Company"`
	ProductCopyright   string `description:"The copyright notice"                                default:"© now, My Company"`
	ProductComments    string `description:"Comments to add to the generated files"              default:"This is a comment"`
	ProductIdentifier  string `description:"The product identifier, e.g com.mycompany.myproduct"`
	CFBundleIconName   string `description:"The macOS icon name (for Assets.car icon bundles)"`
	Config             string `description:"The path to the config file"`
	Silent             bool   `description:"Suppress output to console"`
}

UpdateBuildAssetsOptions defines the options for updating build assets.

type UpdateCLIOptions

type UpdateCLIOptions struct {
	NoColour   bool   `name:"n" description:"Disable colour output"`
	PreRelease bool   `name:"pre" description:"Update to the latest pre-release (eg beta)"`
	Version    string `name:"version" description:"Update to a specific version (eg v3.0.0)"`
	Latest     bool   `name:"latest" description:"Install the latest stable release"`
}

type UpdateConfig

type UpdateConfig struct {
	UpdateBuildAssetsOptions
	FileAssociations []FileAssociation `yaml:"fileAssociations"`
	Protocols        []ProtocolConfig  `yaml:"protocols,omitempty"`
}

UpdateConfig defines the configuration for updating build assets.

type VersionOptions

type VersionOptions struct{}

type WailsConfig

type WailsConfig struct {
	Info struct {
		CompanyName       string `yaml:"companyName"`
		ProductName       string `yaml:"productName"`
		ProductIdentifier string `yaml:"productIdentifier"`
		Description       string `yaml:"description"`
		Copyright         string `yaml:"copyright"`
		Comments          string `yaml:"comments"`
		Version           string `yaml:"version"`
		CFBundleIconName  string `yaml:"cfBundleIconName,omitempty"`
	} `yaml:"info"`
	FileAssociations []FileAssociation `yaml:"fileAssociations,omitempty"`
	Protocols        []ProtocolConfig  `yaml:"protocols,omitempty"`
}

WailsConfig defines the structure for a Wails configuration.

type WatcherOptions

type WatcherOptions struct {
	Config string `description:"The config file including path" default:"."`
}

Directories

Path Synopsis
build_assets
ios command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL