Overview
Theupdate 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
- Detects installation type - Local vs global npm package
- Checks current version - Reads installed version
- Fetches latest version - Queries npm registry
- Compares versions - Determines if update available
- Fetches changelog - Gets changes between versions
- Displays preview - Shows what will be updated
- Confirms with user - Gets approval before updating
- Executes update - Runs npm install/update
- Clears cache - Removes cached workflow files
- Confirms success - Shows new version
Usage Examples
Update available
Already on latest version
User declines update
Update with breaking changes
Version Detection
Local Installation
Global Installation
Changelog Fetching
Changelog is fetched from:-
GitHub releases (primary)
https://api.github.com/repos/gsd/releases- Extracts release notes between versions
-
npm package (fallback)
- Reads CHANGELOG.md from package
- Parses version sections
-
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:- Uninstalls current version completely
- Clears npm cache for package
- Installs fresh from registry
- Rebuilds all dependencies
- Stale dependency versions
- Cached modules
- Partial update failures
- Lock file conflicts
Breaking Change Handling
When breaking changes are detected: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