@tauri-apps/plugin-cli
Parse arguments from your Command Line Interface.
Interfaces
Section titled “Interfaces”ArgMatch
Section titled “ArgMatch”Defined in: plugins/cli/guest-js/index.ts:16
2.0.0
Properties
Section titled “Properties”| 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 |
CliMatches
Section titled “CliMatches”Defined in: plugins/cli/guest-js/index.ts:40
2.0.0
Properties
Section titled “Properties”| 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 |
SubcommandMatch
Section titled “SubcommandMatch”Defined in: plugins/cli/guest-js/index.ts:32
2.0.0
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
matches |
CliMatches |
plugins/cli/guest-js/index.ts:34 |
name |
string |
plugins/cli/guest-js/index.ts:33 |
Functions
Section titled “Functions”getMatches()
Section titled “getMatches()”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
Returns
Section titled “Returns”Example
Section titled “Example”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