Skip to content

feat(cli): modern command architecture, repo management, self-update and self-uninstall - #12

Merged
brasga-a merged 1 commit into
mainfrom
feat/cli-ux-refactor-and-self-management
Sep 20, 2026
Merged

brasga-a merged 1 commit into
mainfrom
feat/cli-ux-refactor-and-self-management

Conversation

@brasga-a

Copy link
Copy Markdown
Owner

Summary

This PR modernizes the pkg CLI command structure according to user feedback and operational best practices:

  1. Repository Management Consolidation (pkg repo):

    • Replaced top-level pkg sync with pkg repo update
    • Added pkg repo remote to query and list official repositories from curated registry
    • Updated pkg repo list (default for pkg repo) to display locally configured repositories
    • Updated pkg repo add <id> [url] to support curated ID or custom URL with explicit distribution suite
    • Added pkg repo remove <id> to safely remove configured repositories
  2. Package Update vs Upgrade Separation:

    • pkg upgrade: Performs package upgrades with --dry-run, --yes, and single-package targets
    • pkg update: Friendly guidance command explaining the separation between pkg upgrade and pkg repo update
  3. Native Self-Management:

    • pkg self-update: In-place atomic update of the pkg binary with sha256 checksum verification from release mirror
    • pkg self-uninstall: Native uninstallation with --purge, --dry-run, and shell rc PATH cleanup
  4. Desktop Integration Automation:

    • pkg install automatically links desktop, mime, and icon resources (opt-out with --no-integrate)
    • pkg remove (alias uninstall) automatically unlinks desktop resources
    • Plumbing commands (integrate, deintegrate, migrate) hidden from top-level help
  5. Cross-Distro Ubuntu Keyring Fetching:

    • Automatically downloads official Ubuntu archive keyring when verifying Ubuntu mirrors on non-Ubuntu hosts (like Arch)

Verification

  • cargo test --workspace: All 94 unit tests and 27 integration test suites passing
  • cargo clippy --workspace --all-targets -- -D warnings: 0 warnings, 0 errors
  • cargo fmt --all --check: Clean

…and self-uninstall

- Move repository operations under 'pkg repo': repo list, repo remote, repo update, repo add, repo remove
- Separate 'pkg upgrade' (package updates) from 'pkg update' (guidance notice)
- Add native 'pkg self-update' with sha256 verification and atomic binary replacement
- Add native 'pkg self-uninstall' with dry-run, purge, and shell PATH cleanup
- Automatically integrate desktop files on install and deintegrate on remove
- Fetch official Ubuntu archive keyring automatically in deb repository updater when absent on host
@brasga-a
brasga-a merged commit f27f211 into main Sep 20, 2026
1 check passed
@brasga-a
brasga-a deleted the feat/cli-ux-refactor-and-self-management branch September 20, 2026 06:54
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.

1 participant