setclaw 1.0.5 → 1.0.6
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 +15 -1
- package/bin/postinstall.mjs +22 -0
- package/bin/setclaw.js +33 -22
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -39,9 +39,23 @@ Connect [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and [Facto
|
|
|
39
39
|
|
|
40
40
|
### Install & Configure
|
|
41
41
|
|
|
42
|
+
Pass your API key during install — everything configures automatically in one command:
|
|
43
|
+
|
|
44
|
+
**Windows (PowerShell):**
|
|
45
|
+
```powershell
|
|
46
|
+
$env:QUATARLY_API_KEY="qua_your-key-here"; npm i -g setclaw --foreground-scripts
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**macOS / Linux:**
|
|
50
|
+
```bash
|
|
51
|
+
QUATARLY_API_KEY=qua_your-key-here npm i -g setclaw --foreground-scripts
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Or install first, then run the `setclaw` command separately:
|
|
55
|
+
|
|
42
56
|
```bash
|
|
43
57
|
npm i -g setclaw
|
|
44
|
-
setclaw
|
|
58
|
+
setclaw qua_your-key-here
|
|
45
59
|
```
|
|
46
60
|
|
|
47
61
|
That's it. When you run `setclaw`, it will:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { platform } from "os";
|
|
4
|
+
import { writeFileSync, join, homedir } from "fs";
|
|
5
|
+
|
|
6
|
+
// Always write a "pending setup" marker so setclaw can detect first run
|
|
7
|
+
import { join as pathJoin } from "path";
|
|
8
|
+
import { homedir as getHome } from "os";
|
|
9
|
+
import { writeFileSync as wf, mkdirSync } from "fs";
|
|
10
|
+
|
|
11
|
+
const markerDir = pathJoin(getHome(), ".setclaw");
|
|
12
|
+
const markerFile = pathJoin(markerDir, "pending");
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
mkdirSync(markerDir, { recursive: true });
|
|
16
|
+
wf(markerFile, "1", "utf-8");
|
|
17
|
+
} catch {}
|
|
18
|
+
|
|
19
|
+
const apiKey = process.env.QUATARLY_API_KEY;
|
|
20
|
+
if (apiKey) {
|
|
21
|
+
await import("./setclaw.js");
|
|
22
|
+
}
|
package/bin/setclaw.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* setclaw (prompts interactively)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { readFileSync, writeFileSync, copyFileSync, appendFileSync, existsSync } from "fs";
|
|
12
|
+
import { readFileSync, writeFileSync, copyFileSync, appendFileSync, existsSync, rmSync, mkdirSync } from "fs";
|
|
13
13
|
import { join } from "path";
|
|
14
14
|
import { homedir, platform } from "os";
|
|
15
15
|
import { execSync } from "child_process";
|
|
@@ -27,33 +27,41 @@ function ask(question) {
|
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
30
|
+
const out = (msg) => process.stdout.write(msg + "\n");
|
|
31
|
+
const err = (msg) => process.stderr.write(msg + "\n");
|
|
33
32
|
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
}
|
|
33
|
+
function log(msg) { err(`\x1b[36m>\x1b[0m ${msg}`); }
|
|
34
|
+
function success(msg) { err(`\x1b[32m✔\x1b[0m ${msg}`); }
|
|
35
|
+
function warn(msg) { err(`\x1b[33m!\x1b[0m ${msg}`); }
|
|
36
|
+
function fail(msg) { err(`\x1b[31m✖\x1b[0m ${msg}`); }
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
process.stderr.write(`\x1b[33m!\x1b[0m ${msg}\n`);
|
|
40
|
-
}
|
|
38
|
+
// ─── First-run detection ──────────────────────────────────────────────
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
40
|
+
const markerFile = join(homedir(), ".setclaw", "pending");
|
|
41
|
+
const isFirstRun = existsSync(markerFile);
|
|
45
42
|
|
|
46
43
|
// ─── Banner ──────────────────────────────────────────────────────────
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
out("");
|
|
46
|
+
out("\x1b[1m setclaw\x1b[0m — BOA & Quatarly setup for Claude Code & Factory");
|
|
47
|
+
out(" \x1b[2m─────────────────────────────────────────────────\x1b[0m");
|
|
48
|
+
out("");
|
|
52
49
|
|
|
53
50
|
// ─── Get API key ─────────────────────────────────────────────────────
|
|
54
51
|
|
|
55
52
|
let apiKey = process.env.QUATARLY_API_KEY || process.argv[2];
|
|
56
53
|
|
|
54
|
+
// If no key and this is first run (just installed), show clear instructions
|
|
55
|
+
if (!apiKey && isFirstRun) {
|
|
56
|
+
out(" \x1b[33m⚡ Setup required!\x1b[0m Run with your Quatarly API key:");
|
|
57
|
+
out("");
|
|
58
|
+
out(" \x1b[36msetclaw\x1b[0m \x1b[33m<your-api-key>\x1b[0m");
|
|
59
|
+
out("");
|
|
60
|
+
out(" Get your key at \x1b[4mhttps://api.quatarly.cloud\x1b[0m");
|
|
61
|
+
out("");
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
|
|
57
65
|
if (!apiKey) {
|
|
58
66
|
try {
|
|
59
67
|
apiKey = await ask(" Enter your Quatarly API key: ");
|
|
@@ -202,12 +210,15 @@ if (os === "win32") {
|
|
|
202
210
|
|
|
203
211
|
// ─── Done ────────────────────────────────────────────────────────────
|
|
204
212
|
|
|
205
|
-
|
|
206
|
-
|
|
213
|
+
// Clear the first-run marker
|
|
214
|
+
try { rmSync(markerFile); } catch {}
|
|
215
|
+
|
|
216
|
+
out("");
|
|
217
|
+
out(" \x1b[1mEnvironment variables set:\x1b[0m");
|
|
207
218
|
for (const [key, value] of Object.entries(vars)) {
|
|
208
219
|
const display = key === "ANTHROPIC_AUTH_TOKEN" ? value.slice(0, 8) + "..." : value;
|
|
209
|
-
|
|
220
|
+
out(` ${key} = ${display}`);
|
|
210
221
|
}
|
|
211
|
-
|
|
222
|
+
out("");
|
|
212
223
|
success("All done! Restart your terminal, then launch Claude Code.");
|
|
213
|
-
|
|
224
|
+
out("");
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "setclaw",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "BOA & Quatarly setup for Claude Code and Factory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"setclaw": "bin/setclaw.js"
|
|
8
8
|
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node bin/postinstall.mjs"
|
|
11
|
+
},
|
|
9
12
|
"files": [
|
|
10
|
-
"bin/setclaw.js"
|
|
13
|
+
"bin/setclaw.js",
|
|
14
|
+
"bin/postinstall.mjs"
|
|
11
15
|
],
|
|
12
16
|
"keywords": [
|
|
13
17
|
"claude",
|