Desktop CLI
This page covers the frigear-desktop command and what each OS needs to build the app. Set up the module first:
Overview.
Commands
frigear-desktop init [--force] [--cwd <dir>] # create src-tauri/, then sync
frigear-desktop sync [--cwd <dir>] # merge the desktop settings into src-tauri/
frigear-desktop dev [--cwd <dir>] [-- <args>] # sync, then tauri dev
frigear-desktop build [--cwd <dir>] [-- <args>] # sync, then tauri build
frigear-desktop sidecar [--cwd <dir>] [--target <triple>] # local mode: the compiled server only
frigear-desktop doctor [--fix] [--cwd <dir>] # Rust, @tauri-apps/cli, OS prerequisites, project
init, sync, dev, build and sidecar run nuxt prepare first, so they always use the current desktop options. They
stop when desktop.appId is not set.
initcreatessrc-tauri/:Cargo.tomlwith Tauri 2 and the opener, deep-link and store plugins (and single-instance with itsdeep-linkfeature, autostart and updater when those options are on),src/main.rsandsrc/lib.rsthat register them,build.rs, a.gitignorefortarget/and placeholder icons. Then it runssync. Files that exist are kept, unless you pass--force.src/lib.rsis yours from then on:syncnever changes it.syncmerges.nuxt/desktop/tauri.jsonintosrc-tauri/tauri.conf.json, keeping every key the module does not own, and writessrc-tauri/capabilities/frigear.json. Running it again changes nothing. See What the module writes.devrunstauri dev. ItsbeforeDevCommand(npx nuxt dev --port 3000, written byinit) starts the dev server, and the window opens ondevUrl. In local mode there is no sidecar underdev: the window loadsnuxt dev, which uses NuxtHub's own database in.data/.buildrunstauri build. ItsbeforeBuildCommand(npx nuxt generate) builds the SPA into.output/public, and Tauri bundles it. The installers end up insrc-tauri/target/release/bundle/. In local mode it runsnuxt buildand compiles the server with Bun intosrc-tauri/binaries/<binaryName>-<target triple>first, thentauri buildwithout thebeforeBuildCommand. The target is that of-- --target <triple>, else this machine's.sidecar(local mode) runsnuxt buildand compiles the server, without Tauri. Use--target <triple>to cross-compile, for examplex86_64-pc-windows-msvcfrom a Mac.doctorchecks the machine and the app (in local mode also Bun andtauri-plugin-shell), prints a fix for each problem, and exits with1when something blocks a build. It works beforenuxt preparetoo, without the package checks.doctor --fixsets up what is missing, then checks again. See Set up a machine.
Options after -- go to the Tauri CLI, such as frigear-desktop build -- --debug or
frigear-desktop build -- --bundles dmg.
Change beforeDevCommand and beforeBuildCommand in tauri.conf.json if your app starts differently, for example
with pnpm dev. sync does not own them, except that it keeps the npx nuxt dev --port <port> that init wrote on
the port of devUrl when you change the dev port.
Icons
init writes a plain placeholder icons/icon.png and icons/icon.ico, so the project compiles. Replace them with
your logo before a release:
npx tauri icon path/to/logo.png # a square PNG, 1024px, into src-tauri/icons/
tauri icon writes more sizes than the placeholders. List them in bundle.icon of tauri.conf.json.
Prerequisites
Every OS needs Rust (cargo and rustc) from rustup.rs and @tauri-apps/cli in the app.
Local mode also needs Bun on the build machine: in BUN, on the PATH, or where bun.sh's
installer puts it ($BUN_INSTALL/bin, ~/.bun/bin), in that order. frigear-desktop doctor checks all of them, and
frigear-desktop doctor --fix installs most of them.
Set up a machine
npx frigear-desktop doctor --fix
It runs nuxt prepare, then fixes what it can without help, and runs doctor again:
| Missing | What --fix does |
|---|---|
| Rust (macOS, Linux) | Runs the rustup installer unattended: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal. |
| Bun (local mode) | Runs bun.sh's installer: curl -fsSL https://bun.sh/install | bash (PowerShell's irm bun.sh/install.ps1 | iex on Windows), into ~/.bun. |
@tauri-apps/cli, Tauri plugin packages | Adds them with the app's package manager (the one running the command, else the lockfile's, else pnpm). |
src-tauri/ | Runs init. |
| Xcode Command Line Tools (macOS) | Runs xcode-select --install, which opens Apple's dialog. Run --fix again once it is done. |
It never runs sudo: the Linux system packages and the Windows installers below stay yours to install.
You do not need a new terminal after the installs. When cargo is not on the PATH but in $CARGO_HOME/bin or
~/.cargo/bin, doctor says so and dev and build put that folder on the PATH of tauri. Bun is found in
~/.bun/bin the same way.
| OS | Also needs | Checked by doctor |
|---|---|---|
| macOS | The Xcode Command Line Tools: xcode-select --install. | Yes |
| Windows | The Microsoft C++ Build Tools ("Desktop development with C++") and WebView2. | Noted only |
| Linux | pkg-config and WebKitGTK 4.1 with its build dependencies. | Yes |
Windows. WebView2 ships with Windows 10 (version 1803 and later) and Windows 11. On older systems install the Evergreen runtime from Microsoft.
Linux. Install WebKitGTK 4.1 and the other build dependencies:
# Debian / Ubuntu
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev \
libayatana-appindicator3-dev librsvg2-dev
# Fedora
sudo dnf install webkit2gtk4.1-devel openssl-devel libappindicator-gtk3-devel librsvg2-devel
# Arch
sudo pacman -S webkit2gtk-4.1 base-devel openssl libappindicator-gtk3 librsvg
WEBKIT_DISABLE_DMABUF_RENDERER=1, for example WEBKIT_DISABLE_DMABUF_RENDERER=1 npx frigear-desktop dev.Deep links during development
macOS registers the deep-link schemes when the app bundle is installed, so a scheme link reaches the app only from a
built and installed app. On Linux, and on Windows in development, the generated src/lib.rs registers the schemes
when the app starts.
Under dev Auth signs in with a redirect inside the window instead, so the dev server's callback
(http://localhost:3000/auth/callback) has to be a redirect URI on the issuer. See
Register the client on the issuer.
Overview
Turns a Nuxt app into a Tauri desktop app for macOS, Windows and Linux, either a static SPA that signs in at a remote issuer or the whole app with its own offline server.
Local mode
Ship the whole Nuxt app, server modules included, inside the desktop app. It runs offline on a sqlite database in the user's app-data folder.