Skip to content

@tauri-apps/plugin-cli

Parse arguments from your Command Line Interface.

Defined in: plugins/cli/guest-js/index.ts:16

2.0.0

Property Type Description Defined in
occurrences number Number of occurrences plugins/cli/guest-js/index.ts:26
value string | boolean | string[] | null string if takes value boolean if flag string[] or null if takes multiple values plugins/cli/guest-js/index.ts:22

Defined in: plugins/cli/guest-js/index.ts:40

2.0.0

Property Type Defined in
args Record<string, ArgMatch> plugins/cli/guest-js/index.ts:41
subcommand SubcommandMatch | null plugins/cli/guest-js/index.ts:42

Defined in: plugins/cli/guest-js/index.ts:32

2.0.0

Property Type Defined in
matches CliMatches plugins/cli/guest-js/index.ts:34
name string plugins/cli/guest-js/index.ts:33

function getMatches(): Promise<CliMatches>;

Defined in: plugins/cli/guest-js/index.ts:66

Parse the arguments provided to the current process and get the matches using the configuration defined tauri.cli in tauri.conf.json

Promise<CliMatches>

import { getMatches } from '@tauri-apps/plugin-cli';
const matches = await getMatches();
if (matches.subcommand?.name === 'run') {
// `./your-app run $ARGS` was executed
const args = matches.subcommand?.matches.args
if ('debug' in args) {
// `./your-app run --debug` was executed
}
} else {
const args = matches.args
// `./your-app $ARGS` was executed
}

2.0.0


© 2026 Tauri Contributors. CC-BY / MIT