Documentation
¶
Overview ¶
Package uninstall provides functionality for removing SageOx from repositories.
The package handles the complete uninstall process including:
- Finding and removing the .sageox directory
- Cleaning up git hooks installed by SageOx
- Removing agent integration files (AGENTS.md, CLAUDE.md, etc.)
- Optionally removing user-level integrations
The uninstall process uses git commands to properly handle tracked files and ensures user content is preserved when cleaning up shared files.
Index ¶
- func GetPlatformInfo() string
- func RemoveRepoHooks(repoRoot string, dryRun bool) error
- func RemoveSageoxDir(repoRoot string, dryRun bool) error
- func RemoveUserIntegrations(items []UserIntegrationItem, dryRun bool) error
- func ShouldRemoveUserConfig() bool
- type GitHookItem
- type SageoxFileItem
- type UserIntegrationItem
- type UserIntegrationsFinder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPlatformInfo ¶
func GetPlatformInfo() string
GetPlatformInfo returns platform-specific information for display
func RemoveRepoHooks ¶
RemoveRepoHooks removes SageOx hooks from .git/hooks/ If dryRun is true, only reports what would be removed without making changes Returns error if any removal fails
func RemoveSageoxDir ¶
RemoveSageoxDir removes the .sageox directory from the repository Uses 'git rm -r' for tracked files and os.RemoveAll for untracked files If dryRun is true, only logs what would be done without making changes
func RemoveUserIntegrations ¶
func RemoveUserIntegrations(items []UserIntegrationItem, dryRun bool) error
RemoveUserIntegrations removes user-level SageOx integrations dryRun: if true, only shows what would be removed without actually removing
func ShouldRemoveUserConfig ¶
func ShouldRemoveUserConfig() bool
ShouldRemoveUserConfig determines if user config should be removed This is intentionally conservative - we only suggest it, never do it automatically
Types ¶
type GitHookItem ¶
type GitHookItem struct {
Path string // full path to hook file
Name string // hook name (e.g., "pre-commit")
HasMixed bool // true if hook contains both SageOx and non-SageOx content
IsEntireSox bool // true if entire file is SageOx content
}
GitHookItem represents a git hook that can be removed
func FindSageoxHooks ¶
func FindSageoxHooks(repoRoot string) ([]GitHookItem, error)
FindSageoxHooks scans .git/hooks/ directory for SageOx-installed hooks Returns list of hooks that contain SageOx markers
type SageoxFileItem ¶
type SageoxFileItem struct {
Path string // absolute path to the item
RelPath string // path relative to git root
Size int64 // size in bytes (0 for directories)
IsTracked bool // whether the item is tracked by git
IsDir bool // whether the item is a directory
}
RemovalItem represents a file or directory that will be removed during uninstall
func FindSageoxFiles ¶
func FindSageoxFiles(repoRoot string) ([]SageoxFileItem, error)
FindSageoxFiles finds all files in the .sageox/ directory Returns a list of RemovalItem entries for preview and processing
type UserIntegrationItem ¶
type UserIntegrationItem struct {
Path string // full path to the item
Type string // type of item: "hook", "config", "plugin"
Agent string // which agent it belongs to: "claude", "opencode", "gemini", etc.
Description string // human-readable description
}
RemovalItem represents a user-level item that can be removed
type UserIntegrationsFinder ¶
type UserIntegrationsFinder struct {
// contains filtered or unexported fields
}
UserIntegrationsFinder finds all user-level SageOx integrations
func NewUserIntegrationsFinder ¶
func NewUserIntegrationsFinder() (*UserIntegrationsFinder, error)
NewUserIntegrationsFinder creates a new finder
func (*UserIntegrationsFinder) FindAll ¶
func (f *UserIntegrationsFinder) FindAll() ([]UserIntegrationItem, error)
FindAll finds all user-level SageOx integrations