offgrid-ai 0.8.5 → 0.8.7

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.
package/README.md CHANGED
@@ -29,24 +29,28 @@ offgrid-ai stop # stop a running server
29
29
 
30
30
  ## Install
31
31
 
32
- One command. Installs Node.js if you don't have it, then installs offgrid-ai.
32
+ ### Recommended: one command installer
33
+
34
+ Installs Node.js if you don't have it, then installs offgrid-ai and adds it to your PATH. Prints a welcome message so you know it worked.
33
35
 
34
36
  ```bash
35
37
  curl -fsSL https://raw.githubusercontent.com/eeshansrivastava89/offgrid-ai/main/install.sh | bash
36
38
  ```
37
39
 
38
- Or if you already have Node.js:
40
+ Or review the install script first:
39
41
 
40
42
  ```bash
41
- npm install -g offgrid-ai@latest --prefer-online
43
+ curl -fsSL https://raw.githubusercontent.com/eeshansrivastava89/offgrid-ai/main/install.sh | less
42
44
  ```
43
45
 
44
- Or review the install script first:
46
+ ### Already have Node.js?
45
47
 
46
48
  ```bash
47
- curl -fsSL https://raw.githubusercontent.com/eeshansrivastava89/offgrid-ai/main/install.sh | less
49
+ npm install -g offgrid-ai@latest --prefer-online
48
50
  ```
49
51
 
52
+ This works without extra flags, but npm hides postinstall output by default, so you won't see the welcome message. Open a new terminal window or run `source ~/.zshrc` and then `offgrid-ai`.
53
+
50
54
  ## How it works
51
55
 
52
56
  1. **Auto-detect everything.** Scans for GGUF models in LM Studio and Hugging Face cache directories, and checks managed backends like Ollama/oMLX through their local APIs. Reads model metadata (quantization, context size, vision, thinking mode) directly from GGUF files. No presets, no manual configuration.
package/install.sh CHANGED
@@ -27,6 +27,7 @@ set -euo pipefail
27
27
 
28
28
  DRY_RUN=false
29
29
  SKIP_RUN=false
30
+ DEFAULT_RC="${DEFAULT_RC:-}" # allow callers to override target rc file
30
31
 
31
32
  for arg in "$@"; do
32
33
  case "$arg" in
@@ -153,13 +154,12 @@ if [[ -n "$NPM_BIN" && -x "$NPM_BIN/offgrid-ai" ]]; then
153
154
  else
154
155
  # Not on PATH — add it
155
156
  export PATH="$NPM_BIN:$PATH"
156
- ok "Added $NPM_BIN to PATH for this session"
157
157
  ok "offgrid-ai ${INSTALLED_VERSION:+v${INSTALLED_VERSION} }installed"
158
158
 
159
159
  # Add to shell config for future sessions (pick first existing or .zshrc)
160
160
  ADDED_TO_RC=false
161
161
  # Respect user's shell preference; default to .zshrc on macOS
162
- [[ "$OSTYPE" == darwin* ]] && [[ -z "$DEFAULT_RC" ]] && DEFAULT_RC="$HOME/.zshrc"
162
+ [[ "$OSTYPE" == darwin* ]] && [[ -z "${DEFAULT_RC}" ]] && DEFAULT_RC="$HOME/.zshrc"
163
163
  RC_CANDIDATES=("${DEFAULT_RC:-}" "$HOME/.zshrc" "$HOME/.bashrc" "$HOME/.bash_profile")
164
164
  for RC_FILE in "${RC_CANDIDATES[@]}"; do
165
165
  [[ -z "$RC_FILE" ]] && continue
@@ -174,7 +174,13 @@ if [[ -n "$NPM_BIN" && -x "$NPM_BIN/offgrid-ai" ]]; then
174
174
  fi
175
175
  done
176
176
 
177
- if ! $ADDED_TO_RC; then
177
+ if $ADDED_TO_RC; then
178
+ echo ""
179
+ echo "To use it right now, run:"
180
+ echo " source ${RC_FILE}"
181
+ echo ""
182
+ echo "Or open a new terminal window/tab."
183
+ else
178
184
  warn "$NPM_BIN is already in a shell config file — restart your terminal to use offgrid-ai"
179
185
  fi
180
186
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offgrid-ai",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
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",
@@ -17,21 +17,9 @@ if (!prefix) {
17
17
  process.exit(0);
18
18
  }
19
19
 
20
- if (isHermesPrefix(prefix, process.env.HOME)) {
21
- console.log("offgrid-ai installed with a Hermes-managed npm prefix.");
22
- console.log("Not adding Hermes Node to PATH automatically. Use your normal Node/npm, or run the offgrid-ai install script.");
23
- process.exit(0);
24
- }
25
-
26
20
  const npmBin = join(prefix, "bin");
27
21
  const marker = "# Added by offgrid-ai installer";
28
22
  const pathLine = `export PATH="${npmBin}:$PATH"`;
29
- const currentPath = process.env.PATH ?? "";
30
-
31
- if (currentPath.split(":").includes(npmBin)) {
32
- console.log(`offgrid-ai is already on PATH (${npmBin})`);
33
- process.exit(0);
34
- }
35
23
 
36
24
  const home = process.env.HOME;
37
25
  if (!home) {
@@ -106,12 +94,6 @@ function currentPackageVersion() {
106
94
  }
107
95
  }
108
96
 
109
- function isHermesPrefix(prefix, home) {
110
- const normalized = prefix.replace(/\\/gu, "/");
111
- if (normalized.includes("/.hermes/")) return true;
112
- return Boolean(home && normalized === `${home.replace(/\\/gu, "/")}/.hermes/node`);
113
- }
114
-
115
97
  function isLikelyGlobalPrefix(prefix, home) {
116
98
  if (!prefix || !home) return false;
117
99
  const normalized = prefix.replace(/\\/gu, "/");