Skip to content

fix(starter): recover from missing Copilot CLI during setup - #26

Merged
lukasoppermann merged 2 commits into
mainfrom
lukasoppermann-replica-plugin-setup-f8e
Oct 19, 2026
Merged

lukasoppermann merged 2 commits into
mainfrom
lukasoppermann-replica-plugin-setup-f8e

Conversation

@lukasoppermann

Copy link
Copy Markdown
Contributor

Why

When the Copilot app cannot find the copilot command, Replica setup fails before installing app dependencies. Its recovery message tells users to enable a plugin that was never installed.

What changes

Setup installs a missing CLI globally with npm install -g @github/copilot, then uses npm's installation path without changing shell configuration or requiring a restart. Existing CLIs are left untouched. Installation does not use sudo.

Startup always attempts npm ci, even when CLI installation or Replica setup fails. Afterward, a final summary reports dependency and plugin results, failure reasons, and recovery commands. Only dependency installation failures fail startup; running plugin setup directly still reports failure with a nonzero exit status. Successful plugin installation does not claim the current session loaded the canvas.

The summary appears in setup output, not chat. Existing prototype repositories need the updated setup script and startup configuration to adopt this behavior. Real global installation and activation in a fresh Copilot app session remain unverified; automated coverage uses isolated command stand-ins.

Install a missing CLI, keep app dependency installation independent of Replica setup, and print a final setup summary with recovery guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 672ac438-2a2b-4b12-8aac-b964632eebde
@lukasoppermann
lukasoppermann requested review from a team and nshki as code owners October 19, 2026 10:47
Copilot AI max review requested due to automatic review settings October 19, 2026 10:47

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.

🟡 Changes recommended

Repeated startups reinstall an existing CLI when npm’s global bin directory remains outside PATH.

1 open issue
What changed in this PR

Improves Replica starter setup when Copilot CLI is missing, while allowing app dependencies to install independently of plugin setup.

Changes:

  • Adds automatic CLI installation through npm.
  • Continues dependency installation after plugin failures and summarizes results.
  • Expands setup coverage and recovery documentation.
File Description
starter/​scripts/​setup-replica-plugin.mjs Adds CLI recovery, startup handling, and result summaries.
starter/​README.md Documents startup behavior, prerequisites, and recovery.
starter/​.github/​github-app.yml Uses the script’s startup mode.
scripts/​setup-replica-plugin.test.mjs Covers CLI installation, failures, and startup outcomes.
docs/​getting-started.md Updates automatic setup and manual recovery guidance.

Review effort: Max

Comment thread starter/scripts/setup-replica-plugin.mjs Outdated
Check npm's existing global installation before downloading the CLI again on subsequent startups.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 672ac438-2a2b-4b12-8aac-b964632eebde
@lukasoppermann
lukasoppermann merged commit 8a74960 into main Oct 19, 2026
31 checks passed
@lukasoppermann
lukasoppermann deleted the lukasoppermann-replica-plugin-setup-f8e branch October 19, 2026 11:09
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