From 0e2abd2615bd05b87dd280dd57340e68c597c93d Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Thu, 2 Apr 2026 12:50:06 -0700 Subject: [PATCH] CC: slashcommands: update llms:ollama --- .claude/commands/llms/update-models-ollama.md | 11 ++++------- .claude/scripts/parse-ollama-models.js | 4 +++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.claude/commands/llms/update-models-ollama.md b/.claude/commands/llms/update-models-ollama.md index d5ff96048..89f0f14d3 100644 --- a/.claude/commands/llms/update-models-ollama.md +++ b/.claude/commands/llms/update-models-ollama.md @@ -8,14 +8,11 @@ Reference `src/modules/llms/server/llm.server.types.ts` and `src/modules/llms/se **Automated Workflow:** ```bash -# 1. Fetch the HTML (sorted by newest for stable ordering) -curl -s "https://ollama.com/library?sort=newest" -o /tmp/ollama-newest.html +# 1. Fetch the HTML to a cross-platform temp path (sorted by newest for stable ordering) +curl -s "https://ollama.com/library?sort=newest" -o "$(node -p "require('os').tmpdir()")/ollama-newest.html" -# 2. Parse it with the script -node .claude/scripts/parse-ollama-models.js > /tmp/ollama-parsed.txt 2>&1 - -# 3. Review the parsed output -cat /tmp/ollama-parsed.txt +# 2. Parse it with the script (auto-finds the file in os.tmpdir()) +node .claude/scripts/parse-ollama-models.js 2>&1 ``` The parser outputs: `modelName|pulls|capabilities|sizes` diff --git a/.claude/scripts/parse-ollama-models.js b/.claude/scripts/parse-ollama-models.js index 98c6cbe02..0baf89b34 100755 --- a/.claude/scripts/parse-ollama-models.js +++ b/.claude/scripts/parse-ollama-models.js @@ -22,8 +22,10 @@ */ const fs = require('fs'); +const os = require('os'); +const path = require('path'); -const htmlPath = process.argv[2] || '/tmp/ollama-newest.html'; +const htmlPath = process.argv[2] || path.join(os.tmpdir(), 'ollama-newest.html'); const TOP_N_ALWAYS_INCLUDE = 30; const MIN_PULLS_THRESHOLD = 50000;