Repository navigation
fix(starter): recover from missing Copilot CLI during setup - #26
Merged
Merged
Conversation
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
There was a problem hiding this comment.
🟡 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
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
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.

Why
When the Copilot app cannot find the
copilotcommand, 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.