installer: abort on declined ArmorIQ connect (mirrors armorcopilot pattern)#23
Merged
Conversation
…ttern) Previously, pressing N at the "Connect your ArmorIQ account now?" prompt let the install complete with a silent "no problem, run armoriq login anytime" message — leaving the plugin installed in a partial/offline state. Per CTO direction, ArmorCodex requires an ArmorIQ account; there is no documented offline path. This commit adds an abort_install() function that: - Strips the managed block from ~/.codex/config.toml - Removes ~/.codex/hooks.json (only if it's ours) - Removes ~/.armoriq/armorCodex plugin source - Prints "ArmorCodex requires an ArmorIQ account. Install aborted." + link to https://armoriq.ai - Exits 1 abort_install fires when: - No TTY is available for interactive login - User answers N at the connect prompt - armoriq CLI is not found and no fallback runs - armoriq login returns non-zero or no credentials.json materializes Skips the connect prompt entirely if credentials are already present (same logic as armorcopilot installer). Also tries armoriq-dev first so the dev SDK works in test environments. Mirrors armoriq/armorCopilot#5 (already merged for armorcopilot). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the ArmorCodex installer to enforce mandatory ArmorIQ authentication by aborting (and rolling back) installation when the user can’t or won’t connect an ArmorIQ account, aligning behavior with the armorCopilot installer pattern.
Changes:
- Added
abort_install()to rollback Codex config/hook wiring and remove the plugin directory, then exit non-zero. - Updated
connect_to_armoriq()to skip prompting when credentials/API key already exist, and to abort on non-interactive runs, declined prompts, missing CLI, or failed login.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+477
to
480
| if [[ -n "${ARMORIQ_API_KEY:-}" ]] || [[ -f "$HOME/.armoriq/credentials.json" ]]; then | ||
| ok "ArmorIQ credentials already present" | ||
| return 0 | ||
| fi |
Comment on lines
+457
to
+459
| if [[ -f "${GLOBAL_HOOKS}" ]] && grep -q "ArmorCodex" "${GLOBAL_HOOKS}" 2>/dev/null; then | ||
| rm -f "${GLOBAL_HOOKS}" && info "removed ${GLOBAL_HOOKS}" || true | ||
| fi |
Comment on lines
+460
to
+462
| if [[ -d "${INSTALL_HOME}" ]]; then | ||
| rm -rf "${INSTALL_HOME}" && info "removed plugin source ${INSTALL_HOME}" || true | ||
| fi |
Pulkit7070
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Previously, pressing N at "Connect your ArmorIQ account now?" let the installer complete with a silent "no problem, run armoriq login anytime" message — leaving the plugin installed in a partial/offline state. Per CTO direction, ArmorCodex requires an ArmorIQ account; there is no documented offline path.
This PR adds an
abort_install()function that:~/.codex/config.toml~/.codex/hooks.json(only if it's ours)~/.armoriq/armorCodexplugin source dir1(non-zero)When abort fires
ARMORIQ_API_KEYset)armoriqCLI not found and nonpxfallback runsarmoriq loginreturns non-zero or nocredentials.jsonmaterializes after login attemptWhen abort does NOT fire (happy paths)
~/.armoriq/credentials.json→ installer skips the prompt entirely with "ArmorIQ credentials already present"ARMORIQ_API_KEYenv var set → same skipSkips the connect prompt entirely if credentials are already present — same logic as armorcopilot installer.
Cross-reference
Mirrors armoriq/armorCopilot#5 (already merged). After this PR merges, both products have identical install-or-abort semantics, and our docs / customer messaging can claim "no offline path" consistently.
Follow-up
After merge, the landing-repo copy at
armoriq/armorIQ-landing/public/install_armorcodex.shneeds a sync PR socurl -fsSL https://armoriq.ai/install_armorcodex.sh | bashserves the new behavior.Test plan
~/.armoriq/armorCodexgone +~/.codex/hooks.jsongone + no[mcp_servers.armorcodex-policy]block in~/.codex/config.toml.🤖 Generated with Claude Code