Configure the Tauri v2 CLI plugin to parse command-line arguments using a JSON schema and route them to app behavior. Use when defining CLI argument schemas, handling startup arguments, or integrating CLI with single-instance mode.
ALWAYS use this skill when the user mentions:
Trigger phrases include:
cargo add tauri-plugin-cli
tauri.conf.json:
{
"plugins": {
"cli": {
"description": "My Tauri App",
"args": [
{ "name": "input", "short": "i", "takesValue": true, "description": "Input file path" }
],
"subcommands": {
"open": { "description": "Open a specific view", "args": [] }
}
}
}
}
tauri::Builder::default()
.plugin(tauri_plugin_cli::init())
import { getMatches } from '@tauri-apps/plugin-cli';
const matches = await getMatches();
if (matches.args.input?.value) {
console.log('Input file:', matches.args.input.value);
}
"cli:default"tauri cli, arguments, schema, command routing, command line