feat: enhance CLI output with colorful and informative messages

This commit is contained in:
Yar Kravtsov
2025-05-24 10:13:00 +03:00
parent 1e2728fe33
commit 61a9cc8c88
10 changed files with 111 additions and 49 deletions

View File

@@ -8,9 +8,10 @@ import (
)
var initCmd = &cobra.Command{
Use: "init",
Short: "Initialize a new lnk repository",
Long: "Creates the lnk directory and initializes a Git repository for managing dotfiles.",
Use: "init",
Short: "🎯 Initialize a new lnk repository",
Long: "Creates the lnk directory and initializes a Git repository for managing dotfiles.",
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
remote, _ := cmd.Flags().GetString("remote")
@@ -20,9 +21,18 @@ var initCmd = &cobra.Command{
}
if remote != "" {
fmt.Printf("Initialized lnk repository by cloning: %s\n", remote)
fmt.Printf("🎯 \033[1mInitialized lnk repository\033[0m\n")
fmt.Printf(" 📦 Cloned from: \033[36m%s\033[0m\n", remote)
fmt.Printf(" 📁 Location: \033[90m~/.config/lnk\033[0m\n")
fmt.Printf("\n💡 \033[33mNext steps:\033[0m\n")
fmt.Printf(" • Run \033[1mlnk pull\033[0m to restore symlinks\n")
fmt.Printf(" • Use \033[1mlnk add <file>\033[0m to manage new files\n")
} else {
fmt.Println("Initialized lnk repository")
fmt.Printf("🎯 \033[1mInitialized empty lnk repository\033[0m\n")
fmt.Printf(" 📁 Location: \033[90m~/.config/lnk\033[0m\n")
fmt.Printf("\n💡 \033[33mNext steps:\033[0m\n")
fmt.Printf(" • Run \033[1mlnk add <file>\033[0m to start managing dotfiles\n")
fmt.Printf(" • Add a remote with: \033[1mgit remote add origin <url>\033[0m\n")
}
return nil