Skip to content

Conversation

@pitzcarraldo
Copy link
Contributor

@pitzcarraldo pitzcarraldo commented Jan 21, 2026

Summary

Implements actual update execution for the clix update command across all installation methods (npm, bun, yarn, pnpm, homebrew, binary). Previously only displayed update instructions. Now supports --dry-run and --force flags for flexible update control.

Details

  • Service Layer: Added UpdatePlan and UpdateOptions types; implemented planUpdate() function; refactored executeUpdate() to use inherit stdio and handle environment variables
  • CLI Mode: Rewritten with plan → display → confirm → execute flow following uninstall command pattern
  • Binary Support: Binary installations now support auto-update via CLIX_VERSION environment variable (same pattern as OpenCode)
  • Interactive Mode: /update directs users to CLI command with option documentation

How to Validate

  1. Test dry-run mode: `bun run dev update --dry-run`
  2. Test with confirmation: `bun run dev update` then answer 'n' to cancel
  3. Test no-confirm: `bun run dev update --force` (in CI/test environment)
  4. Test interactive mode: `bun run dev` then `/update`
  5. Verify all tests pass: `bun test`

Pre-Merge Checklist

Code Quality

  • Types check correctly (`bun run typecheck`)
  • Linter passes (`bun run lint`)
  • Tests pass (`bun test` - 512 unit tests pass)
  • Added tests for new functionality (3 new executeUpdate tests)

Commit Standards

  • Commits follow Conventional Commits format (feat: ...)
  • No breaking changes

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --dry-run flag to preview available updates without applying them
    • Added --force flag to skip confirmation prompts during updates
    • Update process now displays a plan showing current and latest versions before proceeding
  • Improvements

    • Users are now prompted to confirm before applying updates
    • Enhanced update command messaging and user guidance

✏️ Tip: You can customize this high-level summary in your review settings.

Execute updates automatically based on installation method (npm, bun, yarn,
pnpm, homebrew, binary). Add --dry-run and --force flags. Binary installations
now support auto-update via CLIX_VERSION environment variable.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Walkthrough

The update mechanism has been refactored from immediate update execution to a plan-driven approach. New UpdateOptions and UpdatePlan structures support dry-run and forced update modes. CLI and chat handlers now guide users to run "clix update" with available options rather than performing internal checks.

Changes

Cohort / File(s) Summary
Update Service Layer
src/lib/services/update-service.ts
Introduces UpdateOptions and UpdatePlan interfaces; refactors executeUpdate signature to accept plan and options; adds dry-run support; introduces new planUpdate() function to construct plans concurrently; updates lifecycle handling with promise-based execution and structured result returns.
src/lib/services/__tests__/update-service.test.ts
CLI Command Layer
src/commands/update.ts
Refactors to plan-driven flow using planUpdate() and executeUpdate(); adds display functions (displayUpdatePlan, displayUpdateResult) and user confirmation prompt; introduces UpdateOptions parameter with default values for dryRun and force.
src/cli.tsx
src/lib/commands/update.ts
UI/Chat Handler
src/ui/chat/hooks/useCommandHandler.ts
Changes /update command from performing asynchronous runtime checks to emitting static guidance message; removes multiple service calls; routes to non-async handleUpdateCommand helper.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing actual update execution for all installation methods, which aligns with the primary refactoring from update planning to execution across the codebase.
Description check ✅ Passed The description covers all major template sections: Summary explains the feature, Details describe implementation changes, How to Validate provides validation steps, and Pre-Merge Checklist is completed with test results.
Docstring Coverage ✅ Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfb4eaa63a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +89 to +92
// No update available
if (!plan.hasUpdate) {
console.log(`You're on the latest version (${plan.currentVersion})`);
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report update-check failures instead of 'latest'

The new flow treats any plan.hasUpdate === false as success and prints “You're on the latest version.” However checkForUpdate() returns {hasUpdate: false, error: ...} on network/registry failures, and planUpdate() currently drops that error. In offline/registry-outage scenarios, clix update will misleadingly report being up to date and exit successfully, so users never learn the check failed. Consider surfacing updateResult.error (e.g., throw or print an error and exit non‑zero) before reaching this branch.

Useful? React with 👍 / 👎.

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