cmd

package
v1.0.0-rc.22 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: MIT Imports: 38 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, command Command) *cobra.Command

func NewDetailCmd

func NewDetailCmd() *cobra.Command

func NewEvalCmd

func NewEvalCmd() *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 RefreshCommands

func RefreshCommands() (map[string]Command, error)

func Run added in v0.9.23

func Run(generator internal.PageGenerator) error

Types

type Author

type Author struct {
	ID       string `json:"id"`
	Username string `json:"username"`
}

type Command

type Command struct {
	Metadata
	Manifest
}

type CommandRemote

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

func GetRemote

func GetRemote(origin string) (CommandRemote, error)

type ExitCodeError

type ExitCodeError struct {
	ExitCode int
}

func (ExitCodeError) Error

func (e ExitCodeError) Error() string

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"`
	Root    string `json:"root"`
}

func LoadManifest

func LoadManifest(dir string) (Manifest, error)

func (Manifest) Save

func (m Manifest) Save(dir string) error

type Metadata

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

func ExtractMetadata

func ExtractMetadata(script []byte) (Metadata, error)

func ParseCommand

func ParseCommand(commandDir string) (Metadata, error)

func (Metadata) Rows

func (m Metadata) Rows() []string

type Output

type Output struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

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)

type Val

type Val struct {
	Author     Author `json:"author"`
	Code       string `json:"code"`
	Error      string `json:"error"`
	ID         string `json:"id"`
	Logs       []int  `json:"logs"`
	Name       string `json:"name"`
	Output     Output `json:"output"`
	Public     bool   `json:"public"`
	RunEndAt   string `json:"runEndAt"`
	RunStartAt string `json:"runStartAt"`
	Version    int    `json:"version"`
}

type ValTownRemote

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

func NewValTownRemote

func NewValTownRemote(origin *url.URL) (*ValTownRemote, error)

func (ValTownRemote) Download

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

func (ValTownRemote) FetchVal

func (r ValTownRemote) FetchVal() (Val, error)

func (ValTownRemote) GetLatestVersion

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

func (ValTownRemote) Val

func (t ValTownRemote) Val() string

Jump to

Keyboard shortcuts

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