CLI + live dashboard wrapping aws/docker/git/awsmfa for local dev: AWS MFA auth status + expiry, dev compose stack control, container drift vs the dev repo, git repo status, prod-data and DB-access tools. Config-driven (~/.config/mydev/config.yaml). Dashboard runs commands via a command palette with captured/interactive modes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
47 lines
838 B
Go
47 lines
838 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"mydev/internal/config"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var configCmd = &cobra.Command{
|
|
Use: "config",
|
|
Short: "Manage the config file",
|
|
}
|
|
|
|
var configPathCmd = &cobra.Command{
|
|
Use: "path",
|
|
Short: "Print the config file path",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
p, err := config.Path()
|
|
if err != nil {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
os.Exit(1)
|
|
}
|
|
fmt.Println(p)
|
|
},
|
|
}
|
|
|
|
var configInitCmd = &cobra.Command{
|
|
Use: "init",
|
|
Short: "Write a starter config file",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
p, err := config.Init()
|
|
if err != nil {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
os.Exit(1)
|
|
}
|
|
fmt.Printf("wrote %s — edit repos_roots to your paths\n", p)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
configCmd.AddCommand(configPathCmd, configInitCmd)
|
|
rootCmd.AddCommand(configCmd)
|
|
}
|