Skip to content

Backend commands ​

The Rust backend exposes 87 Tauri commands. The interface calls them through typed wrappers in src/lib/api.ts (api.<name>). In the browser preview, src/lib/mock-backend.ts handles the same calls.

Conventions

  • Argument names are camelCase in TypeScript. Tauri converts them to snake_case in Rust.
  • Every command returns AppResult<T>. Errors reach TypeScript as a plain string. Use errorMessage(e) from api.ts to normalise them.
  • Caller says which windows may call the command. C is the control window only. C+O is the control window and the output windows (audience, confidence, identify). See Security and permissions.

Workspace ​

CommandArgumentsReturnsCallerNotes
workspace_info{path, defaultPath, firstRun, version}Cversion comes from tauri.conf.json
workspace_openpath (absolute)COpens or creates the workspace, runs migrations, remembers the path
workspace_revealCOpens the folder in Explorer or Finder

Library, services, settings and history ​

CommandArgumentsReturnsCallerNotes
library_listkind?, query?, includeArchived? (false), withData? (false), limit? (5000, clamped to 1–20000)Resource[]CWith query: FTS5 prefix search, ranked by bm25 with title weighted 10×. Otherwise sorted by title. Without withData, data is null.
library_getidResourceC"Not found" if missing
library_get_manyidsResource[]CMissing IDs are skipped
library_saveresource, expectedRevision?ResourceCUpsert. If expectedRevision doesn't match: "was changed elsewhere (revision N); reload before saving". Bumps revision. May write the daily backup.
library_save_batchresourcesResource[]CAtomic upsert, no revision check, no backup
library_deleteids, permanent? (false)CArchives by default; permanent deletes the row
library_restoreidCUn-archives
library_countsRecord<kind, number>CNon-archived resources per kind
service_listService[] (no data)CNewest date first
service_getidServiceC
service_saveserviceServiceCUpsert, bumps revision (not checked). Name required. May write the daily backup.
service_deleteidCPermanent
settings_getkeyJSON or nullC+O
settings_setkey, valueC
history_listlimit? (200){id, at, serviceId?, command, sceneRevision, result}[]CNewest first

Assets and files ​

CommandArgumentsReturnsCallerNotes
asset_importpaths{ok, path, asset?, error?}[]COne result per file; a failure doesn't stop the rest
asset_import_bytesraw body, header x-nameAssetCFor pasted or generated files
asset_listkind?, includeArchived?Asset[]CNewest first
asset_gethashAsset or nullC+O
asset_updatehash, name?, meta?Cmeta is merged into the stored object
asset_archivehash, archivedCSoft delete. The file stays on disk.
asset_checkhashesstring[]CHashes whose record or file is missing (used by preflight)
read_text_filepathstringCUp to 50 MB. Strips a UTF-8 BOM, rejects invalid UTF-8.
read_binary_filepathbytesCUp to 50 MB
write_text_filepath, contentsC.json or .txt only, up to 20 MB. Used for the diagnostics export. No wrapper in api.ts.
write_pack_fileraw body, header x-path (percent-encoded)CWrites an exported lower-third pack. .altarlt only, up to 200 MB.

Bible ​

CommandArgumentsReturnsCallerNotes
bible_installpathBiblePackCUp to 64 MB. Replaces a pack with the same id.
bible_install_jsonjsonBiblePackCSame, from a string (used for the bundled KJV)
bible_listBiblePack[]CSorted by name
bible_removeidCRemoves the pack, its verses and its search index
bible_passagetranslation, book, chapter, start, endVerseRow[]C
bible_searchtranslation, query, limit? (100)VerseRow[]CFTS5 keyword search

BiblePack is {id, name, abbreviation, language, version, rights, structure: {books: [{id, name, verses: number[]}]}, installedAt}. VerseRow is {book, chapter, verse, text}.

Backups ​

CommandArgumentsReturnsCallerNotes
backup_createfile nameCmanual-YYYYMMDD-HHMMSS.db
backup_list{name, size, modified, kind}[]CNewest first. kind is the name before the first -.
backup_restorenameCValidates the copy, saves a pre-restore-* backup, then swaps the database

Packages and documents ​

CommandArgumentsReturnsCallerNotes
package_exportpath, manifest, service, resources, assetHashes{size, entries}CWrites a .altar file
package_inspectpathPackageInspectCValidates without importing
package_importpathPackageInspectCImports the service, resources and media
docx_extractpath, keepEmpty? (false)DocBlock[]C{kind, level, text, locator, style?}
pptx_importpathPptxImportC{sourceHash, filename, width, height, slides, fonts, warnings}

See Service package format for the package limits.

Live coordinator ​

CommandArgumentsReturnsCallerNotes
live_stateLiveStateC
live_frameFrameC+OWhat an output window should draw
live_previewtarget or nullpreview revisionCValidates. Never changes Live.
live_gocommandId, target, transition?: {slide, durationMs}, autopilot?revisionCCommits live, optionally through a timed breaker (max 60 000 ms). autopilot is the requestId of an Autopilot request the control window is carrying out: Autopilot's rules apply instead of counting as the operator acting, and the call fails with the refusal's message if they don't allow it, or "Autopilot's request has expired".
live_stepcommandId, delta{moved, revision, boundary?, reason?}CHolds at the item's first and last slide; refused during a transition
live_gotocommandId, itemId, indexrevisionCWithin the live item only. Cancels a transition.
live_mode"content", "black" or "logo"revisionCBlack and Logo cancel a transition. Logo fails if no logo is set.
live_clear_textonrevisionC
live_set_logoslide or nullCRemoving the logo while in Logo mode switches to Black
live_transition"skip" or "stop"revisionC
live_overlayaction, cue?revisionCshow, hide, update, retrigger, hideAll, reorder. Up to 3 on air.
live_hide_overlaysonrevisionC
live_mediaaction, value?Cplay, pause, stop, restart, volume (0–1), mute
live_countdownseconds or nullC
live_stage_messagemessage or nullCBlank clears
live_clearrevisionCClears live content and lower thirds
output_ackrole, session, revisionC+OAn output window confirms it drew a revision

Outputs ​

CommandArgumentsReturnsCallerNotes
monitors_listMonitorInfo[]C{key, index, name, width, height, x, y, scaleFactor, isPrimary, isControl, bounds}
output_openrole ("audience" or "confidence"), monitorKeyCReplaces any window with that role. New session ID.
output_closeroleC
output_identifyseconds? (4, clamped 1–30)CNumbered pattern on every display

A monitor key is "<name>@<x>,<y>". When reopening a display, the backend looks for the exact key, then the same name, then the same position.

Listening ​

Listen's offline speech-to-text (speech.rs, on the shared altar-speech crate). Speech models are kept per computer in the app's local data folder, under speech-models, which Autopilot on the same computer shares. Results arrive as speech:* events.

CommandArgumentsReturnsCallerNotes
speech_modelsSpeechModel[]CEvery model in the catalog and whether it's installed
speech_model_downloadidSpeechModel[]CDownloads and unpacks the model. Progress comes as speech:download.
speech_model_cancelCCancels a running download
speech_model_installpathSpeechModel[]CInstalls a model from its release archive downloaded on another computer, for computers without internet
speech_model_removeidSpeechModel[]CRefused while listening with that model
speech_devicesInputDevice[]C{id, name, isDefault}
speech_statusSpeechStatusC
speech_startmodel, device (null: the system default)SpeechStatusCReplaces a session already running. Refused while Autopilot is on: "Autopilot is listening. Turn Autopilot off to use Listen."
speech_stopC
speech_open_privacyCOpens the microphone privacy settings on macOS and Windows. Elsewhere it fails with "Check the microphone in your system's sound settings".

SpeechModel is {id, name, description, downloadMb, installed, url}, where url is the release archive, for installing on a computer without internet. SpeechStatus is {session, state, model, device, input, message}. state is "off", "loading", "listening" or "error", session goes up on every start so late events from a stopped session can be ignored, and input names the input actually in use.

Autopilot ​

Altar Studio's side of Autopilot (autopilot.rs, autopilot_net.rs). Every command that changes something returns the new AutopilotStatus and also sends it as autopilot:status.

CommandArgumentsReturnsCallerNotes
autopilot_statusAutopilotStatusC
autopilot_settypes: {word, songs}, model, deviceAutopilotStatusCEach type is "off", "suggest" or "auto". Turning the first type on stops Listen and launches Autopilot on this computer; turning the last one off ends it. model and device are Listen's choices, offered to Autopilot as its starting point.
autopilot_pausepausedAutopilotStatusCWhile paused, Autopilot keeps listening but its commands are refused
autopilot_showCBrings Autopilot's window to the front. Fails if Autopilot isn't connected yet.
autopilot_restartAutopilotStatusCStarts Autopilot again after it stopped or couldn't start. In network mode it does nothing: Autopilot reconnects by itself.
autopilot_request_donerequestId, previewed, refusal?CThe control window finished an autopilot:request without sending it Live: it put it in Preview, or couldn't do it (refusal, such as "notFound")
autopilot_planneditemId, scripturesCThe scriptures planned in the live Word item, passed on to Autopilot
autopilot_allowkind, allowedAutopilotStatusCLets a kind ("hymns", "songs" or "word") move Live in Auto without a track record, or takes that back
autopilot_track_resetkindAutopilotStatusCStarts a kind's track record again: it suggests until it earns Auto anew
autopilot_networkenabledAutopilotStatusCtrue: Autopilot runs on another computer and connects here, so Altar Studio listens on the network and stops the Autopilot it launched. false: back to this computer.
autopilot_pair_startAutopilotStatusCShows a six-digit pairing code for three minutes. Fails unless network mode is on.
autopilot_pair_cancelAutopilotStatusC
autopilot_unpairdeviceIdAutopilotStatusCForgets a paired computer, and disconnects it if it's connected

AutopilotStatus is {phase, types, paused, message, peer, listening, downloadUrl, stats, track, auto, remote, network}:

FieldDescription
phase"off", "starting", "waiting" (network mode, no Autopilot connected yet), "connected", "disconnected" (it reconnects by itself), "stopped" (the app ended unexpectedly), "notInstalled" or "error"
types, pausedAs set by autopilot_set and autopilot_pause
peerThe connected Autopilot: {host, version, local, deviceId}
listeningAutopilot's own listening: {state, model, input, message, silent, recording, …}. recording shows REC in the Autopilot pill.
statsHow Autopilot's suggestions went in this service, from the decision log
track, autoEach kind's track record, and the kinds that may move Live now (Auto mode and earned)
remote, networkNetwork mode is on, and its state: {listening, port, name, addresses, discoverable, pairing, paired, message}

Errors ​

VariantMessage prefix
Db"Database error: "
Io"File error: "
Json"Data error: "
Zip"Archive error: "
InvalidThe message as written, a complete sentence for the operator
NotFound"Not found: "
TauriTauri's message

To add a command, see Add a backend command.

Altar Studio by Milton Black. Free and open source.