commands

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractRepoPath added in v1.0.0

func ExtractRepoPath(gitURL string) string

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

func InstallFromProject(projectPath string, force bool) error

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

func NormalizeRepositoryURL(url string) string

NormalizeRepositoryURL normalizes various repository formats to a full URL

func ParseRepositorySpec

func ParseRepositorySpec(spec string) (repository, version string)

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(opts SearchOptions) ([]SearchResult, error)

Search searches for commands based on the provided options.

Jump to

Keyboard shortcuts

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