lupacode 1.0.1 → 1.0.3

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
@@ -2,30 +2,58 @@
2
2
 
3
3
  AI-powered terminal coding assistant.
4
4
 
5
- ## Install
5
+ ## Install globally
6
+
7
+ Requires [Bun](https://bun.sh) >= 1.0.
6
8
 
7
9
  ```bash
8
- npm install -g lupacode
9
- # or
10
+ # Remove any old global install first (important on Windows)
11
+ npm uninstall -g lupacode
12
+
13
+ # Install latest
10
14
  bun install -g lupacode
15
+ # or
16
+ npm install -g lupacode
11
17
  ```
12
18
 
13
- ## Quick start
19
+ Then run from **any directory**:
14
20
 
15
21
  ```bash
16
22
  lupacode
17
23
  ```
18
24
 
25
+ Verify the version in the footer (e.g. `v1.0.2`).
26
+
19
27
  ## Configuration
20
28
 
21
- | Env var | Default | Required | Description |
22
- |---|---|---|---|
23
- | `API_URL` | `https://lupacodeserver-production.up.railway.app` | No | LupaCode API server |
29
+ Global config lives in `~/.lupacode/` (same on every machine/user):
30
+
31
+ | File | Purpose |
32
+ |---|---|
33
+ | `~/.lupacode/.env` | Optional env overrides (see below) |
34
+ | `~/.lupacode/auth.json` | Saved login token (created by `/login`) |
35
+ | `~/.lupacode/preferences.json` | Theme, model, mode preferences |
24
36
 
25
- ### Setting up authentication
37
+ | Env var | Default | Description |
38
+ |---|---|---|
39
+ | `API_URL` | `https://lupacodeserver-production.up.railway.app` | LupaCode API server |
26
40
 
27
- Type `/login` in the CLI it opens your browser for Clerk OAuth. No manual configuration needed.
41
+ Example `~/.lupacode/.env` (only if you need a custom server):
28
42
 
29
- ## Requirements
43
+ ```env
44
+ API_URL=https://lupacodeserver-production.up.railway.app
45
+ ```
46
+
47
+ The CLI does **not** read `.env` from your current project folder, so running `lupacode` in a repo with `API_URL=http://localhost:3000` will not break the global install.
48
+
49
+ ### Authentication
50
+
51
+ Type `/login` in the CLI — it opens your browser for Clerk OAuth.
52
+
53
+ ## Local development (monorepo)
54
+
55
+ ```bash
56
+ bun run dev:cli
57
+ ```
30
58
 
31
- - [Bun](https://bun.sh) >= 1.0
59
+ Dev mode uses Bun's normal `.env` loading from the repo root for local server testing.
package/bin/lupacode CHANGED
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env bun
2
2
  import dotenv from "dotenv";
3
+ import { homedir } from "node:os";
4
+ import { join } from "node:path";
3
5
 
4
- dotenv.config({ quiet: true });
6
+ // Load user config only never cwd .env, so `lupacode` works the same in every directory.
7
+ dotenv.config({ path: join(homedir(), ".lupacode", ".env"), quiet: true });
5
8
 
6
9
  // @ts-expect-error - dist/index.js is a Bun bundle with no exports
7
10
  await import("../dist/index.js");
package/dist/index.js CHANGED
@@ -94607,6 +94607,12 @@ function clearAuth() {
94607
94607
  } catch {}
94608
94608
  }
94609
94609
 
94610
+ // src/lib/env.ts
94611
+ var DEFAULT_API_URL = "https://lupacodeserver-production.up.railway.app";
94612
+ function getApiUrl() {
94613
+ return process.env.API_URL ?? DEFAULT_API_URL;
94614
+ }
94615
+
94610
94616
  // src/lib/api-client.ts
94611
94617
  var RETRY_ATTEMPTS = 3;
94612
94618
  var RETRY_BASE_DELAY_MS = 1000;
@@ -94629,7 +94635,7 @@ async function withRetry(fn, options) {
94629
94635
  }
94630
94636
  throw lastError;
94631
94637
  }
94632
- var apiClient = hc(process.env.API_URL ?? "https://lupacodeserver-production.up.railway.app", {
94638
+ var apiClient = hc(getApiUrl(), {
94633
94639
  fetch: async (input, init) => {
94634
94640
  const headers = new Headers(init?.headers);
94635
94641
  const auth = getAuth();
@@ -96416,7 +96422,7 @@ var import_react35 = __toESM(require_react(), 1);
96416
96422
  // package.json
96417
96423
  var package_default2 = {
96418
96424
  name: "lupacode",
96419
- version: "1.0.1",
96425
+ version: "1.0.3",
96420
96426
  description: "AI-powered terminal coding assistant",
96421
96427
  type: "module",
96422
96428
  bin: {
@@ -97334,9 +97340,6 @@ var open_default = open;
97334
97340
  // src/lib/oauth.ts
97335
97341
  var LOGIN_TIMEOUT_MS = 5 * 60 * 1000;
97336
97342
  var POLL_INTERVAL_MS = 1000;
97337
- function getApiUrl() {
97338
- return process.env.API_URL ?? "https://lupacodeserver-production.up.railway.app";
97339
- }
97340
97343
  async function performLogin() {
97341
97344
  const apiUrl = getApiUrl();
97342
97345
  const initRes = await fetch(`${apiUrl}/auth/init`, { method: "POST" });
@@ -97567,7 +97570,7 @@ var COMMANDS = [
97567
97570
  const name23 = text2.trim();
97568
97571
  if (!name23)
97569
97572
  return;
97570
- const baseUrl = process.env.API_URL ?? "https://lupacodeserver-production.up.railway.app";
97573
+ const baseUrl = getApiUrl();
97571
97574
  const token = getAuth()?.token ?? "";
97572
97575
  fetch(`${baseUrl}/sessions/${ctx.sessionId}`, {
97573
97576
  method: "PATCH",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupacode",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "AI-powered terminal coding assistant",
5
5
  "type": "module",
6
6
  "bin": {