Skip to main content

Install Tauri CLI

The Tauri CLI is the heart of the development process. It runs Cargo to compile the Rust core, starts your frontend development server, bundles all your assets, sidecars and resources when building for production, and even takes care of code-signing!

The CLI is available from a number of sources, depending on your preference.

Cargo

As the CLI is written in Rust, it is naturally available through crates.io and installable with Cargo using the following command:

cargo install tauri-cli --version "^1.0.0"

After the installation has finished you can invoke it as a cargo subcommand:

cargo tauri --help
note

Even though installing the CLI through Cargo is the preferred option, it has to compile the whole binary from scratch when you install it. If you're in a CI environment or on a very slow machine you're better off choosing another installation method!

NPM

We also compile the CLI as a native Node.js addon and distribute it via NPM. This has a number of advantages compared to the Cargo installation method:

  1. The CLI is pre-compiled, leading to much faster install times
  2. You can pin a specific version in your package.json file
  3. If you develop custom tooling around Tauri, you can import the CLI as a regular JavaScript module

You can install the CLI using a JavaScript manager:

npm install --save-dev @tauri-apps/cli

After the installation has finished you can invoke the CLI using your package manager:

When using npm, you first need to add tauri as a script to your package.json:

package.json
{
// This content is just a sample
"scripts": {
"tauri": "tauri"
}
}

then you can call the CLI like any regular script:

npm run tauri -- --help