offgrid-ai 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.mjs +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offgrid-ai",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Privacy-first CLI for running local LLMs — discover, configure, run, benchmark",
5
5
  "author": "Eeshan Srivastava (https://eeshans.com)",
6
6
  "type": "module",
package/src/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { homedir } from "node:os";
2
- import { existsSync, statSync, rmSync, readFileSync, appendFileSync } from "node:fs";
2
+ import { existsSync, statSync, rmSync, readFileSync, appendFileSync, mkdirSync, copyFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { ensureDirs, findLlamaServer, hasHomebrew, DATA_DIR } from "./config.mjs";
5
5
  import { scanGgufModels } from "./scan.mjs";
@@ -587,9 +587,17 @@ async function onboardFlow() {
587
587
  const { execFile } = await import("node:child_process");
588
588
  const { promisify } = await import("node:util");
589
589
 
590
+ const lmsAppBundle = "/Applications/LM Studio.app/Contents/Resources/app/.webpack/lms";
591
+ const lmsBin = join(homedir(), ".lmstudio", "bin");
592
+
590
593
  const ensureLmsOnPath = () => {
591
- const lmsBin = join(homedir(), ".lmstudio", "bin");
592
- if (!existsSync(join(lmsBin, "lms"))) return;
594
+ const lmsDest = join(lmsBin, "lms");
595
+ // Bootstrap lms from app bundle if not yet in ~/.lmstudio/bin
596
+ if (!existsSync(lmsDest) && existsSync(lmsAppBundle)) {
597
+ mkdirSync(lmsBin, { recursive: true });
598
+ copyFileSync(lmsAppBundle, lmsDest);
599
+ }
600
+ if (!existsSync(lmsDest)) return;
593
601
  if (process.env.PATH.split(":").includes(lmsBin)) return;
594
602
  process.env.PATH = `${lmsBin}:${process.env.PATH}`;
595
603
  const profileFiles = [join(homedir(), ".zshrc"), join(homedir(), ".bash_profile")];