Skip to content

Desktop app that records your on-screen work session and uses the GitHub Copilot SDK to reconstruct it as an intent + ordered steps, then builds a reusable Skill or Automation for Microsoft Autopilots like Scout, Microsoft Copilot Cowork, or Copilot Studio.

Auto-download Node.js in install scripts when missing

adilei0599dd1f7750
diff --git a/README.md b/README.md
index bea2a0a..3debebf 100644
--- a/README.md
+++ b/README.md
@@ -45,14 +45,16 @@ version and only does work when something actually changed.
curl -fsSL https://raw.githubusercontent.com/adilei/skill-recorder/master/install.sh | bash
```
-**Windows (PowerShell)**
+**Windows** — paste into any terminal (Command Prompt *or* PowerShell)
```powershell
-irm https://raw.githubusercontent.com/adilei/skill-recorder/master/install.ps1 | iex
+powershell -c "irm https://raw.githubusercontent.com/adilei/skill-recorder/master/install.ps1 | iex"
```
-You'll need **Node.js 22+** and the **GitHub Copilot CLI** signed in first (see
-[Requirements](#requirements)). On first launch, macOS asks for **Screen Recording**
+No prerequisites to chase: if you don't already have **Node.js 22+**, the installer quietly
+downloads a private copy just for Skill Recorder (nothing is installed system-wide, no
+executables are built). You'll want the **GitHub Copilot CLI** signed in for the analysis
+step (see [Requirements](#requirements)). On first launch, macOS asks for **Screen Recording**
permission — grant it and you're ready to record.
> ⚠️ **Keep secrets out of your recordings.** Don't record, type, paste, or narrate
@@ -70,6 +72,8 @@ Prefix either command with any of these:
| `SKILL_RECORDER_HOME` | `~/.skill-recorder` | where the app is installed |
| `SKILL_RECORDER_REF` | `master` | branch, tag, or commit to install |
| `SKILL_RECORDER_NO_RUN` | *(unset)* | set up without launching |
+| `SKILL_RECORDER_NODE_VERSION` | `latest-v22.x` | Node version to fetch when none is installed |
+| `SKILL_RECORDER_NODE_MIRROR` | `https://nodejs.org/dist` | mirror for the Node download |
Re-run the one-liner any time to update and relaunch. To relaunch without re-downloading,
run `npm start` from the install directory. The installer uses `git` when available and
@@ -84,7 +88,8 @@ falls back to a source tarball/zip download otherwise.
- **macOS** (primary target). Windows 11 x64 and ARM64 are also supported — see
[`WINDOWS-VALIDATION.md`](WINDOWS-VALIDATION.md).
-- **Node.js 22+**.
+- **Node.js 22+** — the one-liner auto-downloads a private copy if you don't already have
+ it, so you only need to install this yourself if you skip the installer.
- **GitHub Copilot CLI**, installed and signed in, with `copilot` on your `PATH`. It
powers the analysis and the skill/automation builders.
- No system media tools required — Chromium handles screen snapshots and narration audio
diff --git a/install.ps1 b/install.ps1
index ef5ab2e..4da9600 100644
--- a/install.ps1
+++ b/install.ps1
@@ -9,24 +9,31 @@
skips any step (dependency install, build) whose inputs haven't changed, so
the same one-liner both installs and updates the app.
- Usage (PowerShell):
- irm https://raw.githubusercontent.com/adilei/skill-recorder/master/install.ps1 | iex
+ Usage (one line, from any Windows terminal — cmd.exe or PowerShell):
+ powershell -c "irm https://raw.githubusercontent.com/adilei/skill-recorder/master/install.ps1 | iex"
- Or with curl.exe:
- curl.exe -fsSL https://raw.githubusercontent.com/adilei/skill-recorder/master/install.ps1 -o "$env:TEMP\install.ps1"; & "$env:TEMP\install.ps1"
+ Node.js is downloaded automatically when it's missing: an official,
+ checksum-verified Node binary (win-x64 or win-arm64) is placed under the
+ install directory and used just for this app — nothing is installed
+ system-wide and no executables are built.
Environment overrides:
- SKILL_RECORDER_HOME install directory (default: %USERPROFILE%\.skill-recorder)
- SKILL_RECORDER_REPO owner/repo (default: adilei/skill-recorder)
- SKILL_RECORDER_REF branch / tag / commit (default: master)
- SKILL_RECORDER_NO_RUN set to install & build only, without launching
+ SKILL_RECORDER_HOME install directory (default: %USERPROFILE%\.skill-recorder)
+ SKILL_RECORDER_REPO owner/repo (default: adilei/skill-recorder)
+ SKILL_RECORDER_REF branch / tag / commit (default: master)
+ SKILL_RECORDER_NO_RUN set to install & build only, without launching
+ SKILL_RECORDER_NODE_VERSION Node to fetch when missing (default: latest-v22.x)
+ SKILL_RECORDER_NODE_MIRROR Node dist mirror (default: https://nodejs.org/dist)
#>
$ErrorActionPreference = 'Stop'
+# Invoke-WebRequest is ~10x slower with the progress bar on Windows PowerShell 5.1.
+$ProgressPreference = 'SilentlyContinue'
$Repo = if ($env:SKILL_RECORDER_REPO) { $env:SKILL_RECORDER_REPO } else { 'adilei/skill-recorder' }
$Ref = if ($env:SKILL_RECORDER_REF) { $env:SKILL_RECORDER_REF } else { 'master' }
$InstallDir = if ($env:SKILL_RECORDER_HOME) { $env:SKILL_RECORDER_HOME } else { Join-Path $env:USERPROFILE '.skill-recorder' }
+$NodeMinMajor = 22
function Info($m) { Write-Host "==> $m" -ForegroundColor Cyan }
function Have($c) { [bool](Get-Command $c -ErrorAction SilentlyContinue) }
@@ -41,13 +48,69 @@ function FileSha($path) {
if (Test-Path -LiteralPath $path) { (Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash } else { '' }
}
-# --- prerequisites ---------------------------------------------------------
-if (-not (Have 'node')) { throw "Node.js 22+ is required but 'node' was not found on PATH." }
-if (-not (Have 'npm')) { throw "npm is required but was not found on PATH." }
+# True when a Node new enough to build & run the app is already on PATH.
+function Test-NodeAvailable {
+ if (-not (Have 'node')) { return $false }
+ try { return ([int](& node -p 'process.versions.node.split(".")[0]') -ge $NodeMinMajor) }
+ catch { return $false }
+}
-$nodeMajor = [int](& node -p 'process.versions.node.split(".")[0]')
-if ($nodeMajor -lt 22) { throw "Node.js 22+ is required (found $(& node -v))." }
+# Ensure a usable Node/npm is on PATH: prefer the system one, otherwise download
+# an official Node binary into "$InstallDir\.node" (once) and prepend it to PATH.
+function Initialize-NodeRuntime {
+ if (Test-NodeAvailable) { Info "Using existing Node $(& node -v)."; return }
+ $nodeDir = Join-Path $InstallDir '.node'
+ if (Test-Path -LiteralPath (Join-Path $nodeDir 'node.exe')) {
+ $env:Path = "$nodeDir;$env:Path"
+ if (Test-NodeAvailable) { Info "Using bundled Node $(& node -v) (in $nodeDir)."; return }
+ }
+
+ # OSArchitecture reports the true OS arch even from an x64 process emulated on
+ # ARM64, so ARM64 devices get the native win-arm64 build.
+ $osArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()
+ $arch = switch ($osArch) {
+ 'X64' { 'x64' }
+ 'Arm64' { 'arm64' }
+ default { throw "Can't auto-download Node for Windows $osArch; install Node $NodeMinMajor+ manually." }
+ }
+
+ $channel = if ($env:SKILL_RECORDER_NODE_VERSION) { $env:SKILL_RECORDER_NODE_VERSION } else { "latest-v$NodeMinMajor.x" }
+ if ($channel -notlike 'latest-*' -and $channel -notlike 'v*') { $channel = "v$channel" }
+ $mirror = if ($env:SKILL_RECORDER_NODE_MIRROR) { $env:SKILL_RECORDER_NODE_MIRROR } else { 'https://nodejs.org/dist' }
+ $base = "$mirror/$channel"
+
+ Info "Node $NodeMinMajor+ not found — downloading a private copy for Skill Recorder…"
+ $sums = (Invoke-WebRequest -UseBasicParsing -Uri "$base/SHASUMS256.txt").Content
+ $line = ($sums -split "`n") | Where-Object { $_ -match "node-.*-win-$arch\.zip$" } | Select-Object -First 1
+ if (-not $line) { throw "No Node win-$arch build found at $base." }
+ $fields = ($line.Trim() -split '\s+')
+ $want = $fields[0].ToLower(); $file = $fields[1]
+
+ $tmp = Join-Path $env:TEMP ("sr-node-" + [guid]::NewGuid().ToString())
+ New-Item -ItemType Directory -Force -Path $tmp | Out-Null
+ try {
+ $zip = Join-Path $tmp $file
+ Info " downloading $file"
+ Invoke-WebRequest -UseBasicParsing -Uri "$base/$file" -OutFile $zip
+ $got = (Get-FileHash -LiteralPath $zip -Algorithm SHA256).Hash.ToLower()
+ if ($got -ne $want) { throw "Checksum mismatch for $file (expected $want, got $got)." }
+ Info " checksum verified"
+
+ if (Test-Path -LiteralPath $nodeDir) { Remove-Item -Recurse -Force -LiteralPath $nodeDir }
+ Expand-Archive -LiteralPath $zip -DestinationPath $tmp -Force
+ $inner = Get-ChildItem -Directory -LiteralPath $tmp | Where-Object { $_.Name -like 'node-*' } | Select-Object -First 1
+ Move-Item -LiteralPath $inner.FullName -Destination $nodeDir
+ } finally {
+ Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -LiteralPath $tmp
+ }
+
+ $env:Path = "$nodeDir;$env:Path"
+ if (-not (Test-NodeAvailable)) { throw "Downloaded Node is still unusable — please report this." }
+ Info "Installed Node $(& node -v) into $nodeDir"
+}
+
+# --- prerequisites ---------------------------------------------------------
if (-not (Have 'copilot')) {
Write-Warning "GitHub Copilot CLI ('copilot') not found on PATH. The app will launch, but recording analysis and skill/automation building need it — install it and sign in first."
}
@@ -89,6 +152,9 @@ if (Have 'git') {
Set-Location -LiteralPath $InstallDir
+# --- ensure a Node.js runtime (download one if the system has none) --------
+Initialize-NodeRuntime
+
# --- install dependencies (only when the lockfile changed) -----------------
$depsStamp = Join-Path $InstallDir '.skill-recorder-deps.sha'
$depsNow = FileSha 'package-lock.json'
diff --git a/install.sh b/install.sh
index a6ea58b..5c3b379 100755
--- a/install.sh
+++ b/install.sh
@@ -13,17 +13,26 @@
# Usage:
# curl -fsSL https://raw.githubusercontent.com/adilei/skill-recorder/master/install.sh | bash
#
+# Node.js is the only heavy prerequisite, and you don't need it pre-installed:
+# if a suitable Node isn't already on your PATH, this script downloads an
+# official, checksum-verified Node.js binary into the install directory and uses
+# it just for this app. Nothing is installed system-wide and no executables are
+# built.
+#
# Environment overrides:
-# SKILL_RECORDER_HOME install directory (default: ~/.skill-recorder)
-# SKILL_RECORDER_REPO owner/repo (default: adilei/skill-recorder)
-# SKILL_RECORDER_REF branch / tag / commit (default: master)
-# SKILL_RECORDER_NO_RUN set to install & build only, without launching
+# SKILL_RECORDER_HOME install directory (default: ~/.skill-recorder)
+# SKILL_RECORDER_REPO owner/repo (default: adilei/skill-recorder)
+# SKILL_RECORDER_REF branch / tag / commit (default: master)
+# SKILL_RECORDER_NO_RUN set to install & build only, without launching
+# SKILL_RECORDER_NODE_VERSION Node to fetch when missing (default: latest-v22.x)
+# SKILL_RECORDER_NODE_MIRROR Node dist mirror (default: https://nodejs.org/dist)
#
set -euo pipefail
REPO="${SKILL_RECORDER_REPO:-adilei/skill-recorder}"
REF="${SKILL_RECORDER_REF:-master}"
INSTALL_DIR="${SKILL_RECORDER_HOME:-$HOME/.skill-recorder}"
+NODE_MIN_MAJOR=22
info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; }
warn() { printf '\033[1;33mwarning:\033[0m %s\n' "$*" >&2; }
@@ -36,18 +45,88 @@ sha256() { # print the sha256 of a file, or nothing if it doesn't exist
else sha256sum "$1" | awk '{print $1}'; fi
}
-# --- prerequisites ---------------------------------------------------------
-have node || die "Node.js 22+ is required but 'node' was not found on PATH."
-have npm || die "npm is required but was not found on PATH."
+# True when a Node new enough to build & run the app is already on PATH.
+node_ok() {
+ have node || return 1
+ local maj; maj="$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)"
+ [ "${maj:-0}" -ge "$NODE_MIN_MAJOR" ]
+}
+
+# Echo "<os> <arch>" tokens matching Node's dist filenames, or die if unsupported.
+detect_node_platform() {
+ local os arch
+ case "$(uname -s)" in
+ Darwin) os=darwin ;;
+ Linux) os=linux ;;
+ *) die "Can't auto-download Node for $(uname -s); install Node ${NODE_MIN_MAJOR}+ manually." ;;
+ esac
+ case "$(uname -m)" in
+ x86_64|amd64) arch=x64 ;;
+ arm64|aarch64) arch=arm64 ;;
+ *) die "Can't auto-download Node for $(uname -m); install Node ${NODE_MIN_MAJOR}+ manually." ;;
+ esac
+ printf '%s %s' "$os" "$arch"
+}
+
+# Ensure a usable Node/npm is on PATH: prefer the system one, otherwise download
+# an official binary into "$INSTALL_DIR/.node" (once) and prepend it to PATH.
+ensure_node() {
+ if node_ok; then
+ info "Using existing Node $(node -v)."
+ return
+ fi
+
+ local node_dir="$INSTALL_DIR/.node"
+ if [ -x "$node_dir/bin/node" ]; then
+ PATH="$node_dir/bin:$PATH"; export PATH
+ if node_ok; then
+ info "Using bundled Node $(node -v) (in $node_dir)."
+ return
+ fi
+ fi
+
+ have curl || die "curl is required to download Node.js."
+ have tar || die "tar is required to unpack Node.js."
-node_major="$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)"
-[ "${node_major:-0}" -ge 22 ] || die "Node.js 22+ is required (found $(node -v))."
+ local platform os arch
+ platform="$(detect_node_platform)"; os="${platform% *}"; arch="${platform#* }"
+ local channel="${SKILL_RECORDER_NODE_VERSION:-latest-v${NODE_MIN_MAJOR}.x}"
+ local mirror="${SKILL_RECORDER_NODE_MIRROR:-https://nodejs.org/dist}"
+ case "$channel" in
+ latest-*|v*) : ;; # already a dist subdirectory name
+ *) channel="v$channel" ;;
+ esac
+ local base="$mirror/$channel"
+
+ info "Node ${NODE_MIN_MAJOR}+ not found — downloading a private copy for Skill Recorder…"
+ local sums; sums="$(curl -fsSL "$base/SHASUMS256.txt")" \
+ || die "Couldn't fetch Node checksums from $base/SHASUMS256.txt"
+ local file; file="$(printf '%s\n' "$sums" \
+ | awk -v re="node-.*-${os}-${arch}\\.tar\\.gz$" '$2 ~ re {print $2; exit}')"
+ [ -n "$file" ] || die "No Node ${os}-${arch} build found at $base."
+ local want; want="$(printf '%s\n' "$sums" | awk -v f="$file" '$2==f {print $1; exit}')"
+
+ local tmp; tmp="$(mktemp -d -t sr-node.XXXXXX)"
+ trap 'rm -rf "$tmp"' RETURN
+ info " downloading $file"
+ curl -fSL --progress-bar "$base/$file" -o "$tmp/$file" || die "Download failed: $base/$file"
+ local got; got="$(sha256 "$tmp/$file")"
+ [ "$got" = "$want" ] || die "Checksum mismatch for $file (expected $want, got $got)."
+ info " checksum verified"
+
+ rm -rf "$node_dir"; mkdir -p "$node_dir"
+ tar -xzf "$tmp/$file" -C "$node_dir" --strip-components=1
+ PATH="$node_dir/bin:$PATH"; export PATH
+ node_ok || die "Downloaded Node is still unusable — please report this."
+ info "Installed Node $(node -v) into $node_dir"
+}
+
+# --- fetch source ----------------------------------------------------------
have copilot || warn "GitHub Copilot CLI ('copilot') not found on PATH. The app will \
launch, but recording analysis and skill/automation building need it — install it and \
sign in first."
-# --- fetch source ----------------------------------------------------------
version_token=""
if have git; then
if [ ! -d "$INSTALL_DIR/.git" ]; then
@@ -81,6 +160,9 @@ fi
cd "$INSTALL_DIR"
+# --- ensure a Node.js runtime (download one if the system has none) --------
+ensure_node
+
# --- install dependencies (only when the lockfile changed) -----------------
deps_stamp="$INSTALL_DIR/.skill-recorder-deps.sha"
deps_now="$(sha256 package-lock.json)"