#[inspectable]Expand description
Marks a #[tauri::command] as inspectable by Victauri.
Generates a companion <fn_name>__schema() function that returns a
victauri_core::CommandInfo with the command’s name, description,
argument types, return type, and NL-resolution metadata.
Call the schema function at setup time to register the command in the
Victauri CommandRegistry.
§Dependency requirement
The generated code names victauri_core::... by absolute path, so the crate
using this attribute must list victauri-core in its own [dependencies]
(this holds whether the macro is imported from victauri_macros or via the
victauri_plugin::inspectable re-export). Without it, compilation fails with
E0433: failed to resolve: use of undeclared crate victauri_core.
victauri init adds the dependency automatically.
§Argument keys
Tauri renames command arguments to camelCase by default: a size_kb argument is
invoked as invoke("cmd", { sizeKb }). Each registered argument records that IPC
key (CommandArg::key), so an agent reading the registry passes the key the
command actually accepts. #[tauri::command] consumes its own attribute before
this macro runs, so when the command uses rename_all = "snake_case" or
rename = "...", repeat it here — #[inspectable(rename_all = "snake_case")],
#[inspectable(rename = "...")]. (Written above #[tauri::command(...)],
#[inspectable] reads those options itself.)
§Example
#[tauri::command]
#[inspectable(description = "Save API key for a provider")]
async fn save_api_key(provider: String, key: String) -> Result<(), String> {
// ...
}
// At setup:
state.registry.register(save_api_key__schema());