@tauri-apps/plugin-cli
Parse arguments from your Command Line Interface.
Interfaces
Section titled “Interfaces”ArgMatch
Section titled “ArgMatch”Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L18
The resolution of a single CLI argument match.
2.0.0
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
occurrences |
number |
Number of occurrences | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L28 |
value |
string | boolean | string[] | null |
string if takes value boolean if flag string[] or null if takes multiple values | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L24 |
CliMatches
Section titled “CliMatches”Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L48
The resolved matches of the CLI arguments and, if any, its matched subcommand.
2.0.0
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
args |
Record<string, ArgMatch> |
The matched arguments, keyed by argument name. | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L50 |
subcommand |
SubcommandMatch | null |
The matched subcommand, or null if no subcommand was invoked. |
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L52 |
SubcommandMatch
Section titled “SubcommandMatch”Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L36
The result of matching a subcommand of the CLI definition.
2.0.0
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
matches |
CliMatches |
The argument matches of the subcommand, resolved the same way as the parent command’s matches. | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L40 |
name |
string |
The name of the matched subcommand. | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L38 |
Functions
Section titled “Functions”getMatches()
Section titled “getMatches()”function getMatches(): Promise<CliMatches>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L77
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”A promise resolving to the parsed CLI matches.
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