Documentation
¶
Index ¶
- func CommandExists(name, baseDir string, filesystem fs.FileSystem) (bool, error)
- func GetCommandInfo(name, baseDir string, filesystem fs.FileSystem) (*models.Command, error)
- func Install(opts InstallOptions) error
- func ListCommands(baseDir string, filesystem fs.FileSystem) ([]string, error)
- func ParseRepositorySpec(spec string) (repository, version string)
- func Remove(opts RemoveOptions) error
- func VerifyCommandStructure(name, baseDir string, filesystem fs.FileSystem) (valid bool, status string, err error)
- type CommandDetail
- type GitClient
- type InstallOptions
- type ListOptions
- type RemoveOptions
- type SearchOptions
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandExists ¶
func CommandExists(name, baseDir string, filesystem fs.FileSystem) (bool, error)
CommandExists checks if a command exists.
func GetCommandInfo ¶
GetCommandInfo retrieves information about a specific command.
func Install ¶
func Install(opts InstallOptions) error
Install installs a command from a Git repository
func ListCommands ¶
func ListCommands(baseDir string, filesystem fs.FileSystem) ([]string, error)
ListCommands returns a list of all installed commands.
func ParseRepositorySpec ¶
ParseRepositorySpec parses a repository specification (URL[@version])
func Remove ¶
func Remove(opts RemoveOptions) error
Remove removes a command by name and cleans up associated files.
func VerifyCommandStructure ¶
func VerifyCommandStructure(name, baseDir string, filesystem fs.FileSystem) (valid bool, status string, err error)
VerifyCommandStructure checks if a specific command has valid dual structure.
Types ¶
type CommandDetail ¶
type CommandDetail struct {
*models.Command
HasDirectory bool
HasMarkdownFile bool
StructureValid bool
StructureMessage string
}
CommandDetail contains detailed information about a command including structure validation.
func List ¶
func List(opts ListOptions) ([]*CommandDetail, error)
List returns detailed information about all installed commands.
type GitClient ¶
type GitClient interface {
Clone(opts git.CloneOptions) error
ValidateRemoteRepository(url string) error
GetLatestTag(repoPath string) (string, error)
GetCurrentCommit(repoPath string) (string, error)
}
GitClient interface for git operations
type InstallOptions ¶
type InstallOptions struct {
Repository string // Git repository URL
Version string // Version/tag to install (optional)
Name string // Override command name (optional)
Force bool // Force reinstall if already exists
FileSystem fs.FileSystem // File system to use (defaults to OS)
}
InstallOptions represents options for installing a command
type ListOptions ¶
type ListOptions struct {
BaseDir string
FileSystem fs.FileSystem
}
ListOptions contains options for listing commands.
type RemoveOptions ¶
type RemoveOptions struct {
Name string
BaseDir string
FileSystem fs.FileSystem
}
RemoveOptions contains options for removing a command.
type SearchOptions ¶
type SearchOptions struct {
Keyword string
Tags []string
Author string
ShowAll bool
BaseDir string
FileSystem fs.FileSystem
}
SearchOptions contains options for searching commands.
type SearchResult ¶
type SearchResult struct {
Name string
Version string
Description string
Author string
Tags []string
Source string
}
SearchResult represents a command found in the search.
func Search ¶
func Search(opts SearchOptions) ([]SearchResult, error)
Search searches for commands based on the provided options.