clipbait 1.3.0 → 1.4.0
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 +1 -1
- package/index.js +23 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Turn any video into short viral clips — and auto-clip live streams — from yo
|
|
|
4
4
|
|
|
5
5
|
## Fastest start — one command
|
|
6
6
|
```bash
|
|
7
|
-
npx clipbait
|
|
7
|
+
npx clipbait@latest
|
|
8
8
|
```
|
|
9
9
|
It opens Clipbait so you can grab your key, then installs a **`/clipbait`** slash command and connects the Clipbait MCP server to Claude Code. Then just type in Claude:
|
|
10
10
|
```
|
package/index.js
CHANGED
|
@@ -14,6 +14,21 @@ const CFG = path.join(os.homedir(), ".clipbait.json");
|
|
|
14
14
|
const BASE = (process.env.CLIPBAIT_API_URL || "https://app.clipbait.ai/api").replace(/\/$/, "");
|
|
15
15
|
const KEY_PAGE = "https://app.clipbait.ai/me";
|
|
16
16
|
|
|
17
|
+
// Shown whenever there's no usable key. Written so an AI agent can relay it
|
|
18
|
+
// verbatim to the user and they'll know exactly what to do.
|
|
19
|
+
const NEED_KEY = [
|
|
20
|
+
"",
|
|
21
|
+
"You need your Clipbait API key (starts with cbk_live_) to continue.",
|
|
22
|
+
"",
|
|
23
|
+
' • Already have a Clipbait account? Go to https://app.clipbait.ai/me → the',
|
|
24
|
+
' "Developers / API" section and copy your key (click "Generate API key" if',
|
|
25
|
+
" you don't have one yet).",
|
|
26
|
+
" • New to Clipbait? Sign up at https://clipbait.ai, then grab your key from /me.",
|
|
27
|
+
"",
|
|
28
|
+
"Then run: npx clipbait@latest cbk_live_YOUR_KEY",
|
|
29
|
+
"",
|
|
30
|
+
].join("\n");
|
|
31
|
+
|
|
17
32
|
function loadKey() {
|
|
18
33
|
if (process.env.CLIPBAIT_API_KEY) return process.env.CLIPBAIT_API_KEY;
|
|
19
34
|
try { return JSON.parse(fs.readFileSync(CFG, "utf8")).apiKey || null; } catch { return null; }
|
|
@@ -78,18 +93,20 @@ async function runSetup(providedKey) {
|
|
|
78
93
|
let key = providedKey && providedKey.startsWith("cbk_") ? providedKey : loadKey();
|
|
79
94
|
|
|
80
95
|
if (!key) {
|
|
81
|
-
console.log("\n⚡ Let's connect Clipbait to Claude
|
|
96
|
+
console.log("\n⚡ Let's connect Clipbait to Claude.");
|
|
82
97
|
if (!process.stdin.isTTY) {
|
|
83
|
-
|
|
98
|
+
// No interactive terminal (e.g. an AI agent ran this). Print the full
|
|
99
|
+
// guidance so the agent can pass it straight to the user.
|
|
100
|
+
console.error(NEED_KEY);
|
|
84
101
|
process.exit(1);
|
|
85
102
|
}
|
|
86
|
-
console.log(
|
|
103
|
+
console.log(`\nOpening ${KEY_PAGE} so you can copy your API key…`);
|
|
87
104
|
openBrowser(KEY_PAGE);
|
|
88
105
|
key = (await prompt("\nPaste your API key (starts with cbk_) and press Enter:\n> ")).trim();
|
|
89
106
|
}
|
|
90
107
|
|
|
91
108
|
if (!key || !key.startsWith("cbk_")) {
|
|
92
|
-
console.error(
|
|
109
|
+
console.error(NEED_KEY);
|
|
93
110
|
process.exit(1);
|
|
94
111
|
}
|
|
95
112
|
|
|
@@ -117,7 +134,7 @@ async function runSetup(providedKey) {
|
|
|
117
134
|
|
|
118
135
|
const HELP = `clipbait — AI clip generation
|
|
119
136
|
|
|
120
|
-
npx clipbait
|
|
137
|
+
npx clipbait@latest set up Claude Code (recommended)
|
|
121
138
|
clipbait login <apiKey> just save your API key
|
|
122
139
|
clipbait generate <url> [--aspect 9:16] [--type talking_head] [--max 9]
|
|
123
140
|
clipbait status <jobId> check a job + get clip URLs
|
|
@@ -145,7 +162,7 @@ Auth: CLIPBAIT_API_KEY env var or ~/.clipbait.json (via 'clipbait login').`;
|
|
|
145
162
|
if (cmd === "help" || cmd === "--help" || cmd === "-h") { console.log(HELP); return; }
|
|
146
163
|
|
|
147
164
|
if (!loadKey()) {
|
|
148
|
-
console.error(
|
|
165
|
+
console.error(NEED_KEY);
|
|
149
166
|
process.exit(1);
|
|
150
167
|
}
|
|
151
168
|
const { o, rest } = parseFlags(args);
|
package/package.json
CHANGED