Skip to content

Conversation

@sanchxt
Copy link
Owner

@sanchxt sanchxt commented Jan 11, 2026

Summary

Implements the yoop update command to enable seamless self-updating directly from the CLI without manual npm commands.

Features

  • Self-update command: yoop update handles version checking, downloading, and installation
  • Automatic update checks: Background checks during long-running commands (share, receive, clipboard)
  • Migration framework: Automatic config/data migration when schema changes between versions
  • Backup and rollback: Full backup before updates with yoop update --rollback support
  • Package manager detection: Auto-detects and uses npm/pnpm/yarn/bun
  • Multiple output modes: Normal, JSON (--json), and quiet (--quiet) output

Commands

yoop update                    # Update to latest version
yoop update --check            # Check for updates without installing
yoop update --rollback         # Rollback to previous version
yoop update --force            # Force reinstall current version
yoop update --package-manager pnpm  # Use specific package manager

Configuration

New [update] section in config.toml:

[update]
auto_check = true              # Enable background update checks
check_interval = "24h"         # Interval between checks
package_manager = null         # Auto-detect if not set
notify = true                  # Show update notifications

Implementation Details

  • Version checking: Queries npm registry API with caching to respect check_interval
  • Migration system: Trait-based migrations with up/down support for schema changes
  • Backup manager: Automatic backups before updates, keeps last 5, stored in platform data directory
  • Package manager detection: Priority: CLI flag → config → env var → auto-detect → fallback to npm

Testing

  • 47 tests passing (36 unit + 11 integration)
  • Full coverage of version parsing, package manager detection, backup/restore, migrations, and update workflow
  • Verified on Linux with all package managers

- Fix rustdoc broken intra-doc links in migration docs by escaping [update] brackets
- Fix rustls CryptoProvider panic by using only ring crypto provider
  - Disable default features that enable aws-lc-rs
  - Explicitly enable ring for tokio-rustls and rustls
- Fix package_manager test to handle missing npm on CI runners

Resolves CI failures in documentation build, cross-platform tests, and Windows tests.
Update test_update_config_with_package_manager and
test_package_manager_detection_priority to check if package managers
are available before asserting success.
- Add availability check for environment-detected package managers
  in PackageManager::detect() for consistent behavior
- Clear conflicting env vars in tests to prevent race conditions
  when tests run in parallel
@sanchxt sanchxt merged commit ff89a41 into main Jan 12, 2026
11 checks passed
@github-actions github-actions bot mentioned this pull request Jan 12, 2026
@sanchxt sanchxt deleted the feat/update-command branch January 12, 2026 09:43
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