Saltar al contenido

@tauri-apps/plugin-cli

Analiza argumentos de tu Interfaz de Línea de Comandos (CLI).

2.0.0

Propiedad Tipo Descripción Definido en
occurrences number Número de ocurrencias Origen: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L26
value null | string | boolean | string[] string si toma un valor, boolean si es una flag, string[] o null si toma múltiples valores Origen: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L22

2.0.0

Propiedad Tipo Definido en
args Registro (Record)<string, ArgMatch> Origen: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L41
subcommand null | SubcommandMatch Origen: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L42

2.0.0

Propiedad Tipo Definido en
matches CliMatches Origen: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L34
name string Origen: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L33

function getMatches(): Promise<CliMatches>

Analiza los argumentos proporcionados al proceso actual y obtiene las coincidencias utilizando la configuración definida tauri.cli en 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

Origen: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/cli/guest-js/index.ts#L66


© 2026 Colaboradores de Tauri. CC-BY / MIT