tauri-apps/tauri · error · Error::GenericError

You did not select any capabilities to update

Error message

You did not select any capabilities to update

What it means

`tauri permission add` shows an interactive multi-select prompt when more than one capability file exists and no `--capability` argument was passed. If you confirm the prompt with zero entries selected, the CLI aborts with this message rather than silently modifying nothing.

Source

Thrown at crates/tauri-cli/src/acl/permission/add.rs:250

        options.identifier
      ),
      capabilities
        .iter()
        .map(|(c, p)| {
          let id = c.identifier();
          if id.is_empty() {
            dunce::simplified(p).to_str().unwrap_or_default()
          } else {
            id
          }
        })
        .collect::<Vec<_>>()
        .as_slice(),
      None,
    )?;

    if selections.is_empty() {
      crate::error::bail!("You did not select any capabilities to update");
    }

    selections
      .into_iter()
      .map(|idx| capabilities[idx].clone())
      .collect()
  } else {
    capabilities
  };

  if capabilities.is_empty() {
    crate::error::bail!("Could not find a capability to update");
  }

  for (capability, path) in &mut capabilities {
    if capability.has_permission(&options.identifier) {
      log::info!(
        "Permission `{}` already found in `{}` at {}",

View on GitHub (pinned to 52e4b6e71d)

Solutions

  1. Re-run the command and press Space on at least one capability before pressing Enter
  2. Skip the prompt entirely by passing the capability explicitly: `tauri permission add <id> --capability <capability-identifier>`
  3. In scripts/CI, always pass `--capability` so the interactive branch is never reached

Example fix

# before
chmod +x . ; tauri permission add fs:allow-read-text-file
# after
tauri permission add fs:allow-read-text-file --capability default
Defensive patterns

Strategy: validation

Validate before calling

# enumerate capability identifiers first, then pass one explicitly
ids=$(grep -h '"identifier"' src-tauri/capabilities/*.json 2>/dev/null | sed 's/.*: *"\([^"]*\)".*/\1/')
[ -n "$ids" ] || { echo 'no capabilities found'; exit 1; }
tauri permission add fs:default --capability $(echo "$ids" | head -n1)

Prevention

When it happens

Trigger: Running `tauri permission add <id>` in a project with multiple files under `capabilities/` and pressing Enter without first toggling entries with Space; or running in a pseudo-terminal/CI context where the multiselect prompt resolves to an empty selection.

Common situations: Developers unfamiliar with multiselect keybindings (Space toggles, Enter confirms); scripts or CI that hit the interactive branch because `--capability` was omitted.

Related errors


AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20). Data as JSON: /api/errors/60554e542877587b. Report an issue: GitHub.