diff --git a/changes/25004-fleetctl-packge-cli-instructions b/changes/25004-fleetctl-packge-cli-instructions new file mode 100644 index 000000000000..dc1fa6fa2bee --- /dev/null +++ b/changes/25004-fleetctl-packge-cli-instructions @@ -0,0 +1 @@ +- Display command line installation instructions when a package is generated diff --git a/cmd/fleetctl/package.go b/cmd/fleetctl/package.go index 1cf3978c72c7..281cec25e9a5 100644 --- a/cmd/fleetctl/package.go +++ b/cmd/fleetctl/package.go @@ -377,13 +377,31 @@ func packageCommand() *cli.Command { } path, _ = filepath.Abs(path) + pathBase := filepath.Base(path) + var installInstructions = "double-click the installer" + var deviceType string + switch c.String("type") { + case "pkg": + installInstructions += fmt.Sprintf(" or run the command `sudo installer -pkg \"%s\" -target /`", pathBase) + deviceType = "macOS" + case "deb": + installInstructions += fmt.Sprintf(" or run the command `sudo apt install \"%s\"`", pathBase) + deviceType = "Debian-based Linux" + case "rpm": + installInstructions += fmt.Sprintf(" or run the command `sudo dnf install \"%s\"`", pathBase) + deviceType = "RPM-based Linux" + case "msi": + installInstructions += fmt.Sprintf(" or run the command `msiexec /i \"%s\"` as administrator", pathBase) + deviceType = "Windows" + } + fmt.Printf(` Success! You generated fleetd at %s -To add this device to Fleet, double-click to install fleetd. +To add a new %s device to Fleet, %s. To add other devices to Fleet, distribute fleetd using Chef, Ansible, Jamf, or Puppet. Learn how: https://fleetdm.com/learn-more-about/enrolling-hosts -`, path) +`, path, deviceType, installInstructions) if !disableOpenFolder { open.Start(filepath.Dir(path)) //nolint:errcheck }