Skip to content

Handle Windows installs#129

Closed
JustSuperHuman wants to merge 1 commit intosupermodeltools:mainfrom
JustSuperHuman:main
Closed

Handle Windows installs#129
JustSuperHuman wants to merge 1 commit intosupermodeltools:mainfrom
JustSuperHuman:main

Conversation

@JustSuperHuman
Copy link
Copy Markdown
Contributor

@JustSuperHuman JustSuperHuman commented Apr 14, 2026

Summary by CodeRabbit

  • Documentation

    • Enhanced installation guide with dedicated sections for different platforms (Linux/Mac and npm cross-platform).
    • Updated Quick start instructions for clarity.
  • Bug Fixes

    • Improved Windows installation process for better reliability and cleaner file handling.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Walkthrough

This PR updates the CLI installation documentation to clarify platform-specific install options (Linux/Mac via curl, npm cross-platform) and modifies the Windows installer to use PowerShell's Expand-Archive instead of unzip for extracting the binary.

Changes

Cohort / File(s) Summary
Documentation
README.md
Added distinct installation sections for Linux/Mac (curl) and npm (cross-platform). Updated quick start path reference from /path/to/your/repo to your/repo.
Windows Installation Logic
npm/install.js
Modified Windows .zip extraction to use PowerShell Expand-Archive (extract to temp dir → copy supermodel.exe → cleanup). Skips chmod permission change on Windows; non-Windows platforms unaffected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • jonathanpopham

Poem

A CLI tool that installs with grace,
Cross-platform paths, each in its place,
PowerShell extracts on Windows so fine,
Linux curl shines, npm aligns—
Installation smooth, by design ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is completely empty; the required template sections (What, Why, Test plan) are entirely missing. Add a description following the template with: (1) What—explain the Windows ZIP extraction logic, (2) Why—context for the change, (3) Test plan—confirm tests pass and describe manual testing on Windows.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Handle Windows installs' directly and clearly describes the main change: adding Windows-specific installation handling to the install script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
npm/install.js (1)

68-69: Please avoid pejorative wording in source comments.

Line 68’s comment text can age poorly in shared codebases; neutral phrasing keeps docs professional.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@npm/install.js` around lines 68 - 69, The inline comment that currently reads
"Windows (peasants): Expand-Archive extracts everything, so extract to a temp
dir and copy only the binary." uses pejorative language; replace it with a
neutral, professional comment that explains the Windows behavior and the
workaround (for example: "Windows: Expand-Archive extracts all files, so extract
to a temporary directory and copy only the binary."). Update the comment near
the Windows extraction handling in install.js (the comment starting "Windows
(peasants):") to the neutral wording.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@npm/install.js`:
- Around line 70-75: The code currently uses a fixed temp directory (tmpDir =
path.join(os.tmpdir(), "supermodel-extract")) which can collide across parallel
installs; change the creation of tmpDir in npm/install.js to a unique per-run
temp directory (e.g., use fs.mkdtempSync or fs.promises.mkdtemp with a prefix
like path.join(os.tmpdir(), "supermodel-extract-")) and then use that tmpDir for
the Expand-Archive command, the fs.copyFileSync(path.join(tmpDir,
"supermodel.exe"), BIN_PATH) call, and the final fs.rmSync cleanup so each
process has its own distinct extraction folder and is still properly removed
afterwards.

In `@README.md`:
- Around line 7-13: The README currently jumps from H1 to H3 (lines showing "###
Linux / Mac" and "### npm (cross-platform)"); update those section headings to
H2 by changing "### Linux / Mac" and "### npm (cross-platform)" to "## Linux /
Mac" and "## npm (cross-platform)" so the heading hierarchy is consistent and
satisfies markdownlint MD001.

---

Nitpick comments:
In `@npm/install.js`:
- Around line 68-69: The inline comment that currently reads "Windows
(peasants): Expand-Archive extracts everything, so extract to a temp dir and
copy only the binary." uses pejorative language; replace it with a neutral,
professional comment that explains the Windows behavior and the workaround (for
example: "Windows: Expand-Archive extracts all files, so extract to a temporary
directory and copy only the binary."). Update the comment near the Windows
extraction handling in install.js (the comment starting "Windows (peasants):")
to the neutral wording.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ca93748b-cf15-437f-8ed0-7f2b15b269d8

📥 Commits

Reviewing files that changed from the base of the PR and between c450bb9 and 25ce24b.

📒 Files selected for processing (2)
  • README.md
  • npm/install.js

Comment thread npm/install.js
Comment on lines +70 to +75
const tmpDir = 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 });
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use a unique temp extraction directory to avoid install collisions.

Lines 70-75 use a fixed temp folder name. Parallel installs can race on the same directory and fail intermittently. Use a unique temp dir per run.

Proposed fix
-    const tmpDir = 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 });
+    const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "supermodel-extract-"));
+    try {
+      execSync(
+        `powershell -NoProfile -Command "Expand-Archive -Force -Path '${tmpArchive}' -DestinationPath '${tmpDir}'"`,
+      );
+      fs.copyFileSync(path.join(tmpDir, "supermodel.exe"), BIN_PATH);
+    } finally {
+      fs.rmSync(tmpDir, { recursive: true, force: true });
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const tmpDir = 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 });
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "supermodel-extract-"));
try {
execSync(
`powershell -NoProfile -Command "Expand-Archive -Force -Path '${tmpArchive}' -DestinationPath '${tmpDir}'"`,
);
fs.copyFileSync(path.join(tmpDir, "supermodel.exe"), BIN_PATH);
} finally {
fs.rmSync(tmpDir, { recursive: true, force: true });
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@npm/install.js` around lines 70 - 75, The code currently uses a fixed temp
directory (tmpDir = path.join(os.tmpdir(), "supermodel-extract")) which can
collide across parallel installs; change the creation of tmpDir in
npm/install.js to a unique per-run temp directory (e.g., use fs.mkdtempSync or
fs.promises.mkdtemp with a prefix like path.join(os.tmpdir(),
"supermodel-extract-")) and then use that tmpDir for the Expand-Archive command,
the fs.copyFileSync(path.join(tmpDir, "supermodel.exe"), BIN_PATH) call, and the
final fs.rmSync cleanup so each process has its own distinct extraction folder
and is still properly removed afterwards.

Comment thread README.md
Comment on lines +7 to +13
### Linux / Mac

```bash
curl -fsSL https://supermodeltools.com/install.sh | sh
```

### npm (cross-platform)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix heading hierarchy to satisfy markdownlint (MD001).

Line 7 jumps from H1 to H3. Promote these section headers to H2 to keep levels consistent.

Proposed fix
-### Linux / Mac
+## Linux / Mac
@@
-### npm (cross-platform)
+## npm (cross-platform)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Linux / Mac
```bash
curl -fsSL https://supermodeltools.com/install.sh | sh
```
### npm (cross-platform)
## Linux / Mac
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 7-7: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 7 - 13, The README currently jumps from H1 to H3
(lines showing "### Linux / Mac" and "### npm (cross-platform)"); update those
section headings to H2 by changing "### Linux / Mac" and "### npm
(cross-platform)" to "## Linux / Mac" and "## npm (cross-platform)" so the
heading hierarchy is consistent and satisfies markdownlint MD001.

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.

1 participant