Documentation
¶
Index ¶
- Constants
- Variables
- func ClearCache() error
- func DiscoverPopularMarketplaces() (map[string]*MarketplaceManifest, error)
- func DiscoverWithRegistry() (map[string]*MarketplaceManifest, error)
- func PlumCacheDir() (string, error)
- func RefreshAll() error
- func SaveToCache(marketplaceName string, manifest *MarketplaceManifest) error
- type Author
- type CacheEntry
- type MarketplaceManifest
- type MarketplaceMetadata
- type MarketplaceOwner
- type MarketplacePlugin
- type MarketplaceRegistry
- type PopularMarketplace
- type RegistryCacheEntry
Constants ¶
const ( // GitHubRawBase is the base URL for GitHub raw content GitHubRawBase = "https://raw.githubusercontent.com" // DefaultBranch to fetch from DefaultBranch = "main" // HTTPTimeout for fetching marketplace files HTTPTimeout = 30 * time.Second )
const ( // RegistryURL is the URL to the official marketplace registry RegistryURL = "https://raw.githubusercontent.com/itsdevcoffee/plum/main/marketplaces.json" // RegistryCacheName for storing the registry RegistryCacheName = "_registry" // RegistryCacheTTL is how often to check for registry updates (6 hours) RegistryCacheTTL = 6 * time.Hour )
const ( // CacheTTL is how long cached marketplace data remains valid (24 hours) CacheTTL = 24 * time.Hour )
Variables ¶
var PopularMarketplaces = []PopularMarketplace{
{
Name: "claude-code-plugins-plus",
DisplayName: "Claude Code Plugins Plus",
GitHubRepo: "jeremylongshore/claude-code-plugins",
Description: "The largest collection with 254 plugins and 185 Agent Skills",
},
{
Name: "claude-code-marketplace",
DisplayName: "Claude Code Marketplace",
GitHubRepo: "ananddtyagi/claude-code-marketplace",
Description: "Community-driven marketplace with granular installation",
},
{
Name: "claude-code-plugins",
DisplayName: "Claude Code Plugins",
GitHubRepo: "anthropics/claude-code",
Description: "Official Anthropic plugins maintained by the Claude Code team",
},
{
Name: "mag-claude-plugins",
DisplayName: "MAG Claude Plugins",
GitHubRepo: "MadAppGang/claude-code",
Description: "Battle-tested workflows with 4 specialized plugins",
},
{
Name: "dev-gom-plugins",
DisplayName: "Dev-GOM Plugins",
GitHubRepo: "Dev-GOM/claude-code-marketplace",
Description: "Automation-focused collection with 15 plugins",
},
{
Name: "feedmob-plugins",
DisplayName: "FeedMob Plugins",
GitHubRepo: "feed-mob/claude-code-marketplace",
Description: "Productivity and workflow tools with 6 specialized plugins",
},
{
Name: "anthropic-agent-skills",
DisplayName: "Anthropic Agent Skills",
GitHubRepo: "anthropics/skills",
Description: "Official Anthropic skills reference with document manipulation and examples",
},
}
PopularMarketplaces is the hardcoded list from README.md
Functions ¶
func DiscoverPopularMarketplaces ¶
func DiscoverPopularMarketplaces() (map[string]*MarketplaceManifest, error)
DiscoverPopularMarketplaces fetches and returns manifests for popular marketplaces Uses cached registry if available (from Shift+U), otherwise hardcoded list Uses cache when available, fetches from GitHub otherwise Returns partial results on partial failures (best-effort)
func DiscoverWithRegistry ¶
func DiscoverWithRegistry() (map[string]*MarketplaceManifest, error)
DiscoverWithRegistry fetches marketplaces using the latest registry This is called when user presses Shift+U to update
func PlumCacheDir ¶
PlumCacheDir returns the path to plum's cache directory (~/.plum/cache/marketplaces/)
func RefreshAll ¶
func RefreshAll() error
RefreshAll clears cache and re-fetches all marketplaces using latest registry
func SaveToCache ¶
func SaveToCache(marketplaceName string, manifest *MarketplaceManifest) error
SaveToCache saves a marketplace manifest to cache
Types ¶
type Author ¶
type Author struct {
Name string `json:"name"`
Email string `json:"email"`
URL string `json:"url"`
Company string `json:"company"`
}
Author represents author information
type CacheEntry ¶
type CacheEntry struct {
Manifest *MarketplaceManifest `json:"manifest"`
FetchedAt time.Time `json:"fetchedAt"`
Source string `json:"source"`
}
CacheEntry represents a cached marketplace manifest with metadata
type MarketplaceManifest ¶
type MarketplaceManifest struct {
Name string `json:"name"`
Owner MarketplaceOwner `json:"owner"`
Metadata MarketplaceMetadata `json:"metadata"`
Plugins []MarketplacePlugin `json:"plugins"`
}
MarketplaceManifest represents the marketplace.json structure
func FetchManifestFromGitHub ¶
func FetchManifestFromGitHub(repo string) (*MarketplaceManifest, error)
FetchManifestFromGitHub fetches marketplace.json from a GitHub repo repo format: "owner/repo-name" Returns the parsed manifest or error
func LoadFromCache ¶
func LoadFromCache(marketplaceName string) (*MarketplaceManifest, error)
LoadFromCache loads a marketplace manifest from cache if valid Returns nil if cache miss or expired (no error)
type MarketplaceMetadata ¶
type MarketplaceMetadata struct {
Description string `json:"description"`
Version string `json:"version"`
PluginRoot string `json:"pluginRoot"`
}
MarketplaceMetadata represents marketplace metadata
type MarketplaceOwner ¶
type MarketplaceOwner struct {
Name string `json:"name"`
Email string `json:"email"`
Company string `json:"company"`
}
MarketplaceOwner represents the owner of a marketplace
type MarketplacePlugin ¶
type MarketplacePlugin struct {
Name string `json:"name"`
Source string `json:"source"`
Description string `json:"description"`
Version string `json:"version"`
Author Author `json:"author"`
Category string `json:"category"`
Homepage string `json:"homepage"`
Repository string `json:"repository"`
License string `json:"license"`
Keywords []string `json:"keywords"`
Tags []string `json:"tags"`
Strict bool `json:"strict"`
}
MarketplacePlugin represents a plugin entry in a marketplace manifest
type MarketplaceRegistry ¶
type MarketplaceRegistry struct {
Version string `json:"version"`
LastUpdated string `json:"lastUpdated"`
Description string `json:"description"`
Marketplaces []PopularMarketplace `json:"marketplaces"`
}
MarketplaceRegistry represents the registry structure
type PopularMarketplace ¶
type PopularMarketplace struct {
Name string
DisplayName string
GitHubRepo string
Description string
}
PopularMarketplace represents a hardcoded popular marketplace
func FetchRegistry ¶
func FetchRegistry() ([]PopularMarketplace, error)
FetchRegistry fetches the marketplace registry from GitHub Falls back to hardcoded PopularMarketplaces on failure
func FetchRegistryWithComparison ¶
func FetchRegistryWithComparison(current []PopularMarketplace) ([]PopularMarketplace, int, error)
FetchRegistryWithComparison fetches registry and compares with current Returns new marketplaces count and the full list Compares against CACHED registry if available, otherwise uses provided list
type RegistryCacheEntry ¶
type RegistryCacheEntry struct {
Registry *MarketplaceRegistry `json:"registry"`
FetchedAt time.Time `json:"fetchedAt"`
}
RegistryCacheEntry represents a cached registry with metadata