@@ -134,6 +134,7 @@ process_tool() {
134134 local install_action=" $( catalog_get_guide_property " $tool " install_action " " ) "
135135 local description=" $( catalog_get_property " $tool " description) "
136136 local homepage=" $( catalog_get_property " $tool " homepage) "
137+ local auto_update=" $( catalog_get_property " $tool " auto_update) "
137138
138139 # Check if up-to-date
139140 if [ -n " $is_up_to_date " ] && [ -n " $installed " ]; then
@@ -144,6 +145,36 @@ process_tool() {
144145 return 0
145146 fi
146147
148+ # Check if auto_update is enabled - install without prompting
149+ if [ " $auto_update " = " true" ]; then
150+ printf " \n==> %s %s [auto-update]\n" " $icon " " $display "
151+ printf " installed: %s via %s\n" " ${installed:- <none>} " " ${method:- unknown} "
152+ printf " target: %s\n" " $( osc8 " $url " " ${latest:- <unknown>} " ) "
153+ printf " auto-updating...\n"
154+
155+ # Build install command from catalog metadata
156+ local install_cmd=" install_tool.sh $tool "
157+ if [ -n " $install_action " ]; then
158+ install_cmd=" install_tool.sh $tool $install_action "
159+ elif [ -n " $installed " ]; then
160+ install_cmd=" install_tool.sh $tool update"
161+ fi
162+
163+ # Execute the install
164+ if [ " $tool " = " python" ]; then
165+ UV_PYTHON_SPEC=" $latest " " $ROOT " /scripts/$install_cmd || true
166+ elif [ " $tool " = " ruby" ]; then
167+ RUBY_VERSION=" $latest " " $ROOT " /scripts/$install_cmd || true
168+ else
169+ " $ROOT " /scripts/$install_cmd || true
170+ fi
171+
172+ # Re-audit with fresh collection for this specific tool
173+ CLI_AUDIT_JSON=1 CLI_AUDIT_COLLECT=1 CLI_AUDIT_MERGE=1 " $CLI " audit.py " $tool " > /dev/null 2>&1 || true
174+ AUDIT_JSON=" $( cd " $ROOT " && CLI_AUDIT_JSON=1 CLI_AUDIT_RENDER=1 " $CLI " audit.py || true) "
175+ return 0
176+ fi
177+
147178 # Prompt for installation/update
148179 printf " \n==> %s %s\n" " $icon " " $display "
149180 [ -n " $description " ] && printf " %s\n" " $description "
@@ -164,6 +195,7 @@ process_tool() {
164195 # Prompt with options explained
165196 printf " Options:\n"
166197 printf " y = Install/upgrade now\n"
198+ printf " a = Always update (install now + auto-update in future)\n"
167199 printf " N = Skip (ask again next time)\n"
168200 if [ -n " $installed " ]; then
169201 printf " s = Skip version %s (ask again if newer available)\n" " $latest "
@@ -173,7 +205,7 @@ process_tool() {
173205 printf " p = Never install (permanently skip this tool)\n"
174206 fi
175207
176- local prompt_text=" Install/update? [y/N/s/p] "
208+ local prompt_text=" Install/update? [y/a/ N/s/p] "
177209
178210 local ans=" "
179211 if [ -t 0 ]; then
@@ -218,6 +250,41 @@ process_tool() {
218250 fi
219251 fi
220252 ;;
253+ [Aa])
254+ # Install/upgrade AND enable auto-update for future
255+ printf " Enabling auto-update for future upgrades...\n"
256+ " $ROOT " /scripts/set_auto_update.sh " $tool " true > /dev/null 2>&1 || true
257+
258+ # Handle tool-specific version environment variables
259+ local upgrade_success_a=0
260+ if [ " $tool " = " python" ]; then
261+ UV_PYTHON_SPEC=" $latest " " $ROOT " /scripts/$install_cmd && upgrade_success_a=1 || true
262+ elif [ " $tool " = " ruby" ]; then
263+ RUBY_VERSION=" $latest " " $ROOT " /scripts/$install_cmd && upgrade_success_a=1 || true
264+ else
265+ " $ROOT " /scripts/$install_cmd && upgrade_success_a=1 || true
266+ fi
267+
268+ # Re-audit with fresh collection for this specific tool
269+ CLI_AUDIT_JSON=1 CLI_AUDIT_COLLECT=1 CLI_AUDIT_MERGE=1 " $CLI " audit.py " $tool " > /dev/null 2>&1 || true
270+ AUDIT_JSON=" $( cd " $ROOT " && CLI_AUDIT_JSON=1 CLI_AUDIT_RENDER=1 " $CLI " audit.py || true) "
271+
272+ # Check if upgrade succeeded
273+ local new_installed_a=" $( json_field " $tool " installed) "
274+ if [ " $upgrade_success_a " = " 0" ] || [ " $new_installed_a " = " $installed " ]; then
275+ printf " \n ⚠️ Upgrade did not succeed (version unchanged)\n"
276+ printf " Auto-update is still enabled - will try again next time.\n"
277+ else
278+ printf " ✓ Auto-update enabled. This tool will update automatically in future.\n"
279+ # Remove any existing pin
280+ if catalog_has_tool " $tool " ; then
281+ local existing_pin_a=" $( catalog_get_property " $tool " pinned_version) "
282+ if [ -n " $existing_pin_a " ]; then
283+ " $ROOT " /scripts/unpin_version.sh " $tool " || true
284+ fi
285+ fi
286+ fi
287+ ;;
221288 [Ss])
222289 # Skip this specific version
223290 printf " Skipping version %s (will prompt again if newer version available)\n" " $latest "
0 commit comments