sdk

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Directory structure constants
	VersionsDir = "versions"
	BinDir      = "bin"

	// GitHub API constants
	GitHubOwner = "grovetools"
	GitHubAPI   = "https://api.github.com"
)

Variables

This section is empty.

Functions

func GetAllTools

func GetAllTools() []string

GetAllTools returns all registered tool repository names

func GetToolRegistry

func GetToolRegistry() map[string]ToolInfo

GetToolRegistry returns the tool registry map

func GetToolToRepoMap

func GetToolToRepoMap() map[string]string

GetToolToRepoMap returns the alias to repository name mapping

func MigrateFromSingleVersion

func MigrateFromSingleVersion() error

MigrateFromSingleVersion migrates from old single version format

func SaveAliases

func SaveAliases(config *AliasConfig) error

SaveAliases saves the user's custom alias configuration

Types

type AliasConfig

type AliasConfig struct {
	Aliases map[string]string `json:"aliases"` // repoName -> custom alias
}

AliasConfig represents the structure of the aliases.json file

func LoadAliases

func LoadAliases() (*AliasConfig, error)

LoadAliases loads the user's custom alias configuration

type GitHubRelease

type GitHubRelease struct {
	TagName    string `json:"tag_name"`
	Prerelease bool   `json:"prerelease"`
	Assets     []struct {
		Name               string `json:"name"`
		BrowserDownloadURL string `json:"browser_download_url"`
	} `json:"assets"`
}

GitHubRelease represents a GitHub release

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles SDK installation and version management

func NewManager

func NewManager() (*Manager, error)

NewManager creates a new SDK manager instance

func (*Manager) EnsureDirs

func (m *Manager) EnsureDirs() error

EnsureDirs creates the necessary directory structure

func (*Manager) GetActiveVersion

func (m *Manager) GetActiveVersion() (string, error)

GetActiveVersion returns the currently active version (DEPRECATED) This method is kept for backward compatibility but should not be used

func (*Manager) GetLatestPrereleaseVersionTag

func (m *Manager) GetLatestPrereleaseVersionTag(toolName string) (string, error)

GetLatestPrereleaseVersionTag fetches the latest pre-release (RC/nightly) tag from GitHub

func (*Manager) GetLatestVersionTag

func (m *Manager) GetLatestVersionTag(toolName string) (string, error)

GetLatestVersionTag fetches the latest release tag from GitHub for a specific tool

func (*Manager) GetRelease

func (m *Manager) GetRelease(toolName, version string) (*GitHubRelease, error)

GetRelease fetches release information for a specific tool and version

func (*Manager) GetToolVersion

func (m *Manager) GetToolVersion(tool string) (string, error)

GetToolVersion returns the active version for a specific tool

func (*Manager) InstallAllToolsFromSource

func (m *Manager) InstallAllToolsFromSource() error

InstallAllToolsFromSource clones all Grove tools and builds them in a shared workspace

func (*Manager) InstallTool

func (m *Manager) InstallTool(toolName, versionTag string) error

InstallTool installs a specific tool at a specific version

func (*Manager) InstallToolFromSource

func (m *Manager) InstallToolFromSource(toolName string) (string, error)

InstallToolFromSource clones and builds a tool from its main branch using a Go workspace

func (*Manager) ListInstalledVersions

func (m *Manager) ListInstalledVersions() ([]string, error)

ListInstalledVersions returns all installed versions

func (*Manager) ResolveDependencies

func (m *Manager) ResolveDependencies(initialToolSpecs []string) ([]string, error)

ResolveDependencies takes a list of user-specified tools and returns a complete list of tools to install, including all dependencies

func (*Manager) SetActiveVersion

func (m *Manager) SetActiveVersion(version string) error

SetActiveVersion sets the active version (DEPRECATED) This method is kept for backward compatibility but should not be used

func (*Manager) SetToolVersion

func (m *Manager) SetToolVersion(tool, version string) error

SetToolVersion sets the active version for a specific tool

func (*Manager) SetUseGH

func (m *Manager) SetUseGH(useGH bool)

SetUseGH sets whether to use gh CLI for downloads

func (*Manager) UninstallVersion

func (m *Manager) UninstallVersion(versionTag string) error

UninstallVersion removes a specific version

func (*Manager) UseToolVersion

func (m *Manager) UseToolVersion(tool, versionTag string) error

UseToolVersion switches a specific tool to a specific version

func (*Manager) UseVersion

func (m *Manager) UseVersion(versionTag string) error

UseVersion switches to a specific version (DEPRECATED)

type ToolInfo

type ToolInfo struct {
	Alias        string   // Default alias and binary name
	Description  string   // Short description of the tool
	Dependencies []string // List of canonical RepoNames this tool depends on
}

ToolInfo contains information about a tool

func FindTool

func FindTool(identifier string) (string, ToolInfo, string, bool)

FindTool resolves a user-provided identifier (repo name, alias) to its canonical info It returns the canonical repoName, the ToolInfo, the effective alias, and a found boolean

type ToolVersions

type ToolVersions struct {
	Versions map[string]string `json:"versions"` // tool -> version mapping
}

ToolVersions tracks the active version for each tool independently

func LoadToolVersions

func LoadToolVersions() (*ToolVersions, error)

LoadToolVersions loads the active versions for all tools

func (*ToolVersions) GetToolVersion

func (tv *ToolVersions) GetToolVersion(tool string) string

GetToolVersion returns the active version for a specific tool

func (*ToolVersions) Save

func (tv *ToolVersions) Save() error

Save saves the tool versions to disk

func (*ToolVersions) SetToolVersion

func (tv *ToolVersions) SetToolVersion(tool, version string)

SetToolVersion sets the active version for a specific tool

Jump to

Keyboard shortcuts

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