ExTauri.Plugins (ex_tauri v0.2.0)

View Source

Installs Tauri plugins into an existing src-tauri/ project.

Adding a Tauri plugin by hand takes three coordinated edits: a crate in src-tauri/Cargo.toml, a .plugin(...) registration in src-tauri/src/main.rs, and permissions in src-tauri/capabilities/default.json. This module (used by mix ex_tauri.add) performs all three, idempotently, so the Elixir-side API modules work without touching Rust.

Supported plugins

NameElixir APIWhat it enables
dialogExTauri.DialogNative file/message dialogs
fsExTauri.FilesystemFilesystem access outside the sandbox
clipboardExTauri.ClipboardRead/write the system clipboard
osExTauri.OSOS platform/arch/locale info
global-shortcutExTauri.GlobalShortcutApp-wide keyboard shortcuts
autostartExTauri.AutostartLaunch at login
processExTauri.AppExit/relaunch the app
updaterExTauri.UpdaterCheck for and install updates
deep-linkExTauri.EventHandle myapp:// URLs
windowExTauri.WindowRuntime window management permissions

window is a pseudo-plugin: window management is part of Tauri core, so it only adds the capability permissions (projects generated by current versions of mix ex_tauri.install already include them).

Summary

Functions

Installs the given plugins into the src-tauri/ project under base_dir.

Returns the list of plugin names that can be installed.

Normalizes a user-supplied plugin name to a registry key, or nil.

Returns the registry entry for a plugin name (already normalized).

Functions

add!(names, base_dir \\ File.cwd!())

Installs the given plugins into the src-tauri/ project under base_dir.

Patches Cargo.toml, src/main.rs, and capabilities/default.json for each plugin. All edits are idempotent — installing an already-installed plugin is a no-op. Raises with an actionable message on unknown plugin names or a missing src-tauri/ directory.

known()

Returns the list of plugin names that can be installed.

normalize(name)

Normalizes a user-supplied plugin name to a registry key, or nil.

spec(name)

Returns the registry entry for a plugin name (already normalized).