autolaunch
Install the required plugin:
tynd add autolaunchimport { autolaunch } from "@tynd/plugin-autolaunch/client";Start at system boot.
enable(opts?): Promise<boolean>
Section titled “enable(opts?): Promise<boolean>”interface AutolaunchOptions { name?: string; // entry name (registry value / .plist / .desktop); default: the executable's file stem args?: string[]; // extra CLI args appended when the OS relaunches}
const enabled = await autolaunch.enable({ args: ["--minimized"] });// enabled is the new state (true on success)disable(opts?): Promise<boolean>
Section titled “disable(opts?): Promise<boolean>”const enabled = await autolaunch.disable();// enabled is the new state (false on success)opts takes the same shape as enable. Pass the same name you enabled with; the default matches when you passed none.
isEnabled(opts?): Promise<boolean>
Section titled “isEnabled(opts?): Promise<boolean>”const on = await autolaunch.isEnabled();Platform-specific storage
Section titled “Platform-specific storage”- Windows —
HKCU\Software\Microsoft\Windows\CurrentVersion\Runregistry entry. - macOS —
~/Library/LaunchAgents/<name>.plist(a Launch Agent). - Linux —
~/.config/autostart/<name>.desktop.
All user-scoped — no admin / UAC prompt.
Path registered
Section titled “Path registered”The registered command is whatever std::env::current_exe() resolves to at the time of enable(). Typically:
- Installed app → path to the installed binary.
- Development session → the dev-profile host executable
.tynd/build/bin/debug/<app>.
Re-register after an upgrade if the binary path changes.
- No per-user vs per-machine toggle. All three OSes use the user-scoped autostart store.
enable()is idempotent — calling twice doesn’t duplicate the entry.- Linux autostart obeys the XDG spec — the
.desktopfile needs correctExec=/Name=/Type=Application.autolaunchwrites these for you.
Example — toggle via settings
Section titled “Example — toggle via settings”import { autolaunch } from "@tynd/plugin-autolaunch/client";
async function setAutolaunch(enabled: boolean) { if (enabled) await autolaunch.enable({ args: ["--minimized"] }); else await autolaunch.disable();}
const current = await autolaunch.isEnabled();Related
Section titled “Related”- singleInstance — argv forwarding.