WannaCut’s Rust backend exposes 27 Tauri commands called viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ter-9001/WannaCut/llms.txt
Use this file to discover all available pages before exploring further.
invoke() from the React frontend. These commands handle every privileged operation the browser-based WebView cannot perform on its own: file I/O, FFmpeg/FFprobe subprocess management, font downloads, YouTube video fetching, and project data persistence. All commands are async (powered by Tokio) and return serialized JSON.
All
invoke() calls use Tauri v2’s @tauri-apps/api/core package. Parameters are passed as a plain object (the second argument to invoke), and return values are typed generics:Project Management Commands
These commands handle creating, loading, saving, renaming, and deleting projects. A WannaCut project is a directory on disk containing aproject.json config file, a videos/ assets folder, an extracted_audios/ folder, and timestamped .project save files.
list_projects
Lists all projects in the workspace root directory. Each item in the returned array represents one project folder.
Absolute path to the WannaCut workspace directory (e.g.
/home/user/WannaCutWorkspace).Array<{ name: string; path: string; thumbnail?: string }>
Each object contains the project name, its absolute path, and an optional thumbnail path (points to the most recently generated frame PNG in the project directory, if available).
create_project_setup
Creates a new project directory structure on disk, including the videos/, extracted_audios/, and thumbnails/ subdirectories, and writes the initial project.json config file.
Absolute path to the workspace root.
Name for the new project. Used as the directory name.
Initial project configuration object with
name, width, height, fps, backgroundColor, and sampleRate.string — The absolute path to the newly created project directory.
load_latest_project
Reads the most recently timestamped .project file from a project directory and returns its raw JSON content. Used when opening an existing project to restore the last editing session.
Absolute path to the project directory.
string — Raw JSON string of the latest .project file. Parsed by the frontend to restore clips, assets, and tracks.
save_project_data
Saves the current project state (clips, assets, tracks) to a new timestamped .project file. Called automatically by the frontend with a 500 ms debounce whenever clips or assets change. This creates an incremental history of saves, which can be browsed via list_project_files and read_specific_file.
Absolute path to the project directory.
JSON-serialized
ProjectFileData object containing projectName, assets, clips, tracks, and lastModified.Unix timestamp in milliseconds. Used as the filename suffix for the saved
.project file.void
load_project_config
Reads the project.json file from a project directory and returns the parsed project settings (resolution, FPS, name, etc.).
Absolute path to the project directory.
ProjectSettings — Object with name, width, height, fps, backgroundColor, sampleRate.
save_project_config
Saves updated project settings to project.json. If the name field has changed, the project directory is also renamed on disk to match the new name.
Absolute path to the current project directory.
Updated settings object. If
config.name differs from the current directory name, the directory is renamed.string — The (potentially new) absolute path to the project directory after saving and any rename.
delete_project
Permanently deletes an entire project directory and all its contents (assets, audio extractions, thumbnails, save files). This action is irreversible.
Absolute path to the project directory to delete.
void
list_project_files
Lists all .project history files in a project directory, sorted by timestamp. Used by the Settings modal to display the project’s save history for rollback.
Absolute path to the project directory.
string[] — Array of .project filenames (e.g. ["main_1700000000000.project", "main_1700000500000.project"]), sorted oldest to newest.
read_specific_file
Reads the raw content of a specific .project history file. Used to load a previous version of the project for history rollback.
Absolute path to the
.project file to read.string — Raw JSON content of the file.
Asset Management Commands
These commands handle importing media files, reading metadata, and file operations within a project’svideos/ folder.
import_asset
Copies a media file from its original location into the project’s videos/ folder. This is the standard way to add assets to a project — WannaCut always works with local copies.
Absolute path to the project directory.
Absolute path to the source media file to import.
void
list_assets
Returns the filenames of all files currently in a project’s videos/ folder.
Absolute path to the project directory.
string[] — Array of filenames (e.g. ["clip1.mp4", "background.png", "music.mp3"]).
get_duration
Uses FFprobe to read the exact duration of a media file (video or audio).
Absolute path to the media file.
{ duration: number } — Duration in seconds (e.g. { duration: 42.5 }). For images, returns a fallback of 10.
get_video_frame
Uses FFmpeg to extract a single frame from a video at a specific timestamp and returns it as a base64-encoded PNG data URL. Used by the Source Monitor and for the preview fast-path.
Absolute path to the video file.
Time position in milliseconds to extract the frame from.
string — A base64 PNG data URL (e.g. "data:image/png;base64,iVBOR...").
get_asset_dimensions
Reads the pixel dimensions (width × height) of a video or image file.
Absolute path to the video or image file.
{ x: number; y: number } — Width (x) and height (y) in pixels.
extract_audio
Extracts the audio track from a video file and saves it as an MP3 to the project’s extracted_audios/ folder. Called automatically for every video asset on import. The MP3 is served by the tiny_http server for preview playback.
Absolute path to the project directory.
Filename of the video inside
videos/ (e.g. "clip.mp4").void — The extracted audio is saved as <projectPath>/extracted_audios/<name>.mp3.
generate_thumbnail
Generates (or retrieves from cache) a thumbnail PNG for a video at a specific time. Thumbnails are stored in <projectPath>/thumbnails/ and cached to avoid re-generating on every scrub.
Absolute path to the project directory.
Filename of the video inside
videos/.Time in seconds at which to capture the thumbnail frame.
string — Absolute path to the generated or cached thumbnail PNG file.
copy_file
Copies a file from one path to another. Used internally for the “Separate Audio” feature, which copies an extracted MP3 from extracted_audios/ into videos/ to make it available as a timeline asset.
Absolute path to the source file.
Absolute path to the destination file.
void
rename_file
Renames or moves a file on disk. Used when the user renames an asset in the media library.
Current absolute path of the file.
New absolute path (or new name within the same directory).
void
delete_file
Deletes a single file from disk. Used when the user deletes an asset from the media library (along with removing it from the timeline state).
Absolute path to the file to delete.
void
Export Commands
These three commands work together to implement the three-phase export pipeline: render video frames, mix audio offline, then assemble the final MP4.save_export_frame
Saves a single rendered PNG frame to a temporary directory during export. Called once per frame in Phase 1 of the export pipeline, with a base64-encoded PNG from the offscreen Three.js renderer.
Absolute path to the project directory. The temp frames directory is created here.
Zero-based frame index (e.g.
0 for the first frame, fps * duration - 1 for the last).Base64-encoded PNG data URL of the rendered frame (from
auxCanvas.toDataURL("image/png")).void
assemble_exported_video
Runs FFmpeg to combine the exported PNG frame sequence with the mixed WAV audio file into a final MP4 video. This is Phase 3 of the export pipeline and reports progress back to the frontend via Tauri events (export-progress).
Absolute path to the project directory containing the temp frames and WAV audio.
Absolute output path for the final MP4 file (chosen by the user via the native save dialog).
Frame rate of the export (must match the FPS used to render the PNG sequence).
Total duration of the video in seconds.
Video width in pixels.
Video height in pixels.
void — Progress is emitted as Tauri events (export-progress, payload: number 0–100) during execution.
cancel_export
Kills the currently running FFmpeg export subprocess. Called when the user clicks “Abort Mission” during an in-progress export.
Parameters: None
Returns: void
After calling
cancel_export, the partially assembled output file and temp frame directory may remain on disk. WannaCut resets renderStatus to 'idle' after cancellation but does not clean up the temp files automatically.Font & Download Commands
list_fonts
Lists all font files in the WannaCut fonts directory. Font paths are used to dynamically load @font-face declarations into the WebView so fonts are available in text clips.
Absolute path to the fonts directory (e.g.
<settingsFolder>/fonts).string[] — Array of absolute paths to font files.
fetch_cloud_fonts
Fetches the WannaCut cloud font manifest from wannacut.app via Rust’s reqwest HTTP client. Returns a list of available fonts that can be downloaded.
Parameters: None
Returns: { fonts: Array<{ file: string; [key: string]: any }> } — The font manifest JSON from the WannaCut CDN.
download_font_file
Downloads a font file from a URL and saves it to a local path (typically the app’s fonts/ directory).
Full HTTPS URL of the font file to download.
Absolute local path where the font file should be saved.
void
download_youtube_video
Downloads a video from a given URL using yt-dlp and saves it to the project’s videos/ folder. yt-dlp must be available — it is bundled with WannaCut via the Node.js runtime.
Absolute path to the project directory. The downloaded video is saved to
<projectPath>/videos/.Absolute path to the WannaCut settings folder, used to locate the bundled
yt-dlp runtime.URL of the video to download (YouTube, or any URL supported by
yt-dlp).void
Settings Commands
read_settings_file
Reads the raw content of the WannaCut settings JSON file. Called on startup to load the user’s workspace path, GPU preference, and keyboard shortcuts.
Absolute path to
wannacut_settings.json (e.g. <settingsFolder>/wannacut_settings.json).string — Raw JSON content of the settings file. The frontend parses this to restore wannacutSettings state (workspace, gpu, shortcuts).
Command Quick Reference
| Command | Group | Key Return |
|---|---|---|
list_projects | Project | {name, path, thumbnail?}[] |
create_project_setup | Project | string (path) |
load_latest_project | Project | string (JSON) |
save_project_data | Project | void |
load_project_config | Project | ProjectSettings |
save_project_config | Project | string (path) |
delete_project | Project | void |
list_project_files | Project | string[] |
read_specific_file | Project | string (JSON) |
import_asset | Asset | void |
list_assets | Asset | string[] |
get_duration | Asset | {duration: number} |
get_video_frame | Asset | string (base64 PNG) |
get_asset_dimensions | Asset | {x: number, y: number} |
extract_audio | Asset | void |
generate_thumbnail | Asset | string (path) |
copy_file | Asset | void |
rename_file | Asset | void |
delete_file | Asset | void |
save_export_frame | Export | void |
assemble_exported_video | Export | void |
cancel_export | Export | void |
list_fonts | Font | string[] |
fetch_cloud_fonts | Font | {fonts: [...]} |
download_font_file | Font | void |
download_youtube_video | Download | void |
read_settings_file | Settings | string (JSON) |