Documentation
¶
Overview ¶
Copyright (c) 2025 Guilherme Silva Sousa Licensed under the MIT License See LICENSE file in the project root for full license information.
Copyright (c) 2025 Guilherme Silva Sousa Licensed under the MIT License See LICENSE file in the project root for full license information.
Copyright (c) 2025 Guilherme Silva Sousa Licensed under the MIT License See LICENSE file in the project root for full license information.
Copyright (c) 2025 Guilherme Silva Sousa Licensed under the MIT License See LICENSE file in the project root for full license information.
Index ¶
- func ExtractRepoPath(gitURL string) string
- func GetCommandInfo(name, baseDir string, filesystem fs.FileSystem) (*project.CommandLockInfo, error)
- func Install(opts InstallOptions) error
- func InstallFromProject(projectPath string, force bool) error
- func ListCommands(baseDir string, filesystem fs.FileSystem) ([]string, error)
- func NormalizeRepositoryURL(url string) string
- 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 InstallOptions
- type InstalledCommand
- type ListOptions
- type RemoveOptions
- type SearchOptions
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractRepoPath ¶ added in v1.0.0
ExtractRepoPath extracts owner/repo from a Git URL
func GetCommandInfo ¶
func GetCommandInfo(name, baseDir string, filesystem fs.FileSystem) (*project.CommandLockInfo, error)
GetCommandInfo retrieves information about a specific command.
func Install ¶
func Install(opts InstallOptions) error
Install installs a command from a Git repository
func InstallFromProject ¶ added in v1.0.0
InstallFromProject installs all commands defined in the project's ccmd.yaml
func ListCommands ¶
func ListCommands(baseDir string, filesystem fs.FileSystem) ([]string, error)
ListCommands returns a list of all installed commands.
func NormalizeRepositoryURL ¶ added in v1.0.0
NormalizeRepositoryURL normalizes various repository formats to a full URL
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 {
*project.CommandLockInfo
HasDirectory bool
HasMarkdownFile bool
StructureValid bool
StructureMessage string
// Metadata from command's ccmd.yaml file
CommandMetadata *models.CommandMetadata
}
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 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
}
InstallOptions represents options for installing a command
type InstalledCommand ¶ added in v1.0.0
type InstalledCommand struct {
Name string
Version string
Description string
Author string
Repository string
Path string
}
InstalledCommand represents an installed command
func GetInstalledCommands ¶ added in v1.0.0
func GetInstalledCommands(projectPath string) ([]InstalledCommand, error)
GetInstalledCommands returns a list of installed commands
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.