Skip to content
Skills Library
Programming · Building & coding

add-tauri-command

/add-tauri-command

Adds a MooshieUI Tauri command end-to-end — Rust handler, lib.rs registration, and TypeScript ipcInvoke wrapper. Use when adding a backend command, IPC endpoint, or /add-tauri-command.

Repository
MooshieUI ↗
Licence
AGPL-3.0
Last repository change
24.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

What it does and when to use it

Adds a MooshieUI Tauri command end-to-end — Rust handler, lib.rs registration, and TypeScript ipcInvoke wrapper. Use when adding a backend command, IPC endpoint, or /add-tauri-command.

Original author description

Adds a MooshieUI Tauri command end-to-end — Rust handler, lib.rs registration, and TypeScript ipcInvoke wrapper. Use when adding a backend command, IPC endpoint, or /add-tauri-command.

How it works

  1. Gather from user
  2. 1. Rust — src-tauri/src/commands/{module}.rs
  3. 2. Register — src-tauri/src/lib.rs
  4. 3. TypeScript — src/lib/utils/api.ts
  5. Verify
Original SKILL.md headings · 68 lines, 256 words
SKILL.md preview
---
name: add-tauri-command
description: >-
  Adds a MooshieUI Tauri command end-to-end — Rust handler, lib.rs registration,
  and TypeScript ipcInvoke wrapper. Use when adding a backend command, IPC endpoint,
  or /add-tauri-command.
---

# Add Tauri Command (MooshieUI)

Minimum **3 files**, in this order. Works in **desktop and browser mode** only if you use `ipcInvoke()` (never raw `invoke()`).

## Gather from user

1. Command name (Rust `snake_case`, TS `camelCase` function)
2. Parameters (name + type each)
3. Return type
4. Module: `api` | `server` | `websocket` | `workflow` | `config` | new
5. Needs `AppHandle`? (only for events / app paths)

## 1. Rust — `src-tauri/src/commands/{module}.rs`

```rust
#[tauri::command]
pub async fn my_command(
    state: State<'_, AppState>,
    my_param: String,
) -> Result<ReturnType, AppError> {
    let config = state.config.read().await;
    // ...
    drop(config);
    Ok(result)
}
```

- `Result<T, AppError>` only; no panic
- `AppHandle` only if emitting events / spawning tasks
- Drop `RwLock` before I/O `.await`
- HTTP via `state.http_client`
- New module → `pub mod x;` in `commands/mod.rs`

## 2. Register — `src-tauri/src/lib.rs`

```rust
.invoke_handler(tauri::generate_handler![
    commands::api::my_command,
])
```

## 3. TypeScript — `src/lib/utils/api.ts`

```typescript
export async function myCommand(myParam: string): Promise<ReturnType> {
  return ipcInvoke("my_command", { myParam });
}
```

- camelCase keys in payload; Rust receives snake_case
- New shapes → `src/lib/types/index.ts` (serde field names, often snake_case)

## Verify

```powershell
cargo check --manifest-path src-tauri/Cargo.toml
```

```
- [ ] #[tauri::command] + Result<_, AppError>
- [ ] Listed in generate_handler!
- [ ] api.ts uses ipcInvoke("my_command", ...)
- [ ] Names aligned TS camelCase ↔ Rust snake_case
- [ ] Browser mode: matching arm in `webserver.rs` `dispatch_command` (and `ADMIN_COMMANDS` / `MODERATOR_COMMANDS` if restricted)
- [ ] MCP: would an AI assistant want this? If so, consider a tool in `src-tauri/src/mcp/tools.rs` (see `docs/MCP.md`)
```

Versions

The database has no other skills named add-tauri-command.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 4b97d3285663 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95lov-optimize-tauri-backend
    Optimize Tauri backend architecture and development ergonomics for Tauri 2 apps, especially Rust restart pain, oversized src-tauri/src/lib.rs files, excessive #[tauri::command] surfaces, stringly invoke APIs, long IPC streams, and dev-state recovery. Use when the user asks about…
  • 100screenpipe-tauri
    Add or change Tauri commands and TypeScript bindings in the screenpipe desktop app. Use when editing #[tauri::command] handlers, lib/utils/tauri.ts, or Rust types exported to the frontend.
  • 100rust-tauri-backend
    Implement or modify VMark's Rust/Tauri v2 backend and its frontend bridge - Tauri commands, invoke/emit/listen IPC, menu items and accelerators, Tauri plugins and capabilities, windows, filesystem and platform behaviour in src-tauri. Use for any change under src-tauri/ or to a…
  • 85tauri
    Cross-platform app toolkit with Rust backend and WebView frontend. Use when building or maintaining Tauri apps, configuring IPC/security, or developing plugins.
  • 96tauri
    Tauri开发专家助手。当用户需要进行Tauri桌面应用开发、Rust后端+Web前端桌面应用、轻量级跨平台应用或系统级API调用时调用。
  • 100rust-errors
    Rust to TypeScript error handling patterns for Tauri apps. Use when defining Rust errors that will be passed to TypeScript, handling Tauri command errors, or creating discriminated union error types.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.