cmd

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:          "urlscan",
	Short:        "A CLI tool for interacting with urlscan.io",
	SilenceUsage: true,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

		if err := viper.BindPFlags(cmd.PersistentFlags()); err != nil {
			return err
		}
		if err := viper.BindPFlags(cmd.Flags()); err != nil {
			return err
		}
		host := viper.GetString("host")
		if host != "" {
			api.SetHost(host)
		}
		proxy := viper.GetString("proxy")
		if proxy != "" {
			err := setProxyEnv(proxy)
			if err != nil {
				return fmt.Errorf("failed to set proxy: %w", err)
			}
		}

		key, err := utils.GetKey()
		if err != nil || key == "" {
			return fmt.Errorf("API key not found, please set the URLSCAN_API_KEY environment variable or set it in keyring by `urlscan key set`")
		}

		return nil
	},
}

Functions

func Execute

func Execute()

Types

type PasswordReader

type PasswordReader struct {
	// contains filtered or unexported fields
}

func NewPasswordReader

func NewPasswordReader(stdout io.Writer, stdin io.Reader) *PasswordReader

func (*PasswordReader) ReadPassword

func (p *PasswordReader) ReadPassword(args []string) ([]byte, error)

Directories

Path Synopsis
pro

Jump to

Keyboard shortcuts

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