Files
go-alived/internal/cmd/root.go
loveuer 4e66d187a7 feat: add install command for easy deployment
- Add `install` subcommand with alias `i`
- Support two installation methods: systemd (default) and service
- Copy binary to /usr/local/bin/go-alived
- Auto-detect network interface and hostname for config generation
- Create /etc/go-alived directory and config.yaml
- Install systemd service file with proper capabilities
- Display clear completion message with next steps
- Bump version to 1.2.0

🤖 Generated with [Qoder][https://qoder.com]
2026-03-04 00:54:08 -08:00

25 lines
489 B
Go

package cmd
import (
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "go-alived",
Short: "Go-Alived - VRRP High Availability Service",
Long: `go-alived is a lightweight, dependency-free VRRP implementation in Go.
It provides high availability for IP addresses with health checking support.`,
Version: "1.2.0",
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
}
func init() {
rootCmd.CompletionOptions.DisableDefaultCmd = true
}