Documentation
¶
Index ¶
- Variables
- func IsMarketplaceReference(input string) bool
- func NewAddCommand() *cobra.Command
- func NewClientsCommand() *cobra.Command
- func NewConfigCommand() *cobra.Command
- func NewInitCommand() *cobra.Command
- func NewInstallCommand() *cobra.Command
- func NewProfileCommand() *cobra.Command
- func NewRemoveCommand() *cobra.Command
- func NewReportUsageCommand() *cobra.Command
- func NewRoleCommand() *cobra.Command
- func NewServeCommand() *cobra.Command
- func NewUninstallCommand() *cobra.Command
- func NewUpdateCommand() *cobra.Command
- func NewUpdateTemplatesCommand() *cobra.Command
- func NewVaultCommand() *cobra.Command
- func PrintClientsSection(out *ui.Output, clientInfos []ClientInfo)
- func PrintClientsSectionWriter(w io.Writer, clientInfos []ClientInfo)
- func RunDefaultCommand(cmd *cobra.Command, args []string) error
- func ValidateMarketplaceReference(ref MarketplaceReference) error
- func WithPrompter(ctx context.Context, prompter Prompter) context.Context
- type AssetInfo
- type AssetStatus
- type AssetUninstallPlan
- type ClientInfo
- type ClientsOutput
- type CodexNotifyEvent
- type ConfigInfo
- type ConfigOutput
- type CopilotPostToolUseEvent
- type DirectoryInfo
- type MarketplaceReference
- type PlatformInfo
- type PostToolUseEvent
- type Prompter
- type ScopeAssets
- type Section
- type StdPrompter
- type UninstallOptions
- type UninstallPlan
- type UninstallResult
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
var ErrAssetNotFound = errors.New("asset not found")
ErrAssetNotFound is returned when no asset is found in the lock file
Functions ¶
func IsMarketplaceReference ¶ added in v0.8.0
IsMarketplaceReference checks if input matches the plugin@marketplace pattern
func NewClientsCommand ¶ added in v0.11.0
NewClientsCommand creates the clients command
func NewConfigCommand ¶
NewConfigCommand creates the config command
func NewInstallCommand ¶
NewInstallCommand creates the install command
func NewProfileCommand ¶ added in v0.7.0
NewProfileCommand creates the profile command with subcommands
func NewRemoveCommand ¶
NewRemoveCommand creates the remove command
func NewReportUsageCommand ¶
NewReportUsageCommand creates the report-usage command
func NewRoleCommand ¶ added in v0.11.1
NewRoleCommand creates the role command with subcommands
func NewServeCommand ¶
NewServeCommand creates the serve command
func NewUninstallCommand ¶
NewUninstallCommand creates the uninstall command
func NewUpdateCommand ¶
NewUpdateCommand creates the update command
func NewUpdateTemplatesCommand ¶
NewUpdateTemplatesCommand creates the update-templates command (hidden)
func NewVaultCommand ¶ added in v0.6.0
NewVaultCommand creates a new vault command
func PrintClientsSection ¶ added in v0.11.0
func PrintClientsSection(out *ui.Output, clientInfos []ClientInfo)
PrintClientsSection outputs styled client information to the given writer. Used by both 'sx clients' and 'sx config' commands.
func PrintClientsSectionWriter ¶ added in v0.11.0
func PrintClientsSectionWriter(w io.Writer, clientInfos []ClientInfo)
PrintClientsSectionWriter outputs styled client information to the given io.Writer. Used for compatibility with existing code that uses io.Writer.
func RunDefaultCommand ¶
RunDefaultCommand runs the default command (install if lock file exists)
func ValidateMarketplaceReference ¶ added in v0.8.0
func ValidateMarketplaceReference(ref MarketplaceReference) error
ValidateMarketplaceReference validates that a marketplace reference doesn't contain path traversal characters
Types ¶
type AssetStatus ¶
type AssetStatus string
AssetStatus represents the installation status of an asset
const ( StatusInstalled AssetStatus = "installed" // Installed and matches lock file StatusOutdated AssetStatus = "outdated" // Installed but different version StatusNotInstalled AssetStatus = "not_installed" // In lock file but not installed StatusOrphaned AssetStatus = "orphaned" // Installed but not in lock file )
type AssetUninstallPlan ¶
type AssetUninstallPlan struct {
Name string
Version string
Type asset.Type
IsGlobal bool
Repository string // Empty for global scope
Path string // Path within repo (if path-scoped)
Clients []string // client IDs that have this installed
LockEntry *lockfile.Asset
}
AssetUninstallPlan contains info needed to uninstall one asset
type ClientInfo ¶
type ClientInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Installed bool `json:"installed"`
Enabled bool `json:"enabled"`
ForceEnabled bool `json:"forceEnabled,omitempty"` // explicitly force-enabled in config
ForceDisabled bool `json:"forceDisabled,omitempty"` // explicitly force-disabled in config
Version string `json:"version,omitempty"`
Directory string `json:"directory"`
HooksInstalled bool `json:"hooksInstalled"`
Supports []string `json:"supports"`
}
type ClientsOutput ¶ added in v0.11.0
type ClientsOutput struct {
Clients []ClientInfo `json:"clients"`
}
ClientsOutput represents the output for the clients command
type CodexNotifyEvent ¶ added in v0.12.3
type CodexNotifyEvent struct {
Type string `json:"type"`
TurnID string `json:"turn-id"`
InputMessages []string `json:"input-messages"`
LastAssistantMessage string `json:"last-assistant-message"`
}
CodexNotifyEvent represents the JSON payload from Codex notify hook
type ConfigInfo ¶
type ConfigOutput ¶
type ConfigOutput struct {
Version VersionInfo `json:"version"`
Platform PlatformInfo `json:"platform"`
Config ConfigInfo `json:"config"`
Directories DirectoryInfo `json:"directories"`
Clients []ClientInfo `json:"clients"`
CurrentScope *scope.Scope `json:"currentScope,omitempty"`
Assets []ScopeAssets `json:"assets"`
RecentLogs []string `json:"recentLogs"`
}
ConfigOutput represents the full config output for JSON serialization
type CopilotPostToolUseEvent ¶ added in v0.12.3
type CopilotPostToolUseEvent struct {
ToolName string `json:"toolName"`
ToolArgs map[string]any `json:"toolArgs"`
}
CopilotPostToolUseEvent represents the JSON payload from GitHub Copilot postToolUse hook
type DirectoryInfo ¶
type MarketplaceReference ¶ added in v0.8.0
MarketplaceReference represents a parsed plugin@marketplace reference
func ParseMarketplaceReference ¶ added in v0.8.0
func ParseMarketplaceReference(input string) MarketplaceReference
ParseMarketplaceReference splits plugin@marketplace into its parts
type PlatformInfo ¶
type PostToolUseEvent ¶
type PostToolUseEvent struct {
ToolName string `json:"tool_name"`
ToolInput map[string]any `json:"tool_input"`
}
PostToolUseEvent represents the JSON payload from Claude Code PostToolUse hook
type Prompter ¶
type Prompter interface {
Prompt(message string) (string, error)
PromptWithDefault(message, defaultValue string) (string, error)
Confirm(message string) (bool, error)
}
Prompter provides an interface for interactive prompts This abstraction allows for: 1. Easy testing via mocking 2. Future UI improvements (e.g., switching to a TUI library) without changing all call sites
type ScopeAssets ¶
type Section ¶ added in v0.9.0
type Section = utils.MarkdownSection
Section is an alias for utils.MarkdownSection for convenience
type StdPrompter ¶
type StdPrompter struct {
// contains filtered or unexported fields
}
StdPrompter implements Prompter using standard I/O
func NewStdPrompter ¶
func NewStdPrompter(in io.Reader, out io.Writer) *StdPrompter
NewStdPrompter creates a new standard I/O prompter
func (*StdPrompter) Confirm ¶
func (p *StdPrompter) Confirm(message string) (bool, error)
Confirm asks a yes/no question
func (*StdPrompter) Prompt ¶
func (p *StdPrompter) Prompt(message string) (string, error)
Prompt displays a prompt and reads user input
func (*StdPrompter) PromptWithDefault ¶
func (p *StdPrompter) PromptWithDefault(message, defaultValue string) (string, error)
PromptWithDefault displays a prompt with a default value
type UninstallOptions ¶
UninstallOptions contains options for the uninstall command
type UninstallPlan ¶
type UninstallPlan struct {
Assets []AssetUninstallPlan
GitContext *gitutil.GitContext
TargetBase string // tracking base for updating tracker
}
UninstallPlan contains the complete uninstall plan
type UninstallResult ¶
type UninstallResult struct {
AssetName string
Repository string // Empty for global scope
Path string // Path within repo (if path-scoped)
ClientID string
Success bool
Error error
}
UninstallResult tracks what was uninstalled
type VersionInfo ¶
Source Files
¶
- add.go
- add_config.go
- add_detect.go
- add_input.go
- add_lockfile.go
- add_marketplace.go
- add_options.go
- add_remote_mcp.go
- add_rule.go
- add_scope.go
- add_scope_display.go
- add_single_file.go
- add_skillssh.go
- browse.go
- clients.go
- commands.go
- config.go
- hooks.go
- init.go
- init_import.go
- install.go
- install_assets.go
- install_cleanup.go
- install_context.go
- install_hooks.go
- install_lockfile.go
- output.go
- profile.go
- prompter.go
- remove.go
- report_usage.go
- role.go
- serve.go
- uninstall.go
- update.go
- update_templates.go
- vault.go