How whispin/cursor_windsurf_reset works
Project type and purpose
• This is a cross-platform desktop utility written in Go (Golang).
• It provides both a modern GUI (built with Fyne) and a command-line interface for “smart reset” of Cursor and Windsurf apps: detecting installations, backing up data, clearing caches/session data, and restoring if needed.
File structure
• Top level:
• main.go – application entry point (initializes CLI or GUI)
• version/ – version-check logic
• config/ – configuration loader and manager
• cleaner/ – core engine for detection and reset (with OS-specific code)
• gui/ – Fyne-based GUI modules (app setup, themes, embedded resources)
• i18n/ – internationalization (JSON resources + embed code)
• screenshot/ – UI illustration (not part of runtime)
• Build/deploy: go.mod, go.sum, .github/workflows/release.yml, .gitignore
README for additional insights
• Tech stack: Go 1.21+, Fyne v2
• Features: cross-platform support (Win/macOS/Linux), dual interface (GUI + CLI), safe backup mechanism
• No external databases; uses file system for backup and config
a. Main components
• User Interfaces:
– GUI layer (Fyne windows, buttons, status panels)
– CLI layer (command parsing, flags)
• Controller/Orchestrator: main.go
• Cleaning Engine: cleaner/engine.go + process_unix.go + process_windows.go
• Configuration Manager: config/config.go + reset_config.json
• Version Service: version/check.go (optional remote check)
• i18n Service: i18n/embed.go + language JSON files
• File System & OS APIs: for detection, backup, deletion
b. Relationships & interactions
– UI layer calls the Controller
– Controller loads Config and i18n, checks Version if needed
– Controller invokes Cleaning Engine, which uses OS APIs to locate app data, back up files, clear caches
– Engine reports progress/status back to UI or CLI
c. Architectural patterns & principles
– Modular package structure (separation of concerns)
– Adapter pattern for OS-specific processes
– Singleton/centralized configuration loader
– Embedded resources for portable binaries (i18n, UI assets)
d. Core technologies/frameworks
– Go modules, goroutines (if concurrent resets)
– Fyne v2 for GUI
– go:embed for resources and i18n JSON
– GitHub Actions for CI/CD (release workflow)