cmd

package
v1.0.0-rc.21 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Date    = "unknown"
)
View Source
var MetadataRegexp = regexp.MustCompile(`@(sunbeam|raycast)\.(?P<key>[A-Za-z0-9]+)\s(?P<value>[\S ]+)`)

Functions

func NewCommandAddCmd

func NewCommandAddCmd() *cobra.Command

func NewCommandCmd

func NewCommandCmd() *cobra.Command

func NewCommandListCmd

func NewCommandListCmd() *cobra.Command

func NewCommandManageCmd

func NewCommandManageCmd() *cobra.Command

func NewCommandRemoveCmd

func NewCommandRemoveCmd() *cobra.Command

func NewCommandRenameCmd

func NewCommandRenameCmd() *cobra.Command

func NewCommandUpgradeCmd

func NewCommandUpgradeCmd() *cobra.Command

func NewCustomCmd

func NewCustomCmd(commandName string, manifest Manifest) *cobra.Command

func NewDetailCmd

func NewDetailCmd() *cobra.Command

func NewEvalCmd

func NewEvalCmd() *cobra.Command

func NewExecCmd

func NewExecCmd() *cobra.Command

func NewFetchCmd added in v0.9.23

func NewFetchCmd() *cobra.Command

func NewListCmd

func NewListCmd() *cobra.Command

func NewQueryCmd added in v0.3.0

func NewQueryCmd() *cobra.Command

func NewRootCmd added in v0.9.0

func NewRootCmd() *cobra.Command

func NewRunCmd added in v0.2.0

func NewRunCmd() *cobra.Command

func NewTriggerCmd added in v0.9.0

func NewTriggerCmd() *cobra.Command

func NewValidateCmd added in v0.4.1

func NewValidateCmd() *cobra.Command

func Run added in v0.9.23

func Run(generator internal.PageGenerator) error

Types

type Command

type Command struct {
	Title       string             `json:"title"`
	Description string             `json:"description,omitempty"`
	Entrypoint  string             `json:"entrypoint,omitempty"`
	SubCommands map[string]Command `json:"subcommands,omitempty"`
}

func ExtractScriptMetadata

func ExtractScriptMetadata(script []byte) (Command, error)

func ParseCommand

func ParseCommand(commandDir string, prefix string) (Command, error)

type CommandRemote

type CommandRemote interface {
	GetLatestVersion() (string, error)
	Download(targetDir string, version string) error
}

func GetRemote

func GetRemote(origin string) (CommandRemote, error)

type GithubRemote

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

func (GithubRemote) Download

func (r GithubRemote) Download(targetDir string, version string) error

func (GithubRemote) GetLatestVersion

func (r GithubRemote) GetLatestVersion() (string, error)

type LocalDir

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

func (LocalDir) Download

func (r LocalDir) Download(targetDir string, version string) error

func (LocalDir) GetLatestVersion

func (r LocalDir) GetLatestVersion() (string, error)

type LocalScript

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

func (LocalScript) Download

func (r LocalScript) Download(targetDir string, version string) error

func (LocalScript) GetLatestVersion

func (r LocalScript) GetLatestVersion() (string, error)

type Manifest

type Manifest struct {
	Origin  string `json:"origin"`
	Version string `json:"version"`
	Command
}

type ScriptRemote

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

func (ScriptRemote) Download

func (r ScriptRemote) Download(targetDir string, version string) error

func (ScriptRemote) GetLatestVersion

func (r ScriptRemote) GetLatestVersion() (string, error)

Jump to

Keyboard shortcuts

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