diff --git a/README.md b/README.md index 73877b3..8ba45c7 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,17 @@ Save up to 40% on agent token costs with code graphs. Supermodel maps every file, function, and call relationship in your repo and writes a `.graph` file next to each source file. Your agent reads them automatically via grep and cat. No prompt changes. No extra context windows. No new tools to learn. +## Linux / Mac + ```bash curl -fsSL https://supermodeltools.com/install.sh | sh ``` +## npm (cross-platform) + +```bash +npm install -g @supermodeltools/cli +``` --- ## How it works @@ -88,7 +95,7 @@ go build -o supermodel . ```bash supermodel setup # authenticate + configure (runs automatically after install) -cd /path/to/your/repo +cd your/repo supermodel watch # generate graph files and keep them updated ``` diff --git a/npm/install.js b/npm/install.js index 5aadabd..0e900b0 100644 --- a/npm/install.js +++ b/npm/install.js @@ -65,9 +65,16 @@ download(url, tmpArchive, () => { if (ext === "tar.gz") { execSync(`tar -xzf "${tmpArchive}" -C "${BIN_DIR}" supermodel`); } else { - execSync(`unzip -o "${tmpArchive}" supermodel.exe -d "${BIN_DIR}"`); + // Windows: Expand-Archive extracts all files, so extract to a temporary + // directory and copy only the binary. + const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "supermodel-extract-")); + execSync( + `powershell -NoProfile -Command "Expand-Archive -Force -Path '${tmpArchive}' -DestinationPath '${tmpDir}'"`, + ); + fs.copyFileSync(path.join(tmpDir, "supermodel.exe"), BIN_PATH); + fs.rmSync(tmpDir, { recursive: true, force: true }); } - fs.chmodSync(BIN_PATH, 0o755); + if (process.platform !== "win32") fs.chmodSync(BIN_PATH, 0o755); fs.unlinkSync(tmpArchive); console.log(`[supermodel] Installed to ${BIN_PATH}`); });