autostart

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package autostart generates and manages Windows Task Scheduler definitions for starting the Forge daemon automatically at user logon.

Usage:

forge autostart install  -- creates and registers the scheduled task
forge autostart remove   -- removes the scheduled task
forge autostart status   -- checks current registration

Index

Constants

View Source
const (
	// TaskName is the Windows Task Scheduler task name.
	TaskName = "ForgeAutoStart"

	// TaskXMLFile is the filename for the exported XML definition.
	TaskXMLFile = "forge-autostart.xml"
)

Variables

This section is empty.

Functions

func GenerateXML

func GenerateXML() (string, error)

GenerateXML writes the task XML to ~/.forge/ without registering it.

func Install

func Install() error

Install creates and registers the scheduled task. On non-Windows platforms, it returns an error with instructions.

func Remove

func Remove() error

Remove deregisters the scheduled task.

func Status

func Status() (registered bool, nextRun string, err error)

Status checks whether the scheduled task is registered.

Types

type TaskConfig

type TaskConfig struct {
	Username   string
	ForgePath  string
	WorkingDir string
}

TaskConfig holds the template parameters for the scheduled task.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL