Skip to content

autolaunch

Install the required plugin:

Terminal window
tynd add autolaunch
import { autolaunch } from "@tynd/plugin-autolaunch/client";

Start at system boot.

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)
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.

const on = await autolaunch.isEnabled();
  • Windows — HKCU\Software\Microsoft\Windows\CurrentVersion\Run registry entry.
  • macOS — ~/Library/LaunchAgents/<name>.plist (a Launch Agent).
  • Linux — ~/.config/autostart/<name>.desktop.

All user-scoped — no admin / UAC prompt.

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 .desktop file needs correct Exec= / Name= / Type=Application. autolaunch writes these for you.
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();