Add install.js installer script - #354
Conversation
Add installer script used to register marketplace and install plugins. Downloaded during session.
|
Mopskopf please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
CI is blocked on this PR: required checks (validate-keyword-case, validate-repository-metadata) show 'action_required' and the license/cla check is queued. I do not have admin rights in this repo to rerun workflows. Please re-run the workflows or advise how to proceed (or maintainers, could you re-run the required checks?). |
There was a problem hiding this comment.
Pull request overview
This PR adds a Node.js-based installer script intended to simplify local contributor setup by registering the repository marketplace and installing all plugins for Claude Code and/or the GitHub Copilot CLI.
Changes:
- Adds a root-level
install.jsinstaller script that registers/updates the marketplace and installs all plugins frommarketplace.json. - Includes logic to enable marketplace auto-update by patching the relevant CLI config files.
- Includes prerequisite checks and optional installs/updates for
pac(viadotnet) andaz(viawinget/brew).
Suppressed comments (1)
install.js:123
- This file is committed at the repo root, but the marketplace discovery logic assumes the script lives under
scripts/(repoRoot = path.resolve(scriptDir, "..")). If a user runsnode /path/to/repo/install.jsfrom a different working directory,process.cwd()won’t be the repo and the script may fail to findmarketplace.jsonlocally. Prefer treatingscriptDiritself as a candidate repo root (and optionally also..for thescripts/case).
const scriptDir = process.argv[1] ? path.dirname(path.resolve(process.argv[1])) : process.cwd();
// Script lives in scripts/, so the repo root is one level up
const repoRoot = path.resolve(scriptDir, "..");
const roots = [...new Set([repoRoot, process.cwd()])];
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Usage: | ||
| * node scripts/install.js (from local clone) | ||
| * curl -fsSL https://raw.githubusercontent.com/microsoft/power-platform-skills/main/scripts/install.js | node | ||
| */ |
| const manifest = await loadMarketplace(); | ||
| const plugins = manifest.plugins.map((p) => p.name); | ||
|
|
| function httpsGet(url) { | ||
| return new Promise((resolve, reject) => { | ||
| const request = (target) => { | ||
| https | ||
| .get(target, { headers: { "User-Agent": "power-platform-skills-installer" } }, (res) => { | ||
| if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { | ||
| return request(res.headers.location); | ||
| } | ||
| if (res.statusCode !== 200) { | ||
| return reject(new Error(`HTTP ${res.statusCode} from ${target}`)); | ||
| } | ||
| let data = ""; | ||
| res.on("data", (chunk) => (data += chunk)); | ||
| res.on("end", () => resolve(data)); | ||
| }) | ||
| .on("error", reject); | ||
| }; | ||
| request(url); | ||
| }); | ||
| } |
|
Hi Mopskopf,
|
Why
Add a small local installer to simplify developer setup: it registers the Open Plugins marketplace and installs plugins for Claude Code and GitHub Copilot so contributors can get started quickly.
Approach
This commit adds install.js (an installer script). The script detects required CLIs, registers and updates the marketplace, enables auto-update, and installs the plugins listed in the marketplace manifest.
Notes and review guidance
N/A