Documentation
¶
Overview ¶
Package installer provides installation and management for git-courer.
Package installer provides installation and management for git-courer.
Package installer provides installation and management for git-courer.
Package installer provides installation and management for git-courer.
Package installer provides installation and management for git-courer.
Index ¶
- Constants
- func CheckForUpdates() (bool, string, error)
- func ConfigureAllMCP(binPath string) (int, error)
- func ConfigureMCP(client *MCPClient, binPath string) error
- func DownloadUpdate() error
- func FetchVersion() (string, error)
- func FindBinaryPath() (string, error)
- func RemoveProject(projectDir string) error
- func RunPostInstall() error
- func RunRemove(projectDir string) error
- func RunSetup(projectDir string) error
- func RunUninstall() error
- func RunUpdate(force bool) error
- func SetupClient(clientName, binPath string) error
- func SetupHooks(projectDir string) error
- func SetupProject(projectDir string) error
- func WriteRuleFiles(binPath string) (int, error)
- type MCPClient
- type MCPServerConfig
- type OS
- type Platform
- type Release
- type ReleaseAsset
- type RuleFile
- type UpdaterFactory
Constants ¶
const ( // BinaryName is the name of the binary. BinaryName = "git-courer" // Owner is the GitHub owner. Owner = "Alejandro-M-P" // Repo is the GitHub repository. Repo = "git-courer" )
const (
// PostInstallEnv is the env var that triggers post-install setup.
PostInstallEnv = "GIT_COURER_POSTINSTALL"
)
Variables ¶
This section is empty.
Functions ¶
func CheckForUpdates ¶
CheckForUpdates checks if a new version is available using go-selfupdate. Uses GitHub source with platform-specific filter regex to match assets like git-courer_{version}_{OS}_{Arch}.tar.gz
func ConfigureAllMCP ¶
ConfigureAllMCP configures git-courer for all detected MCP clients.
func ConfigureMCP ¶
ConfigureMCP configures git-courer for the given MCP client.
func DownloadUpdate ¶
func DownloadUpdate() error
DownloadUpdate downloads and installs the latest version using go-selfupdate. Relies on go-selfupdate's UpdateTo() which handles download, extraction, and binary replacement atomically. Post-update steps (MCP reconfiguration and rule file updates) only execute after successful binary replacement.
func FetchVersion ¶
FetchVersion fetches the current version from the binary.
func FindBinaryPath ¶
FindBinaryPath tries to find the git-courer binary path.
func RemoveProject ¶
RemoveProject removes git-courer from a project directory.
func RunPostInstall ¶ added in v1.4.2
func RunPostInstall() error
RunPostInstall runs setup after go install. Called when GIT_COURER_POSTINSTALL=1 is set.
func SetupClient ¶
SetupClient sets up git-courer for a specific client.
func SetupHooks ¶
SetupHooks creates git hooks in the project's .git/hooks directory.
func SetupProject ¶
SetupProject sets up git-courer in a project directory.
func WriteRuleFiles ¶ added in v1.4.2
WriteRuleFiles writes agent rule files to the filesystem. It creates CLAUDE.md, .cursorrules, opencode skill, etc. If a file exists, it merges: keeps user customizations + adds new default content.
Types ¶
type MCPClient ¶
type MCPClient struct {
Name string
Filename string // config filename
RootKey string // mcpServers, mcp, servers, context_servers
IsArray bool // continue uses array format
ConfigFn func(binPath string) map[string]interface{}
Paths []string // possible config file paths for this platform
Detect func() bool
}
MCPClient represents an MCP client configuration.
func DetectClients ¶
func DetectClients() []*MCPClient
DetectClients returns a list of detected MCP clients on the system.
type MCPServerConfig ¶
type MCPServerConfig struct {
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Type string `json:"type,omitempty"`
}
MCPServerConfig represents an MCP server entry.
type Platform ¶
Platform represents the current platform.
func (*Platform) BinaryName ¶
BinaryName returns the binary name for this platform.
func (*Platform) GitHubAsset ¶
GitHubAsset returns the partial GitHub asset name (without version). Assets are named like: git-courer_1.0.1_darwin_arm64.tar.gz
type Release ¶
type Release struct {
TagName string
Assets []ReleaseAsset
}
Release represents a GitHub release.
func FetchLatestRelease ¶
FetchLatestRelease fetches the latest release from GitHub (stub implementation).
func (*Release) FindAsset ¶
func (r *Release) FindAsset(platform *Platform) *ReleaseAsset
FindAsset finds an asset matching the platform.
type ReleaseAsset ¶ added in v1.4.2
ReleaseAsset represents a GitHub release asset.
func (*ReleaseAsset) DownloadAsset ¶ added in v1.4.2
func (a *ReleaseAsset) DownloadAsset(dest string) error
DownloadAsset downloads the asset to a local path.
type RuleFile ¶
RuleFile represents an agent's instruction/rules file.
func GetRuleFiles ¶
GetRuleFiles returns the rule files to create for all agents.
type UpdaterFactory ¶ added in v1.4.2
type UpdaterFactory func() (*selfupdate.Updater, error)
UpdaterFactory defines a factory for creating selfupdate.Updater instances. Used for dependency injection in tests.