The autostart module makes the app launch at login, translated
from tauri-plugin-autostart (simplified). The API is tiny:
enableAutostart / disableAutostart / isAutostartEnabled plus the
autostart namespace (enable/disable/isEnabled). Per-platform
implementation:
~/Library/LaunchAgents/<id>.plist
(RunAtLoad);~/.config/autostart/<id>.desktop;HKCU\...\CurrentVersion\Run via reg.exe.The plugin is constructed with autostartPlugin(options):
| Option | Default | Meaning |
|---|---|---|
id |
"ztron" |
name of the launch file / registry key (prefer a reverse-domain identifier) |
exec |
current executable (tjs.exePath) |
the command to launch at login; for packaged apps set the .app/binary path explicitly |
Three permissions autostart:allow-enable /
autostart:allow-disable / autostart:allow-is-enabled, aggregated
into the autostart:default set; the hello example declares
autostart:default. No scope concept (it writes to the fixed
platform autostart locations).
Backend registration. From examples/hello/src/main.ts (comment
kept):
The frontend's full round trip: query → enable → re-check → disable.
From examples/hello/frontend/src/main.ts (the anchor AUTOSTART_OK
is its real run output; comments kept, excerpt elided):
plugin:autostart|* totals 3 commands:
| Command | API |
|---|---|
enable |
enableAutostart (autostart.enable) |
disable |
disableAutostart (autostart.disable) |
is_enabled |
isAutostartEnabled (autostart.isEnabled) |
Full list in the Commands Reference and the API symbol reference.
Applicable version: ztron 0.3.1