Skip to content

feat(service): add auto-apply on Spotify updates#3839

Closed
manolopro3333 wants to merge 1 commit into
spicetify:mainfrom
manolopro3333:main
Closed

feat(service): add auto-apply on Spotify updates#3839
manolopro3333 wants to merge 1 commit into
spicetify:mainfrom
manolopro3333:main

Conversation

@manolopro3333
Copy link
Copy Markdown

@manolopro3333 manolopro3333 commented May 1, 2026

This change adds an automatic self-healing service for Spicetify. It runs in the background, checks for new Spicetify releases on startup and every 6 hours, and reapplies the patch when needed. The installer now enables the service automatically, and spicetify restore disables it so user intent is respected.

Summary by CodeRabbit

Release Notes

  • New Features
    • Introduced background service for automatic Spicetify maintenance and repair
    • Added spicetify service command with install, enable, disable, and status subcommands
    • Automatic update checks on system startup and at configurable intervals
    • Service auto-update configuration options now available

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bad279b9-7714-4b11-87b8-08babd3b8cf6

📥 Commits

Reviewing files that changed from the base of the PR and between 7226b58 and 023d72e.

📒 Files selected for processing (8)
  • install.ps1
  • spicetify.go
  • src/cmd/apply.go
  • src/cmd/auto.go
  • src/cmd/backup.go
  • src/cmd/service_startup.go
  • src/service/service.go
  • src/utils/config.go

📝 Walkthrough

Walkthrough

This PR introduces a background service mechanism for Spicetify that automatically checks for updates and maintains the applied patch state. It adds a spicetify service CLI command with installation/status management, platform-specific startup synchronization, and a monitoring loop that heals missing patches or applies updates on schedule.

Changes

Cohort / File(s) Summary
CLI Installation and Command Routing
install.ps1, spicetify.go
Adds spicetify service install invocation to the PowerShell installer and introduces the new spicetify service CLI command with subcommands for install, uninstall, enable, disable, and status to manage background update monitoring.
Core Command Integration
src/cmd/apply.go, src/cmd/auto.go, src/cmd/backup.go
Integrates service auto-update management: Apply and Auto enable auto-update at startup; Restore disables it before file restoration to prevent interference.
Service Startup Synchronization
src/cmd/service_startup.go
Implements SetServiceAutoUpdate to persist config and SyncServiceStartup with platform-specific logic to create/remove startup artifacts for Windows (.cmd file), Linux (.desktop file), and macOS (LaunchAgents .plist).
Service Background Loop
src/service/service.go
Implements the Start function that runs an infinite monitor loop, polling config changes and service intervals, detecting patch loss or interval expiry, and triggering heal to reapply patches or check for updates via Update.
Configuration
src/utils/config.go
Adds Service section to default config template with auto_update (default "0") and interval_seconds (default "60") settings.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as spicetify CLI
    participant Config as Config File
    participant Startup as Startup Manager
    participant OS as OS/System

    User->>CLI: spicetify service install
    CLI->>Config: SetServiceAutoUpdate(true)
    Config-->>CLI: Write Service.auto_update=1
    CLI->>Startup: SyncServiceStartup(true)
    Startup->>OS: Resolve executable path
    Startup->>Startup: Create parent directories
    Startup->>OS: Write startup artifact (.cmd/.desktop/.plist)
    OS-->>Startup: Artifact created
    Startup-->>CLI: Sync complete
    CLI-->>User: Service installed and enabled
Loading
sequenceDiagram
    participant OS as OS/System
    participant Service as Service Monitor
    participant Config as Config File
    participant Spotify as Spotify
    participant CLI as spicetify CLI

    OS->>Service: Start() on system boot/interval
    Service->>Config: Read Service.auto_update & interval_seconds
    loop Every poll cycle
        Service->>Config: Reparse config & backup state
        Service->>Service: Check if patch applied or interval expired
        alt Healing needed
            Service->>Service: heal()
            Service->>CLI: cmd.Update(version)
            Service->>Spotify: Kill if patch missing
            Service->>CLI: cmd.Apply(version)
            Service-->>Service: Update last state & timestamp
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • rxri

Poem

🐰 A service hops along so spry,
Checking patches as time goes by,
When healing's needed, swift it runs—
Updates and fixes, all for fun! 🌟

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@rxri
Copy link
Copy Markdown
Member

rxri commented May 1, 2026

Spicetify was never designed to run in background, and also it's out of scope of the "CLI" app. Sorry

@rxri rxri closed this May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants