cmd

package
v0.0.0-...-5840427 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package cmd contains the command-line interface (CLI) definitions and execution logic for Watchtower. It provides the root command and subcommands to orchestrate container updates, notifications, and configuration upgrades.

Key components:

  • rootCmd: Root command for updates, API, and scheduling.
  • notify-upgrade: Subcommand to convert legacy notifications to shoutrrr URLs.
  • RunConfig: Struct for configuring execution.

Usage examples:

  • Run the CLI from main.go: cmd.Execute()
  • Convert legacy notifications to shoutrrr URLs: watchtower notify-upgrade

The package integrates with actions, container, notifications, and flags packages, using Cobra for CLI parsing and logrus for logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute runs the root command and manages any errors encountered during its execution.

It serves as the primary entry point for the Watchtower CLI, called from main.go, and ensures that any fatal errors are logged and terminate the program with an appropriate exit status, providing a clean interface between the CLI and the operating system.

func NewRootCommand

func NewRootCommand() *cobra.Command

NewRootCommand creates and configures the root command for the Watchtower CLI.

It establishes the base usage string ("watchtower"), a short description summarizing its purpose, and a long description with additional context and a project URL.

It assigns the PreRun and Run functions to handle setup and execution, respectively, and allows arbitrary arguments for flexibility.

Returns:

  • *cobra.Command: A pointer to the fully configured root command, ready for flag registration and execution.

Types

This section is empty.

Jump to

Keyboard shortcuts

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