### Install Missing Dependency (Linux) Source: https://v3alpha.wails.io/quick-start/installation Example command to install the `libwebkit2gtk-4.1-dev` package on Debian/Ubuntu systems when `wails3 doctor` reports it missing. ```bash sudo apt install libwebkit2gtk-4.1-dev ``` -------------------------------- ### Install Go from Tarball on Linux Source: https://v3alpha.wails.io/quick-start/installation Installs Go on Linux by extracting a tarball. This method requires manual removal of previous installations and extraction to the desired location. ```bash sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf go1.25.linux-amd64.tar.gz ``` -------------------------------- ### Install Wails CLI and Verify Source: https://v3alpha.wails.io/quick-start/installation Installs the Wails CLI using Go and then runs the doctor command to verify the installation. Ensure Go 1.25+ is installed first. ```bash # Install Go 1.25+, then: go install github.com/wailsapp/wails/v3/cmd/wails3@latest wails3 doctor # Verify installation ``` ```bash go install github.com/wailsapp/wails/v3/cmd/wails3@latest ``` ```bash wails3 doctor ``` -------------------------------- ### Install Go using Homebrew on macOS Source: https://v3alpha.wails.io/quick-start/installation Installs Go on macOS using the Homebrew package manager. ```bash brew install go ``` -------------------------------- ### Install Go using Package Managers on Linux Source: https://v3alpha.wails.io/quick-start/installation Installs Go on various Linux distributions using their respective package managers. ```bash # Ubuntu/Debian sudo apt install golang-go # Fedora sudo dnf install golang # Arch sudo pacman -S go ``` -------------------------------- ### Verify Go Installation Source: https://v3alpha.wails.io/quick-start/installation Checks the installed Go version. Requires Go 1.25 or later. ```bash go version # Should show 1.25 or later ``` -------------------------------- ### Install Node.js using Homebrew Source: https://v3alpha.wails.io/quick-start/installation Use Homebrew to install Node.js on macOS. ```bash brew install node ``` -------------------------------- ### Install GTK Dependencies on openSUSE Source: https://v3alpha.wails.io/quick-start/installation Installs the required development packages for GTK and WebKitGTK on openSUSE systems. ```bash sudo zypper install gcc pkg-config gtk3-devel webkit2gtk3-devel ``` -------------------------------- ### Install Wails CLI Source: https://v3alpha.wails.io Installs the Wails v3 command-line interface using Go's package management. ```bash # Install Wails go install github.com/wailsapp/wails/v3/cmd/wails3@latest ``` -------------------------------- ### Verify Go Installation and PATH on Linux Source: https://v3alpha.wails.io/quick-start/installation Confirms the Go installation and checks if the Go binary directory is correctly added to the system's PATH. ```bash go version echo $PATH | grep go/bin ``` -------------------------------- ### Install Node.js and npm using Package Manager (Arch) Source: https://v3alpha.wails.io/quick-start/installation Installs Node.js and npm using the Pacman package manager on Arch Linux. ```bash sudo pacman -S nodejs npm # Arch ``` -------------------------------- ### Install Node.js using Package Manager (Fedora) Source: https://v3alpha.wails.io/quick-start/installation Installs Node.js using the DNF package manager on Fedora. ```bash sudo dnf install nodejs # Fedora ``` -------------------------------- ### Verify npm Installation Source: https://v3alpha.wails.io/quick-start/installation Run this command to check if npm is installed and accessible in your system's PATH. ```bash npm --version ``` -------------------------------- ### Install Node.js using NodeSource (Ubuntu/Debian) Source: https://v3alpha.wails.io/quick-start/installation Installs Node.js LTS using the NodeSource repository on Ubuntu or Debian-based systems. ```bash curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - ``` ```bash sudo apt-get install -y nodejs # Ubuntu/Debian ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://v3alpha.wails.io/quick-start/installation Installs the necessary command line tools for development on macOS, which are required by Wails. ```bash xcode-select --install ``` -------------------------------- ### Install GTK Dependencies on Fedora Source: https://v3alpha.wails.io/quick-start/installation Installs the necessary development packages for GTK and WebKitGTK on Fedora systems. ```bash sudo dnf install gcc pkg-config gtk3-devel webkit2gtk4.1-devel ``` -------------------------------- ### Install GTK Dependencies on Ubuntu/Debian Source: https://v3alpha.wails.io/quick-start/installation Installs the required build tools and WebKitGTK development libraries for Wails on Ubuntu or Debian-based systems. ```bash sudo apt update sudo apt install build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev ``` -------------------------------- ### Install Development Version of Wails Source: https://v3alpha.wails.io/quick-start/installation Clones the Wails repository, checks out the v3 branch, and installs the development version of the `wails3` CLI. ```bash git clone https://github.com/wailsapp/wails.git cd wails git checkout v3 cd v3/cmd/wails3 go install ``` -------------------------------- ### Verify Go Installation and PATH on macOS Source: https://v3alpha.wails.io/quick-start/installation Checks the Go version and verifies if the Go binary directory is in the PATH on macOS. If not, it should be added to shell configuration files. ```bash go version # Should show 1.25 or later echo $PATH | grep go/bin # Should show ~/go/bin ``` ```bash export PATH=$PATH:~/go/bin ``` -------------------------------- ### Install GTK Dependencies on Arch Linux Source: https://v3alpha.wails.io/quick-start/installation Installs the base development tools, GTK3, and WebKitGTK development libraries for Wails on Arch Linux. ```bash sudo pacman -S base-devel gtk3 webkit2gtk-4.1 ``` -------------------------------- ### Run Wails Development Server Source: https://v3alpha.wails.io/quick-start/first-app Start the Wails development server to enable hot reloading and test your application locally. ```bash wails3 dev ``` -------------------------------- ### Verify Xcode Command Line Tools Installation Source: https://v3alpha.wails.io/quick-start/installation Checks if the Xcode command line tools are installed and accessible. ```bash xcode-select -p # Should show /Library/Developer/CommandLineTools ``` -------------------------------- ### Run Wails Application with Hot Reload Source: https://v3alpha.wails.io Navigates into the application directory and starts the Wails development server. This enables hot reloading for rapid development. ```bash # Run with hot reload cd myapp && wails3 dev ``` ```bash # Run with hot reload cd myapp; wails3 dev ``` ```bash # Run with hot reload cd myapp && wails3 dev ``` -------------------------------- ### Verify Wails Installation with Doctor Source: https://v3alpha.wails.io/quick-start/installation Runs the `wails3 doctor` command to perform a comprehensive check of the Wails installation and its dependencies. This command provides detailed system information and identifies any potential issues. ```bash wails3 doctor ``` -------------------------------- ### Add Go to PATH on Linux Source: https://v3alpha.wails.io/quick-start/installation Appends the Go binary directory to the PATH environment variable and reloads the shell configuration. This is necessary after installing Go via tarball or if the package manager did not handle it. ```bash export PATH=$PATH:/usr/local/go/bin:~/go/bin source ~/.bashrc # Reload ``` -------------------------------- ### Build Wails App for Production Source: https://v3alpha.wails.io/quick-start/first-app Use this command to compile your Go code with optimizations and build your frontend for production. The native executable will be placed in the `build/bin/` directory. ```bash wails3 build ``` -------------------------------- ### Create a New Wails Application Source: https://v3alpha.wails.io Initializes a new Wails project named 'myapp' using the 'vanilla' template. This command sets up the basic project structure. ```bash # Create your application wails3 init -n myapp -t vanilla ``` -------------------------------- ### List Available Wails Templates Source: https://v3alpha.wails.io/quick-start/installation Command to display a list of available project templates that can be used with `wails3 init`. ```bash wails3 init -l # List templates ``` -------------------------------- ### Define a Go Service for Frontend Calls Source: https://v3alpha.wails.io/quick-start/first-app Create a Go struct with exported methods to be called from the frontend. Ensure methods are capitalized to be exported. ```go package main import ( "fmt" ) type GreetService struct{} func (g *GreetService) Greet(name string) string { return fmt.Sprintf("Hello %s, It's show time!", name) } ``` -------------------------------- ### Generate New Wails Project Source: https://v3alpha.wails.io/quick-start/first-app Use this command to initialize a new Wails project with the default Vanilla + Vite template. Specify other templates like 'react', 'vue', or 'svelte' using the -t flag. ```bash wails3 init -n myapp cd myapp ``` -------------------------------- ### Wails Project Structure Overview Source: https://v3alpha.wails.io/quick-start/first-app Understand the default file and directory layout of a Wails project, including Go backend files, frontend code, and build configurations. ```text myapp/ ├── main.go # Application entry point ├── greetservice.go # Greet service ├── frontend/ # Your UI code │ ├── index.html # HTML entry point │ ├── src/ │ │ └── main.js # Frontend JavaScript │ ├── public/ │ │ └── style.css # Styles │ ├── package.json # Frontend dependencies │ └── vite.config.js # Vite bundler config ├── build/ # Build configuration └── Taskfile.yml # Build tasks ``` -------------------------------- ### Verify Go Bin in PATH (macOS/Linux) Source: https://v3alpha.wails.io/quick-start/installation Checks if the Go binary directory is present in the PATH and verifies the wails3 version. ```bash echo $PATH | grep go/bin wails3 version ``` -------------------------------- ### Check Go PATH on Windows Source: https://v3alpha.wails.io/quick-start/installation Verifies if the Go binary directory is included in the system's PATH environment variable on Windows. If not, it needs to be added. ```powershell $env:PATH -split ';' | Where-Object { $_ -like '*\go\bin' } ``` -------------------------------- ### Call New Go Service Method from Frontend Source: https://v3alpha.wails.io/quick-start/first-app Implement frontend logic to call the newly added Go service method, passing necessary arguments and handling the returned data. ```javascript window.greetMany = async () => { const names = ['Alice', 'Bob', 'Charlie']; const greetings = await GreetService.GreetMany(names); console.log(greetings); }; ``` -------------------------------- ### Add Go Bin to PATH (macOS/Linux) Source: https://v3alpha.wails.io/quick-start/installation Appends the Go binary directory to the PATH environment variable in Zsh or Bash. ```bash export PATH=$PATH:~/go/bin ``` -------------------------------- ### Configure NixOS for Wails GTK Development Source: https://v3alpha.wails.io/quick-start/installation Adds WebKitGTK and GTK3 development dependencies to a NixOS environment, typically within a `shell.nix` or `devShell` configuration. ```nix buildInputs = with pkgs; [ webkitgtk_4_1 gtk3 pkg-config gcc ]; ``` -------------------------------- ### Register Go Service with Wails Application Source: https://v3alpha.wails.io/quick-start/first-app Register your Go service struct with the Wails application in `main.go` to make its methods available to the frontend. ```go err := application.New(application.Options{ Name: "myapp", Services: []application.Service{ application.NewService(&GreetService{}), }, // ... other options }) ``` -------------------------------- ### Call Go Service Method from Frontend JavaScript Source: https://v3alpha.wails.io/quick-start/first-app Import the auto-generated service bindings and call Go methods asynchronously. Handle potential errors using try/catch blocks. ```javascript import {GreetService} from "../bindings/changeme"; window.greet = async () => { const nameElement = document.getElementById('name'); const resultElement = document.getElementById('result'); const name = nameElement.value; if (!name) { return; } try { const result = await GreetService.Greet(name); resultElement.innerText = result; } catch (err) { console.error(err); } }; ``` -------------------------------- ### Add New Method to Go Service Source: https://v3alpha.wails.io/quick-start/first-app Extend your Go service by adding new exported methods. Wails will automatically detect these changes during development. ```go func (g *GreetService) GreetMany(names []string) []string { greetings := make([]string, len(names)) for i, name := range names { greetings[i] = fmt.Sprintf("Hello %s!", name) } return greetings } ``` -------------------------------- ### Reload Shell Configuration Source: https://v3alpha.wails.io/quick-start/installation Applies changes to the shell configuration file (e.g., .zshrc or .bashrc) without restarting the terminal. ```bash source ~/.zshrc # or ~/.bashrc ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.