diff --git a/cmd/plugin.go b/cmd/plugin.go index 32a84ca02..b4fea1087 100644 --- a/cmd/plugin.go +++ b/cmd/plugin.go @@ -161,9 +161,9 @@ func runPluginInstallCmd(cmd *cobra.Command, args []string) { // args to 'plugin install' -- one or more plugins to install // These can be simple names ('aws') for "standard" plugins, or // full refs to the OCI image (us-docker.pkg.dev/steampipe/plugin/turbot/aws:1.0.0) - for _, arg := range args { - if _, err := pluginmanager.Install(arg); err != nil { - msg := fmt.Sprintf("plugin install failed for plugin '%s'", arg) + for _, plugin := range args { + if image, err := pluginmanager.Install(plugin); err != nil { + msg := fmt.Sprintf("plugin install failed for plugin '%s'", plugin) if strings.HasSuffix(err.Error(), "not found") { msg += ": not found" } else { @@ -172,9 +172,14 @@ func runPluginInstallCmd(cmd *cobra.Command, args []string) { utils.ShowError(fmt.Errorf(msg)) return } else { - fmt.Println("Installed plugin:", arg) + fmt.Println("Installed plugin:", plugin) + org := image.Config.Plugin.Organization + if org == "turbot" { + fmt.Println(fmt.Sprintf("For documentation see https://hub.steampipe.io/plugins/%s/%s\n", org, plugin)) + } } } + } func runPluginListCmd(cmd *cobra.Command, args []string) { diff --git a/db/interactive_client.go b/db/interactive_client.go index 610e3eb87..ad2ce7d09 100644 --- a/db/interactive_client.go +++ b/db/interactive_client.go @@ -64,8 +64,8 @@ func (c *InteractiveClient) InteractiveQuery(resultsStreamer *ResultStreamer, on resultsStreamer.close() }() - fmt.Printf("Welcome to Steampipe v%s. For help, type '.help'\n", version.String()) - fmt.Println("Type \".inspect\" for more information.") + fmt.Printf("Welcome to Steampipe v%s\n", version.String()) + fmt.Printf("For more information, type %s\n", constants.Bold(".help")) for { rerun := c.runInteractivePrompt(resultsStreamer) diff --git a/ociinstaller/plugin.go b/ociinstaller/plugin.go index 8ec09ed78..09fde170a 100644 --- a/ociinstaller/plugin.go +++ b/ociinstaller/plugin.go @@ -13,7 +13,7 @@ import ( ) // InstallPlugin :: Install a plugin from an OCI Image -func InstallPlugin(imageRef string) (string, error) { +func InstallPlugin(imageRef string) (*SteampipeImage, error) { tempDir := NewTempDir(imageRef) defer tempDir.Delete() @@ -22,23 +22,23 @@ func InstallPlugin(imageRef string) (string, error) { image, err := imageDownloader.Download(ref.ActualImageRef(), "plugin", tempDir.Path) if err != nil { - return "", err + return nil, err } if err = installPluginBinary(image, tempDir.Path); err != nil { - return "", fmt.Errorf("plugin installation failed: %s", err) + return nil, fmt.Errorf("plugin installation failed: %s", err) } if err = installPluginDocs(image, tempDir.Path); err != nil { - return "", fmt.Errorf("plugin installation failed: %s", err) + return nil, fmt.Errorf("plugin installation failed: %s", err) } if err = installPluginConfigFiles(image, tempDir.Path); err != nil { - return "", fmt.Errorf("plugin installation failed: %s", err) + return nil, fmt.Errorf("plugin installation failed: %s", err) } if err := updateVersionFilePlugin(image); err != nil { - return string(image.OCIDescriptor.Digest), err + return nil, err } - return string(image.OCIDescriptor.Digest), nil + return image, nil } func updateVersionFilePlugin(image *SteampipeImage) error { diff --git a/pluginmanager/pluginmanager.go b/pluginmanager/pluginmanager.go index e344bd6ea..f7e6bb1f2 100644 --- a/pluginmanager/pluginmanager.go +++ b/pluginmanager/pluginmanager.go @@ -56,11 +56,12 @@ func Remove(image string, pluginConnections map[string][]string) error { } // Install :: install plugin in the local file system -func Install(image string) (string, error) { - spinner := utils.ShowSpinner(fmt.Sprintf("Installing plugin %s...", image)) +func Install(plugin string) (*ociinstaller.SteampipeImage, error) { + + spinner := utils.ShowSpinner(fmt.Sprintf("Installing plugin %s...", plugin)) defer utils.StopSpinner(spinner) - digest, err := ociinstaller.InstallPlugin(image) - return digest, err + image, err := ociinstaller.InstallPlugin(plugin) + return image, err } // PluginListItem :: an item in the list of plugins