From b6e6da967f5d5f4b28ad97fa63f416bb291d9dbd Mon Sep 17 00:00:00 2001 From: Harihara04sudhan Date: Mon, 1 Jun 2026 18:36:20 +0530 Subject: [PATCH 1/2] installer: add update mode (matches armorcodex pattern) 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 --- install_armorcopilot.sh | 74 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/install_armorcopilot.sh b/install_armorcopilot.sh index fcbffcb..2074b20 100755 --- a/install_armorcopilot.sh +++ b/install_armorcopilot.sh @@ -19,10 +19,14 @@ set -euo pipefail # copilot plugin install armorcopilot@armorcopilot # 5. runs `armoriq-dev login --product armorcopilot` for device-code auth # -# Idempotent: re-running pulls the latest, reinstalls deps, refreshes marketplace. +# Re-runs auto-detect mode: if the plugin and credentials are already in +# place the script runs in update mode (refresh checkout + SDK + npm deps, +# skip the login prompt). Fresh installs go through the full flow. # # Flags: -# --uninstall remove the plugin + marketplace registration +# --uninstall remove the plugin + marketplace registration +# --force-install force the full install flow even if already installed +# --update force update mode even without credentials # # Non-interactive overrides: # ARMORCOPILOT_MARKETPLACE_REPO override marketplace source (testing) @@ -69,9 +73,12 @@ PLUGIN_PATH="${PLUGIN_ROOT}/${PLUGIN_SUBDIR}" BOOTSTRAP_PATH="${PLUGIN_PATH}/scripts/bootstrap.mjs" DO_UNINSTALL=0 +FORCE_MODE="" for arg in "$@"; do case "$arg" in - --uninstall) DO_UNINSTALL=1 ;; + --uninstall) DO_UNINSTALL=1 ;; + --force-install) FORCE_MODE="install" ;; + --update) FORCE_MODE="update" ;; -h|--help) sed -n '4,32p' "${SCRIPT_PATH:-$0}" 2>/dev/null || true exit 0 @@ -372,6 +379,57 @@ EOF EOF } +# --------------------------------------------------------------------------- +# Install mode detection +# --------------------------------------------------------------------------- + +is_armorcopilot_installed() { + [[ -f "${BOOTSTRAP_PATH}" ]] && copilot plugin list 2>/dev/null | grep -q "^[^#]*${PLUGIN_NAME}" +} + +detect_mode() { + if [[ -n "${FORCE_MODE}" ]]; then + printf '%s' "${FORCE_MODE}" + return 0 + fi + if [[ -f "${HOME}/.armoriq/credentials.json" ]] && is_armorcopilot_installed; then + printf 'update' + else + printf 'install' + fi +} + +run_update_path() { + section "Refreshing plugin source" + fetch_plugin_source + + section "Refreshing dependencies" + pushd "${PLUGIN_PATH}" >/dev/null + info "running npm install (--omit=dev) to pick up latest deps" + npm install --omit=dev --silent --no-audit --no-fund >/dev/null \ + && ok "npm dependencies refreshed" \ + || warn "npm install failed, re-run manually if needed" + popd >/dev/null + install_armoriq_cli +} + +finish_update_banner() { + 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 + info "SDK: @armoriq/sdk-dev (latest)" + echo + printf " Docs: ${C}${B}https://docs.armoriq.ai/armorcopilot${N}\n\n" +} + uninstall() { section "Uninstalling ArmorCopilot" if copilot plugin uninstall "${PLUGIN_NAME}" >/dev/null 2>&1; then @@ -403,6 +461,16 @@ main() { check_node_version ok "prerequisites OK ($(copilot --version 2>/dev/null | head -1), $(node --version))" + local mode + mode="$(detect_mode)" + if [[ "${mode}" == "update" ]]; then + section "Updating ArmorCopilot" + run_update_path + verify_install + finish_update_banner + exit 0 + fi + section "Fetching plugin source" fetch_plugin_source From 9686a1a322f4fed5286a4c08ff14bef19eac2d94 Mon Sep 17 00:00:00 2001 From: Harihara04sudhan Date: Mon, 1 Jun 2026 18:46:47 +0530 Subject: [PATCH 2/2] marketplace: rename id from "armorcopilot" to "armoriq" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .agents/plugins/marketplace.json | 2 +- .claude-plugin/marketplace.json | 2 +- install_armorcopilot.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 56497ed..a05bee6 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -1,5 +1,5 @@ { - "name": "armorcopilot", + "name": "armoriq", "owner": { "name": "ArmorIQ", "email": "license@armoriq.io", diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 56497ed..a05bee6 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,5 +1,5 @@ { - "name": "armorcopilot", + "name": "armoriq", "owner": { "name": "ArmorIQ", "email": "license@armoriq.io", diff --git a/install_armorcopilot.sh b/install_armorcopilot.sh index 2074b20..526adb8 100755 --- a/install_armorcopilot.sh +++ b/install_armorcopilot.sh @@ -16,7 +16,7 @@ set -euo pipefail # 3. installs @armoriq/sdk-dev globally (for the `armoriq-dev` CLI) # 4. registers the marketplace + installs the plugin in Copilot CLI: # copilot plugin marketplace add armoriq/armorCopilot -# copilot plugin install armorcopilot@armorcopilot +# copilot plugin install armorcopilot@armoriq # 5. runs `armoriq-dev login --product armorcopilot` for device-code auth # # Re-runs auto-detect mode: if the plugin and credentials are already in @@ -44,7 +44,7 @@ D=$'\033[0;90m' N=$'\033[0m' MARKETPLACE_REPO="${ARMORCOPILOT_MARKETPLACE_REPO:-armoriq/armorCopilot}" -MARKETPLACE_NAME="armorcopilot" +MARKETPLACE_NAME="armoriq" PLUGIN_NAME="armorcopilot" PLUGIN_GIT_URL="${ARMORCOPILOT_GIT_URL:-https://github.com/armoriq/armorCopilot.git}" PLUGIN_GIT_REF="${ARMORCOPILOT_GIT_REF:-main}"