setclaw 1.1.1 → 1.2.1

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
@@ -9,7 +9,7 @@ Connect [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and [Facto
9
9
  [![npm version](https://img.shields.io/npm/v/setclaw?color=cb3837&label=npm&logo=npm&logoColor=white)](https://www.npmjs.com/package/setclaw)
10
10
  [![node](https://img.shields.io/node/v/setclaw?color=339933&logo=node.js&logoColor=white)](https://nodejs.org)
11
11
  [![license](https://img.shields.io/npm/l/setclaw?color=blue)](./LICENSE)
12
- [![platform](https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-lightgrey?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwSj0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjIiIHk9IjMiIHdpZHRoPSIyMCIgaGVpZ2h0PSIxNCIgcng9IjIiLz48bGluZSB4MT0iOCIgeTE9IjIxIiB4Mj0iMTYiIHkyPSIyMSIvPjxsaW5lIHgxPSIxMiIgeTE9IjE3IiB4Mj0iMTIiIHkyPSIyMSIvPjwvc3ZnPg==)](https://www.npmjs.com/package/setclaw)
12
+ [![platform](https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-lightgrey)](https://www.npmjs.com/package/setclaw)
13
13
 
14
14
  </div>
15
15
 
@@ -35,62 +35,34 @@ Connect [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and [Facto
35
35
  |:-:|:-----|:----|
36
36
  | 1 | **Node.js 18+** | [nodejs.org](https://nodejs.org) |
37
37
  | 2 | **Quatarly API key** | Format: `qua_trail_...` or `qua_...` |
38
- | 3 | **Factory AI** *(optional)* | See [Install Factory](#install-factory-ai-optional) below |
38
+ | 3 | **Factory AI** *(optional)* | See [Install Factory AI](#install-factory-ai-optional) below |
39
39
 
40
40
  ### Install & Configure
41
41
 
42
42
  ```bash
43
- npm i -g setclaw --foreground-scripts
44
- setclaw <your-quatarly-api-key>
45
- ```
46
-
47
- The `--foreground-scripts` flag makes npm show the setup instructions during install. Without it, npm is silent (that's npm's default behavior for lifecycle scripts).
48
-
49
- **One-liner** — pass your key during install, no second command needed:
50
-
51
- **Windows (PowerShell):**
52
- ```powershell
53
- $env:QUATARLY_API_KEY="qua_your-key-here"; npm i -g setclaw --foreground-scripts
54
- ```
55
-
56
- **macOS / Linux:**
57
- ```bash
58
- QUATARLY_API_KEY=qua_your-key-here npm i -g setclaw --foreground-scripts
43
+ npx setclaw@latest
59
44
  ```
60
45
 
61
- That's it. When you run `setclaw`, it will:
46
+ That's it. It will prompt for your API key and configure everything in one shot:
62
47
 
63
48
  ```
64
49
  setclaw — BOA & Quatarly setup for Claude Code & Factory
65
50
  ─────────────────────────────────────────────────
66
51
 
67
- > Adding models to Factory...
68
- ✔ Factory: 11 models added, 0 updated (11 total)
69
- ✔ Backup saved to ~/.factory/settings.json.backup
70
- > Setting Claude Code environment variables...
71
- ✔ Env vars written to Windows registry (HKCU\Environment).
72
-
73
- Environment variables set:
74
- ANTHROPIC_BASE_URL = https://api.quatarly.cloud/
75
- ANTHROPIC_AUTH_TOKEN = qua_trai...
76
- ANTHROPIC_DEFAULT_HAIKU_MODEL = claude-haiku-4-5-20251001
77
- ANTHROPIC_DEFAULT_SONNET_MODEL = claude-sonnet-4-6-20250929
78
- ANTHROPIC_DEFAULT_OPUS_MODEL = claude-opus-4-6-thinking
79
-
80
- ✔ All done! Restart your terminal, then launch Claude Code.
52
+ Enter your Quatarly API key: █
81
53
  ```
82
54
 
83
- You can also run without arguments to get an interactive prompt:
55
+ Or pass the key directly:
84
56
 
85
57
  ```bash
86
- setclaw
87
- # Enter your Quatarly API key: █
58
+ npx setclaw@latest <your-quatarly-api-key>
88
59
  ```
89
60
 
90
- ### Non-Interactive (CI / Scripts)
61
+ Want the `setclaw` command available globally for future use?
91
62
 
92
63
  ```bash
93
- QUATARLY_API_KEY=qua_trail_your-key setclaw
64
+ npm i -g setclaw
65
+ setclaw <your-quatarly-api-key>
94
66
  ```
95
67
 
96
68
  ---
@@ -135,13 +107,7 @@ irm https://app.factory.ai/cli/windows | iex
135
107
  curl -fsSL https://app.factory.ai/cli | sh
136
108
  ```
137
109
 
138
- Then create an account at [app.factory.ai](https://app.factory.ai), run `droid` once to generate `~/.factory/settings.json`, and re-run:
139
-
140
- ```bash
141
- npm i -g setclaw
142
- ```
143
-
144
- `setclaw` will detect the Factory config and inject all 11 models automatically.
110
+ Then create an account at [app.factory.ai](https://app.factory.ai), run `droid` once to generate `~/.factory/settings.json`, then run `setclaw` — it will detect the Factory config and inject all 11 models automatically.
145
111
 
146
112
  ---
147
113
 
@@ -186,46 +152,12 @@ npm i -g setclaw
186
152
 
187
153
  ---
188
154
 
189
- ## Manual Setup (Without setclaw)
190
-
191
- <details>
192
- <summary><b>macOS / Linux</b></summary>
193
-
194
- ```bash
195
- export ANTHROPIC_BASE_URL="https://api.quatarly.cloud/"
196
- export ANTHROPIC_AUTH_TOKEN="qua_trail_your-key-here"
197
- export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5-20251001"
198
- export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6-20250929"
199
- export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-6-thinking"
200
- ```
201
-
202
- Add these to `~/.zshrc` or `~/.bashrc` to persist.
203
-
204
- </details>
205
-
206
- <details>
207
- <summary><b>Windows (PowerShell)</b></summary>
208
-
209
- ```powershell
210
- $env:ANTHROPIC_BASE_URL = "https://api.quatarly.cloud/"
211
- $env:ANTHROPIC_AUTH_TOKEN = "qua_trail_your-key-here"
212
- $env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "claude-haiku-4-5-20251001"
213
- $env:ANTHROPIC_DEFAULT_SONNET_MODEL = "claude-sonnet-4-6-20250929"
214
- $env:ANTHROPIC_DEFAULT_OPUS_MODEL = "claude-opus-4-6-thinking"
215
- ```
216
-
217
- To persist, use `[System.Environment]::SetEnvironmentVariable("VAR", "value", "User")` for each.
218
-
219
- </details>
220
-
221
- ---
222
-
223
155
  ## FAQ
224
156
 
225
157
  <details>
226
158
  <summary><b>Can I run it again with a different API key?</b></summary>
227
159
 
228
- Yes. Just run `setclaw <new-key>` again — it updates existing models and env vars without creating duplicates. A backup of your Factory settings is saved before any changes.
160
+ Yes. Just run `npx setclaw@latest <new-key>` again — it updates existing models and env vars without creating duplicates. A backup of your Factory settings is saved before any changes.
229
161
 
230
162
  </details>
231
163
 
@@ -250,7 +182,7 @@ No. Claude Code routes through Quatarly — you only need a Quatarly API key.
250
182
  npm uninstall -g setclaw
251
183
  ```
252
184
 
253
- This removes the package. To also remove the env vars:
185
+ To also remove the env vars:
254
186
  - **Windows:** Delete from `HKCU\Environment` via System Properties > Environment Variables
255
187
  - **macOS/Linux:** Remove the `# --- Quatarly / Claude Code env ---` block from `~/.bashrc` / `~/.zshrc`
256
188
 
@@ -21,7 +21,6 @@ if (apiKey) {
21
21
  }
22
22
 
23
23
  // ─── Print next-step instructions ────────────────────────────────────
24
- // (visible when user runs: npm i -g setclaw --foreground-scripts)
25
24
  const w = (msg = "") => process.stdout.write(msg + "\n");
26
25
 
27
26
  w();
package/bin/setclaw.js CHANGED
@@ -36,9 +36,13 @@ function warn(msg) { err(`\x1b[33m!\x1b[0m ${msg}`); }
36
36
  function fail(msg) { err(`\x1b[31m✖\x1b[0m ${msg}`); }
37
37
 
38
38
  // ─── First-run detection ──────────────────────────────────────────────
39
+ // If run via npx (npm_execpath contains 'npx' or no global install marker),
40
+ // skip the first-run gate and always go interactive.
39
41
 
40
42
  const markerFile = join(homedir(), ".setclaw", "pending");
41
- const isFirstRun = existsSync(markerFile);
43
+ const isNpx = (process.env.npm_execpath || "").includes("npx") ||
44
+ process.argv[1].includes("_npx");
45
+ const isFirstRun = !isNpx && existsSync(markerFile);
42
46
 
43
47
  // ─── Banner ──────────────────────────────────────────────────────────
44
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "setclaw",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "BOA & Quatarly setup for Claude Code and Factory",
5
5
  "type": "module",
6
6
  "bin": {