Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +7 to +13
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.


```bash
npm install -g @supermodeltools/cli
```
---

## How it works
Expand Down Expand Up @@ -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
```

Expand Down
11 changes: 9 additions & 2 deletions npm/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (peasants): Expand-Archive extracts everything, so extract to a temp dir
// and copy only the binary.
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 });
Comment on lines +70 to +75
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.

}
fs.chmodSync(BIN_PATH, 0o755);
if (process.platform !== "win32") fs.chmodSync(BIN_PATH, 0o755);
fs.unlinkSync(tmpArchive);
console.log(`[supermodel] Installed to ${BIN_PATH}`);
});