powerful but friendly backup program that runs in your tray, powered by restic devins.page/restray
go restic system-tray
2

Configure Feed

Select the types of activity you want to include in your feed.

feat(cli): configure commands

intergrav (Jun 29, 2026, 2:05 PM EDT) 9bfd6df5 bd928537

+57
+57
cmd/restray/cli.go
··· 26 26 op mount [-p name] Mount repository (Ctrl+C to unmount) 27 27 op pre-hook [-p name] Run pre-hook command 28 28 op post-hook [-p name] Run post-hook command 29 + configure config Create/open config file in editor 30 + configure env [-p name] Create/open env file in editor 29 31 30 32 Flags: 31 33 -c, --config dir Config directory (default: $RESTRAY_CONFIG or OS default) ··· 61 63 configDirOverride = configDir 62 64 } 63 65 return profileName, fs.Args() 66 + } 67 + 68 + func editorCmd() string { 69 + if e := os.Getenv("VISUAL"); e != "" { 70 + return e 71 + } 72 + if e := os.Getenv("EDITOR"); e != "" { 73 + return e 74 + } 75 + if runtime.GOOS == "windows" { 76 + return "notepad" 77 + } 78 + return "vi" 79 + } 80 + 81 + func cliEdit(path string) int { 82 + cmd := exec.Command(editorCmd(), path) 83 + cmd.Stdin = os.Stdin 84 + cmd.Stdout = os.Stdout 85 + cmd.Stderr = os.Stderr 86 + if err := cmd.Run(); err != nil { 87 + if code := exitCode(err); code > 0 { 88 + return code 89 + } 90 + return 1 91 + } 92 + return 0 93 + } 94 + 95 + func cliConfigure(args []string) int { 96 + if len(args) == 0 { 97 + fmt.Fprintln(os.Stderr, `Usage: restray configure <config|env> [-p name]`) 98 + return 1 99 + } 100 + switch args[0] { 101 + case "config": 102 + ensureConfigFile() 103 + return cliEdit(configPath()) 104 + case "env": 105 + name, _ := cliParseFlags(args[1:]) 106 + cfg := loadConfig() 107 + _, prof, err := resolveProfile(cfg, name) 108 + if err != nil { 109 + fmt.Fprintln(os.Stderr, "error:", err) 110 + return 1 111 + } 112 + ensureEnvFile(prof.EnvFile) 113 + return cliEdit(prof.EnvFile) 114 + default: 115 + fmt.Fprintf(os.Stderr, "unknown configure target: %s\n", args[0]) 116 + return 1 117 + } 64 118 } 65 119 66 120 func cliRunRestic(prof Profile, args ...string) int { ··· 309 363 cliUsage() 310 364 return 1 311 365 } 366 + 367 + case "configure": 368 + return cliConfigure(args[1:]) 312 369 313 370 case "-h", "--help", "help": 314 371 cliUsage()