Skip to content

Upgrade prompts#81

Merged
andrewjensen merged 14 commits into
mainfrom
adj/update-prompts
Jun 8, 2026
Merged

Upgrade prompts#81
andrewjensen merged 14 commits into
mainfrom
adj/update-prompts

Conversation

@andrewjensen

@andrewjensen andrewjensen commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Overview

This adds logic to check for the CLI's latest version, then interactively prompt the user whether they want to update, snooze, or skip this version. If the user chooses to update, we will update both the skill and the CLI source after the original command has finished. If the user chooses to either snooze or skip, we persist that decision into the config file.

In non-interactive settings, we only write to stderr.

Screenshots

image image

Steps to QA

Some useful commands for managing the config file:

# See the current value of the config file
cat ~/.config/dx/config.json | jq

# Clear out version-related fields
cat ~/.config/dx/config.json | jq 'del(.currentVersionCache) | del(.versionPromptSelection)' > /tmp/dx-config-tmp.json && mv /tmp/dx-config-tmp.json ~/.config/dx/config.json

Steps to run for each prompt option:

  • Clear out version-related fields (see above)
  • Edit the package.json version to some lower value
  • Run a DX command to make the version-checking logic run
    • Example: dx catalog entities info app --include core
  • Try one of the options:
    • Upgrade: add a manual throw new Error("Stop!") in performUpdate to avoid creating a conflict between local and NPM installations, and confirm that the line gets hit
    • Snooze: confirm that the snoozing logic takes effect so versions are not checked on the following command
    • Skip: confirm that version is still checked but no prompt appears

@andrewjensen andrewjensen marked this pull request as draft June 2, 2026 20:56
@andrewjensen andrewjensen changed the title Fetch latest version, prompt user to update Upgrade prompts Jun 3, 2026
@andrewjensen andrewjensen marked this pull request as ready for review June 3, 2026 19:49
Comment thread src/cli.ts Outdated
@andrewjensen andrewjensen merged commit 298d6b1 into main Jun 8, 2026
3 checks passed
@andrewjensen andrewjensen deleted the adj/update-prompts branch June 8, 2026 15:36
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