service

package
v0.17.8 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIEnvKeyPatterns = []string{
	"_API_KEY",
	"_TOKEN",
	"_SECRET",
	"_ACCESS_KEY",
	"_SECRET_KEY",
}

APIEnvKeyPatterns defines the suffixes and prefixes for API keys and related credentials.

View Source
var APIEnvKeyPrefixes = []string{
	"SPROUT_PROVIDER",
	"SPROUT_SUBAGENT_PROVIDER",
	"SPROUT_SUBAGENT_MODEL",
}

APIEnvKeyPrefixes defines specific prefixes to capture.

View Source
var ForceConfirm bool

ForceConfirm skips confirmation prompts when true (set by -y flag).

View Source
var ServiceCmd = &cobra.Command{
	Use:   "service",
	Short: "Manage the sprout daemon service",
	Long: `Manage the sprout daemon as a system service.

Integration with systemd (Linux) or launchd (macOS) allows the sprout
web UI to start automatically on boot and run persistently in the background.`,
}

ServiceCmd is the root command for service management.

Functions

func CaptureAPIKeysFromEnv

func CaptureAPIKeysFromEnv() []string

captureAPIKeysFromEnv filters the current environment for API keys and related credentials. It returns a slice of "KEY=value" strings for matching environment variables.

func GenerateServiceEnvFile

func GenerateServiceEnvFile(homeDir string) error

generateServiceEnvFile captures API keys from the current environment and writes them to ~/.sprout/service.env with restricted permissions (0600).

func LoadServiceEnvFile

func LoadServiceEnvFile(homeDir string) (map[string]string, error)

loadServiceEnvFile reads ~/.sprout/service.env and returns a map of key-value pairs. If the file doesn't exist or is empty, returns an empty map.

func MatchesAPIKeyPattern

func MatchesAPIKeyPattern(key string) bool

matchesAPIKeyPattern returns true if the environment variable name appears to be an API key.

func ServiceEnvPath

func ServiceEnvPath(homeDir string) string

serviceEnvPath returns the path to the service.env file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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