installer

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 13 Imported by: 0

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.

Package installer provides installation and management for git-courer.

Index

Constants

View Source
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"
)

Variables

This section is empty.

Functions

func CheckForUpdates

func CheckForUpdates() (bool, string, error)

CheckForUpdates checks if a new version is available.

func ConfigureAllMCP

func ConfigureAllMCP(binPath string) (int, error)

ConfigureAllMCP configures git-courer for all detected MCP clients.

func ConfigureMCP

func ConfigureMCP(client *MCPClient, binPath string) error

ConfigureMCP configures git-courer for the given MCP client.

func DownloadUpdate

func DownloadUpdate() error

DownloadUpdate downloads and installs the latest version.

func FetchVersion

func FetchVersion() (string, error)

FetchVersion fetches the current version from the binary.

func FindBinaryPath

func FindBinaryPath() (string, error)

FindBinaryPath tries to find the git-courer binary path.

func GetInstallPath

func GetInstallPath() string

GetInstallPath returns the default install path for the platform.

func RemoveHooks

func RemoveHooks(projectDir string) error

RemoveHooks removes git hooks created by git-courer.

func RemoveProject

func RemoveProject(projectDir string) error

RemoveProject removes git-courer from a project directory.

func RunInstall

func RunInstall() error

RunInstall performs the installation.

func RunRemove

func RunRemove(projectDir string) error

RunRemove removes git-courer from a project.

func RunSetup

func RunSetup(projectDir string) error

RunSetup runs project setup.

func RunUninstall

func RunUninstall() error

RunUninstall performs global uninstall.

func RunUpdate

func RunUpdate(force bool) error

RunUpdate checks for and applies updates.

func SetupClient

func SetupClient(clientName, binPath string) error

SetupClient sets up git-courer for a specific client.

func SetupHooks

func SetupHooks(projectDir string) error

SetupHooks creates git hooks for the project.

func SetupProject

func SetupProject(projectDir string) error

SetupProject sets up git-courer in a project directory.

Types

type Asset

type Asset struct {
	Name       string `json:"name"`
	BrowserURL string `json:"browser_download_url"`
}

Asset represents a release asset.

func (*Asset) DownloadAsset

func (a *Asset) DownloadAsset(to string) error

DownloadAsset downloads the asset to the given path.

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.

func MCPClients

func MCPClients() []*MCPClient

MCPClients returns all supported MCP clients.

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 OS

type OS string

OS represents a supported operating system.

const (
	OSLinux   OS = "linux"
	OSMacOS   OS = "darwin"
	OSWindows OS = "windows"
)

type Platform

type Platform struct {
	OS      OS
	Arch    string
	Version string
}

Platform represents the current platform.

func Detect

func Detect() *Platform

Detect returns the current platform.

func (*Platform) BinaryName

func (p *Platform) BinaryName() string

BinaryName returns the binary name for this platform.

func (*Platform) GitHubAsset

func (p *Platform) GitHubAsset() string

GitHubAsset returns the partial GitHub asset name (without version). Assets are named like: git-courer_1.0.1_darwin_amd64.tar.gz

func (*Platform) String

func (p *Platform) String() string

String returns a string representation of the platform.

type Release

type Release struct {
	TagName string  `json:"tag_name"`
	Assets  []Asset `json:"assets"`
}

Release represents a GitHub release.

func FetchLatestRelease

func FetchLatestRelease(owner, repo string) (*Release, error)

FetchLatestRelease fetches the latest release from GitHub.

func (*Release) FindAsset

func (r *Release) FindAsset(platform *Platform) *Asset

FindAsset finds the asset matching the platform. Assets are named like: git-courer_1.0.1_darwin_amd64.tar.gz

type RuleFile

type RuleFile struct {
	Name    string
	Path    string
	Content string
}

RuleFile represents an agent's instruction/rules file.

func GetRuleFiles

func GetRuleFiles(binPath string) ([]RuleFile, error)

GetRuleFiles returns the rule files to create for all agents.

Jump to

Keyboard shortcuts

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