cmd

package
v0.16.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "sitectl",
	Short: "Manage Docker Compose sites across local and remote environments",
	Long: `sitectl manages Docker Compose-based sites across local and remote environments.

Run it with no arguments to open the interactive dashboard. Use subcommands to manage
contexts, run compose operations, toggle components, forward ports, and collect diagnostics.`,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		level := slog.LevelInfo
		ll, err := cmd.Flags().GetString("log-level")
		if err != nil {
			return err
		}

		switch strings.ToUpper(ll) {
		case "DEBUG":
			level = slog.LevelDebug
		case "WARN":
			level = slog.LevelWarn
		case "ERROR":
			level = slog.LevelError
		}

		opts := &slog.HandlerOptions{
			Level: level,
		}
		handler := slog.New(slog.NewTextHandler(os.Stdout, opts))
		slog.SetDefault(handler)

		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		return tui.Run()
	},
}

Functions

func Execute

func Execute()

func SetVersionInfo

func SetVersionInfo(version, commit, date string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL