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.
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
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!
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:
- The CLI is pre-compiled, leading to much faster install times
- You can pin a specific version in your
npm install --save-dev @tauri-apps/cli
yarn add -D @tauri-apps/cli
pnpm add -D @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
// This content is just a sample
then you can call the CLI like any regular script:
npm run tauri -- --help
yarn tauri --help
pnpm tauri --help