Skip to content

installer: add update mode for re-runs (matches armorcodex pattern)#8

Merged
Pulkit7070 merged 2 commits into
mainfrom
installer/update-mode
Jun 3, 2026
Merged

installer: add update mode for re-runs (matches armorcodex pattern)#8
Pulkit7070 merged 2 commits into
mainfrom
installer/update-mode

Conversation

@Harihara04sudhan

Copy link
Copy Markdown
Contributor

Summary

When a user re-runs curl -fsSL https://armoriq.ai/install_armorcopilot.sh | bash after they already have ArmorCopilot installed and an ArmorIQ credential file, the installer now switches to a lightweight update path instead of doing a fresh marketplace re-add + plugin reinstall + connect prompt.

Update mode does:

  1. git pull the plugin source at ~/.armoriq/armorCopilot
  2. npm install --omit=dev to refresh deps
  3. Refresh @armoriq/sdk-dev CLI (latest)
  4. Skip the marketplace re-registration and the connect prompt
  5. Print "ArmorCopilot is up to date." with the new short SHA

Fresh installs (no credentials OR plugin not yet installed) keep going through the full flow — including the abort-on-decline gate at the "Connect your ArmorIQ account now?" prompt that we shipped in PR #5.

New flags

  • --force-install — force the full install flow even if already installed
  • --update — force update mode even without credentials

Pattern

Direct port of the same three-function pattern used in install_armorcodex.sh: detect_mode / run_update_path / finish_update_banner.

Test plan

  • Fresh machine: curl -fsSL https://armoriq.ai/install_armorcopilot.sh | bash runs full install flow, prompts for connect.
  • Re-run on same machine with credentials.json present: detects update mode, refreshes git checkout + deps, prints "ArmorCopilot is up to date.", no connect prompt fires.
  • --force-install re-runs the full flow even when update mode would have been chosen.
  • --update runs update path even before any credentials exist (used for CI / scripted upgrade paths).
  • After merge, sync to armorIQ-landing/public/install_armorcopilot.sh so the curl URL serves the new behavior.

🤖 Generated with Claude Code

When re-running the curl-pipe installer with the plugin already installed
AND ArmorIQ credentials present, switch to a lightweight update flow:
git pull the plugin source, refresh npm deps, refresh the armoriq-dev
CLI. Skip the marketplace re-registration and the connect prompt.

Fresh installs (no credentials OR plugin not yet installed) go through
the full flow including the abort-on-decline gate at the connect prompt.

New flags:
- --force-install   forces full install path even if already installed
- --update          forces update path even without credentials

Mirrors install_armorcodex.sh's detect_mode / run_update_path /
finish_update_banner pattern.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 1, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the install_armorcopilot.sh installer to auto-detect re-runs and choose a lightweight “update mode” (refresh repo/deps/CLI and skip marketplace + connect prompt), while still keeping the full flow for fresh installs. It also adds flags to force either mode.

Changes:

  • Add mode detection (detect_mode) and an update path (run_update_path + finish_update_banner) for re-runs.
  • Introduce --force-install and --update flags to override auto-detection.
  • Update the installer header/docs to describe the new re-run behavior and flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install_armorcopilot.sh
Comment on lines +402 to +405
run_update_path() {
section "Refreshing plugin source"
fetch_plugin_source

Comment thread install_armorcopilot.sh
Comment on lines +466 to +472
if [[ "${mode}" == "update" ]]; then
section "Updating ArmorCopilot"
run_update_path
verify_install
finish_update_banner
exit 0
fi
Comment thread install_armorcopilot.sh
Comment on lines +417 to +427
local sha=""
if [[ -d "${INSTALL_HOME}/.git" ]]; then
sha="$(git -C "${INSTALL_HOME}" rev-parse --short HEAD 2>/dev/null || true)"
fi
echo
printf "${G}${B}ArmorCopilot is up to date.${N}\n\n"
if [[ -n "${sha}" ]]; then
info "Plugin: ${INSTALL_HOME} (refreshed to ${sha})"
else
info "Plugin: ${INSTALL_HOME} (refreshed)"
fi
Comment thread install_armorcopilot.sh
Comment on lines +386 to +388
is_armorcopilot_installed() {
[[ -f "${BOOTSTRAP_PATH}" ]] && copilot plugin list 2>/dev/null | grep -q "^[^#]*${PLUGIN_NAME}"
}
Plugin listings showed "armorcopilot@armorcopilot" because both the
plugin name and the marketplace name were "armorcopilot". Renames the
marketplace id to "armoriq" (the company) so listings now read
"armorcopilot@armoriq" — plugin@marketplace makes the product/company
distinction clear and prepares for additional plugins under the same
marketplace.

Changed:
- .claude-plugin/marketplace.json   top-level "name" -> "armoriq"
- .agents/plugins/marketplace.json  mirror copy, same change
- install_armorcopilot.sh           MARKETPLACE_NAME="armoriq"
- install_armorcopilot.sh           header comment example updated

Plugin name itself stays "armorcopilot", owner display name "ArmorIQ",
interface displayName "ArmorIQ" — all unchanged.

Existing users who ran the old installer have "armorcopilot" marketplace
registered locally. On the next installer re-run (update mode), the
marketplace registration is left in place; users who fully reinstall
will pick up the new "armoriq" marketplace name automatically.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Pulkit7070 Pulkit7070 merged commit 377f083 into main Jun 3, 2026
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.

3 participants