Skip to main content

CLI

The tauri.js cli is composed in TypeScript and published as JavaScript.

info

yarn tauri info
  Description
Returns the known state of tauri dependencies and configuration

It shows a concise list of information about the environment, Rust, Node.js and their versions as well as some relevant configurations.

init

yarn tauri init
Initializes a Tauri project

USAGE:
cargo tauri init [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
--ci Skip prompting for values
-f, --force Force init to overwrite the src-tauri folder
-h, --help Print help information
-l, --log Enables logging
-V, --version Print version information

OPTIONS:
-A, --app-name <app-name> Name of your Tauri application
-d, --directory <directory> Set target directory for init
-D, --dist-dir <dist-dir> Web assets location, relative to <project-dir>/src-tauri
-P, --dev-path <dev-path> Url of your dev server
-t, --tauri-path <tauri-path> Path of the Tauri project to use (relative to the cwd)
-W, --window-title <window-title> Window title of your Tauri application

SUBCOMMANDS:
help Print this message or the help of the given subcommand(s)

dev

yarn tauri dev
Tauri dev.

USAGE:
cargo tauri dev [FLAGS] [OPTIONS] [--] [args]...

ARGS:
<args>... Args passed to the binary

FLAGS:
-e, --exit-on-panic Exit on panic
-h, --help Print help information
--release Run the code in release mode
-V, --version Print version information

OPTIONS:
-c, --config <config> config JSON to merge with tauri.conf.json
-f, --features <features>... list of cargo features to activate
-r, --runner <runner> binary to use to run the application
-t, --target <target>... target triple to build against

This command will open the WebView in development mode. It makes use of the build.devPath property from your src-tauri/tauri.conf.json file.

If you have entered a command to the build.beforeDevCommand property, this one will be executed before the dev command.

See more about the configuration.

deps

yarn tauri deps update
  Description
Tauri dependency management script
Usage
$ tauri deps [install|update]

build

yarn tauri build
Tauri build.

USAGE:
cargo tauri build [FLAGS] [OPTIONS]

FLAGS:
-d, --debug Builds with the debug flag
-h, --help Print help information
-v, --verbose Enables verbose logging
-V, --version Print version information

OPTIONS:
-b, --bundle <bundle>... list of bundles to package
-c, --config <config> config JSON to merge with tauri.conf.json
-f, --features <features>... list of cargo features to activate
-r, --runner <runner> binary to use to build the application
-t, --target <target>... target triple to build against

This command will bundle your application, either in production mode or debug mode if you used the --debug flag. It makes use of the build.distDir property from your src-tauri/tauri.conf.json file.

If you have entered a command to the build.beforeBuildCommand property, this one will be executed before the build command.

See more about the configuration.

icon

yarn tauri icon
  Description
Create all the icons you need for your Tauri app.

Usage
$ tauri icon /path/to/icon.png

Options
--help, -h Displays this message
--log, -l Logging [boolean]
--target, -t Target folder (default: 'src-tauri/icons')
--compression, -c Compression type [optipng|zopfli]
--ci Runs the script in CI mode

This command will generate a set of icons, based on the source icon you've entered. Note that the source icon must be 1240x1240 with transparency.

version

yarn tauri --version
  Description
Returns the current version of tauri

This command will show the current version of Tauri.

CLI usage

See more about the usage through this complete guide.