feat: replace setup with init wizard + interactive config menu
- `unarr init` (alias: `unarr setup`): streamlined 3-step wizard (API key, download dir, daemon install). Removed method/name prompts — auto-configured from defaults. - `unarr config [category]`: interactive menu with 7 categories (downloads, organization, notifications, device, region, connection, advanced). Direct access via `unarr config downloads`, etc. - Extract shared helpers (openBrowser, expandHome, isTerminal) to helpers.go. Delete old setup.go and config.go. - Update all "unarr setup" references to "unarr init" across daemon, doctor, status, README, install scripts.
This commit is contained in:
parent
35e5298f23
commit
0b6c6849b1
13 changed files with 541 additions and 248 deletions
|
|
@ -84,7 +84,7 @@ func runDoctor() error {
|
|||
path = cfgFile
|
||||
}
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
return path + " (not found, run unarr setup)", fmt.Errorf("missing")
|
||||
return path + " (not found, run unarr init)", fmt.Errorf("missing")
|
||||
}
|
||||
return path, nil
|
||||
})
|
||||
|
|
@ -95,7 +95,7 @@ func runDoctor() error {
|
|||
key = cfg.Auth.APIKey
|
||||
}
|
||||
if key == "" {
|
||||
return "run unarr setup to configure", fmt.Errorf("missing")
|
||||
return "run unarr init to configure", fmt.Errorf("missing")
|
||||
}
|
||||
if len(key) > 8 {
|
||||
return key[:8] + "...", nil
|
||||
|
|
@ -130,7 +130,7 @@ func runDoctor() error {
|
|||
return "no API key", fmt.Errorf("skipped")
|
||||
}
|
||||
if cfg.Agent.ID == "" {
|
||||
return "no agent ID, run unarr setup", fmt.Errorf("not registered")
|
||||
return "no agent ID, run unarr init", fmt.Errorf("not registered")
|
||||
}
|
||||
|
||||
ac := agent.NewClient(cfg.Auth.APIURL, key, "unarr/"+Version)
|
||||
|
|
@ -155,7 +155,7 @@ func runDoctor() error {
|
|||
check("Download directory", func() (string, error) {
|
||||
dir := cfg.Download.Dir
|
||||
if dir == "" {
|
||||
return "not configured, run unarr setup", fmt.Errorf("missing")
|
||||
return "not configured, run unarr init", fmt.Errorf("missing")
|
||||
}
|
||||
fi, err := os.Stat(dir)
|
||||
if os.IsNotExist(err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue