Skip to main content

Overview

The update command checks for GSD updates, displays what changed, and installs the latest version with user confirmation. It handles both local and global npm installations.

Syntax

How It Works

  1. Detects installation type - Local vs global npm package
  2. Checks current version - Reads installed version
  3. Fetches latest version - Queries npm registry
  4. Compares versions - Determines if update available
  5. Fetches changelog - Gets changes between versions
  6. Displays preview - Shows what will be updated
  7. Confirms with user - Gets approval before updating
  8. Executes update - Runs npm install/update
  9. Clears cache - Removes cached workflow files
  10. Confirms success - Shows new version

Usage Examples

Update available

Output:
User confirms:

Already on latest version

Output:

User declines update

After changelog preview:

Update with breaking changes

Output:

Version Detection

Local Installation

Global Installation

GSD detects installation type automatically.

Changelog Fetching

Changelog is fetched from:
  1. GitHub releases (primary)
    • https://api.github.com/repos/gsd/releases
    • Extracts release notes between versions
  2. npm package (fallback)
    • Reads CHANGELOG.md from package
    • Parses version sections
  3. Local cache (offline)
    • Last fetched changelog
    • Used if network unavailable

Update Process

1. Version Check

2. Changelog Preview

3. User Confirmation

4. Clean Install

5. Cache Clearing

6. Verification

Clean Install Warning

GSD performs clean install to prevent dependency conflicts:
Clean install:
  1. Uninstalls current version completely
  2. Clears npm cache for package
  3. Installs fresh from registry
  4. Rebuilds all dependencies
Why? Prevents issues from:
  • Stale dependency versions
  • Cached modules
  • Partial update failures
  • Lock file conflicts

Breaking Change Handling

When breaking changes are detected:
Auto-migration runs on first command after update:

Update Frequency

Check for updates

  • Weekly - For active projects
  • Before important work - Get latest features
  • After seeing new features - In documentation or changelog
  • When issues occur - May be fixed in update

Rollback

If update causes issues:

Offline Updates

If offline, manual update:

Version Pinning

To prevent auto-updates (not recommended):

Update Notifications

GSD checks for updates automatically:
Notification frequency: Once per day maximum
  • help - See updated command list
  • settings - Configure after update
  • health - Verify project integrity after update