Documentation
¶
Index ¶
- func Clone(url, dir string) error
- func ConvertSSHToHTTPS(sshURL string) string
- func GetCurrentCommit(dir string) (string, error)
- func Init(dir string) error
- func IsGitRepo(dir string) bool
- func Pull(dir string) error
- func SuggestedCommitMessage(changedFiles []string) string
- func SuggestedCommitMessageFromStatus(status string) string
- type RemoteUpdateStatus
- type Repository
- func (r *Repository) CheckRemoteUpdates() (*RemoteUpdateStatus, error)
- func (r *Repository) CheckoutBranch(branchName string) error
- func (r *Repository) Clone(url string) error
- func (r *Repository) Commit(message string) error
- func (r *Repository) CreateBranch(branchName string) error
- func (r *Repository) GetLatestCommit() (string, error)
- func (r *Repository) GetPath() string
- func (r *Repository) GetRemote() ([]string, error)
- func (r *Repository) GetStatus() (string, error)
- func (r *Repository) IsInitialized() bool
- func (r *Repository) ListBranches() ([]string, error)
- func (r *Repository) MergeBranch(sourceBranch string) error
- func (r *Repository) Pull() error
- func (r *Repository) Push() error
- func (r *Repository) SetRemote(url string) error
- type SkillRepository
- func (sr *SkillRepository) CheckUpdates() (*RemoteUpdateStatus, error)
- func (sr *SkillRepository) CloneRemote(url string) error
- func (sr *SkillRepository) CreateSkill(skill *spec.Skill, promptContent string) error
- func (sr *SkillRepository) GetStatus() (string, error)
- func (sr *SkillRepository) ImportSkill(skillID string) error
- func (sr *SkillRepository) ListLocalSkills() ([]*spec.Skill, error)
- func (sr *SkillRepository) ListSkillsFromRemote() ([]*spec.Skill, error)
- func (sr *SkillRepository) PushChanges(message string) error
- func (sr *SkillRepository) Sync() error
- func (sr *SkillRepository) SyncWithOptions(opts SyncOptions) error
- func (sr *SkillRepository) UpdateRegistry() error
- type SyncOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertSSHToHTTPS ¶
ConvertSSHToHTTPS 将SSH URL转换为HTTPS URL
func SuggestedCommitMessage ¶ added in v0.8.3
func SuggestedCommitMessageFromStatus ¶ added in v0.8.3
Types ¶
type RemoteUpdateStatus ¶ added in v0.6.0
type RemoteUpdateStatus struct {
Status string `json:"status"`
Message string `json:"message,omitempty"`
RemoteURL string `json:"remote_url,omitempty"`
LocalCommit string `json:"local_commit,omitempty"`
RemoteCommit string `json:"remote_commit,omitempty"`
HasUpdates bool `json:"has_updates"`
Ahead int `json:"ahead"`
Behind int `json:"behind"`
}
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository 表示一个Git仓库
func NewRepository ¶
func NewRepository(repoPath string) (*Repository, error)
NewRepository 创建或打开一个Git仓库
func NewSkillsRepository ¶
func NewSkillsRepository() (*Repository, error)
NewSkillsRepository 创建技能仓库实例
func (*Repository) CheckRemoteUpdates ¶ added in v0.6.0
func (r *Repository) CheckRemoteUpdates() (*RemoteUpdateStatus, error)
func (*Repository) CheckoutBranch ¶
func (r *Repository) CheckoutBranch(branchName string) error
CheckoutBranch 切换到指定分支
func (*Repository) CreateBranch ¶
func (r *Repository) CreateBranch(branchName string) error
CreateBranch 创建新分支
func (*Repository) GetLatestCommit ¶
func (r *Repository) GetLatestCommit() (string, error)
GetLatestCommit 获取最新提交信息
func (*Repository) GetRemote ¶
func (r *Repository) GetRemote() ([]string, error)
func (*Repository) IsInitialized ¶
func (r *Repository) IsInitialized() bool
IsInitialized 检查仓库是否已初始化
func (*Repository) ListBranches ¶
func (r *Repository) ListBranches() ([]string, error)
ListBranches 列出所有分支
func (*Repository) MergeBranch ¶
func (r *Repository) MergeBranch(sourceBranch string) error
MergeBranch 合并分支
type SkillRepository ¶
type SkillRepository struct {
// contains filtered or unexported fields
}
SkillRepository 管理技能Git仓库
func NewSkillRepository ¶
func NewSkillRepository() (*SkillRepository, error)
NewSkillRepository 创建技能仓库管理器
func (*SkillRepository) CheckUpdates ¶ added in v0.6.0
func (sr *SkillRepository) CheckUpdates() (*RemoteUpdateStatus, error)
func (*SkillRepository) CloneRemote ¶
func (sr *SkillRepository) CloneRemote(url string) error
CloneRemote 克隆远程技能仓库
func (*SkillRepository) CreateSkill ¶
func (sr *SkillRepository) CreateSkill(skill *spec.Skill, promptContent string) error
CreateSkill 创建新技能并推送到远程
func (*SkillRepository) GetStatus ¶
func (sr *SkillRepository) GetStatus() (string, error)
GetStatus 获取技能仓库状态
func (*SkillRepository) ImportSkill ¶
func (sr *SkillRepository) ImportSkill(skillID string) error
ImportSkill 从远程仓库导入单个技能
func (*SkillRepository) ListLocalSkills ¶ added in v0.4.0
func (sr *SkillRepository) ListLocalSkills() ([]*spec.Skill, error)
ListLocalSkills 从本地仓库列出技能
func (*SkillRepository) ListSkillsFromRemote ¶
func (sr *SkillRepository) ListSkillsFromRemote() ([]*spec.Skill, error)
ListSkillsFromRemote 从远程仓库列出技能
func (*SkillRepository) PushChanges ¶
func (sr *SkillRepository) PushChanges(message string) error
PushChanges 推送本地更改到远程仓库
func (*SkillRepository) SyncWithOptions ¶ added in v0.8.3
func (sr *SkillRepository) SyncWithOptions(opts SyncOptions) error
SyncWithOptions 同步技能仓库(拉取最新更改)
func (*SkillRepository) UpdateRegistry ¶
func (sr *SkillRepository) UpdateRegistry() error
UpdateRegistry 更新技能注册表
type SyncOptions ¶ added in v0.8.3
type SyncOptions struct {
Force bool
}
Click to show internal directories.
Click to hide internal directories.