clipbait 1.6.0 → 1.7.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.
Files changed (3) hide show
  1. package/README.md +69 -27
  2. package/index.js +32 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,38 +1,34 @@
1
1
  # clipbait
2
2
 
3
- Turn any video into short viral clipsand auto-clip live streams from your terminal or an AI agent. Wraps the [Clipbait](https://clipbait.ai) API.
3
+ Official CLI + MCP server for [Clipbait](https://clipbait.ai)the AI video clipping tool for streamers and clippers.
4
+
5
+ Let Claude (or any MCP-capable agent) turn long videos into viral vertical clips, check your credits, auto-clip live Twitch streams, and download finished clips to disk — on your Clipbait account. Also works as a plain terminal CLI.
6
+
7
+ ## Requires
8
+
9
+ - **Node.js 18 or higher.**
10
+ - **A paid Clipbait account.** Generate a key at [app.clipbait.ai/me](https://app.clipbait.ai/me) → **Developers / API**. Keys are prefixed `cbk_live_`.
11
+
12
+ ## Install
13
+
14
+ ### Fastest — one command (auto-configures Claude Code + Claude Desktop)
4
15
 
5
- ## Fastest start — one command
6
16
  ```bash
7
17
  npx clipbait@latest
8
18
  ```
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
- ```
11
- /clipbait https://youtube.com/watch?v=...
12
- ```
13
19
 
14
- ## Or use it straight from the terminal
20
+ Opens Clipbait so you can copy your key, then installs a `/clipbait` slash command and wires the MCP server into Claude Code and Claude Desktop for you — no JSON to hand-write. Pass the key inline to skip the prompt: `npx clipbait@latest cbk_live_yourkey`. Restart Claude, then type `/clipbait <video url>`.
21
+
22
+ ### Claude Code
23
+
15
24
  ```bash
16
- npx clipbait login <your_api_key> # get it at clipbait.ai → Me → Developers / API
17
- npx clipbait generate "https://youtube.com/watch?v=..." --aspect 9:16 --max 9
18
- npx clipbait status <jobId> # get finished clip URLs
25
+ claude mcp add --transport http clipbait https://app.clipbait.ai/api/mcp/cbk_live_your_key_here
19
26
  ```
20
27
 
21
- ## Commands
22
- | Command | Description |
23
- |---|---|
24
- | `clipbait` | One-command Claude Code setup (`/clipbait` + MCP) |
25
- | `clipbait login <apiKey>` | Save your API key (`~/.clipbait.json`) |
26
- | `clipbait generate <url> [--aspect 9:16] [--type talking_head] [--max 9]` | Generate clips |
27
- | `clipbait status <jobId>` | Check a job + get clip URLs |
28
- | `clipbait jobs` | List recent jobs |
29
- | `clipbait live <twitchUrl> [--cadence 7]` | Start live auto-clipping (Pro) |
30
- | `clipbait probe <url>` | Get a video's duration |
31
-
32
- Auth via `CLIPBAIT_API_KEY` env var or `~/.clipbait.json`. Requires Node 18+.
33
-
34
- ## MCP server (Claude Desktop, Cursor, Cline, Windsurf)
35
- This package is also an MCP server. `npx clipbait@latest` auto-configures **Claude Code**. For other clients, add this to their MCP config:
28
+ ### Cursor / Cline / Windsurf / manual
29
+
30
+ Drop this into the client's MCP config file (runs the local stdio server):
31
+
36
32
  ```json
37
33
  {
38
34
  "mcpServers": {
@@ -44,6 +40,52 @@ This package is also an MCP server. `npx clipbait@latest` auto-configures **Clau
44
40
  }
45
41
  }
46
42
  ```
47
- Tools: `generate_clips`, `get_job`, `list_recent_clips`, `get_credits`, `start_live_autoclip`, `probe_video`, and **`download_clip`** (saves a finished clip to your `~/Downloads`).
48
43
 
49
- Using **ChatGPT / claude.ai** (URL connectors, no local process)? Point them at the hosted MCP instead: `https://app.clipbait.ai/api/mcp/<your_api_key>`.
44
+ > **ChatGPT / claude.ai** take a remote URL instead of a local process point them at `https://app.clipbait.ai/api/mcp/<your_api_key>` (nothing runs on your machine, nothing to update).
45
+
46
+ ## Tools
47
+
48
+ Seven tools are available to any agent:
49
+
50
+ | Tool | What it does |
51
+ |---|---|
52
+ | `generate_clips` | Start a clipping job (`videoUrl`, optional `aspectRatio` 9:16\|16:9, `maxClips` 1–20). Returns a job id. |
53
+ | `get_job` | Check a job's status and get finished clip URLs (`jobId`). |
54
+ | `list_recent_clips` | List your recent jobs and clip counts. |
55
+ | `get_credits` | Show credits remaining and your plan. No inputs. |
56
+ | `start_live_autoclip` | Auto-clip a **live** Twitch stream continuously (`channelUrl`, optional `cadenceMin`). Pro plan. |
57
+ | `probe_video` | Get a video's duration before clipping (`url`). |
58
+ | `download_clip` | Save a finished clip to your `~/Downloads/` folder and return the path (`jobId`, `clipIndex` 1-based). Max 500 MB. |
59
+
60
+ ## Terminal usage
61
+
62
+ ```bash
63
+ npx clipbait login cbk_live_your_key
64
+ npx clipbait generate "https://youtube.com/watch?v=..." --aspect 9:16 --max 9
65
+ npx clipbait status <jobId> # get finished clip URLs
66
+ npx clipbait jobs # list recent jobs
67
+ npx clipbait live "https://twitch.tv/somestreamer"
68
+ npx clipbait mcp # run the stdio MCP server (used in configs above)
69
+ ```
70
+
71
+ Auth via the `CLIPBAIT_API_KEY` env var or `~/.clipbait.json`.
72
+
73
+ ## Security
74
+
75
+ - **Never commit your `CLIPBAIT_API_KEY`.** Your agent's config file contains a secret — add it to `.gitignore`, or use a secrets manager (1Password CLI, direnv) instead of inline env vars.
76
+ - If you leak your key, rotate it at [app.clipbait.ai/me](https://app.clipbait.ai/me) immediately — the old key stops working at once.
77
+ - `download_clip` links are presigned and expire in ~1 hour. Save clips promptly.
78
+
79
+ ## Pricing
80
+
81
+ Requires a **paid Clipbait account**. Clip generation spends credits (1 credit ≈ 1 minute of source video). See [clipbait.ai](https://clipbait.ai).
82
+
83
+ ## Links
84
+
85
+ - Clipbait: https://clipbait.ai
86
+ - API docs: https://app.clipbait.ai/docs
87
+ - Get an API key: https://app.clipbait.ai/me
88
+
89
+ ## License
90
+
91
+ MIT
package/index.js CHANGED
@@ -114,9 +114,35 @@ Do this, conversationally and fast:
114
114
  5. Then offer follow-ups and act on them by calling the tools again: regenerate at a different aspect ratio, pull more clips, or probe another video with \`probe_video\`.
115
115
  `;
116
116
 
117
+ // Claude Desktop config path per-OS.
118
+ function desktopConfigPath() {
119
+ const home = os.homedir();
120
+ if (process.platform === "darwin") return path.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
121
+ if (process.platform === "win32") return path.join(process.env.APPDATA || path.join(home, "AppData", "Roaming"), "Claude", "claude_desktop_config.json");
122
+ return path.join(home, ".config", "Claude", "claude_desktop_config.json");
123
+ }
124
+
125
+ // Configure Claude Desktop (stdio) if it's installed. Desktop can't use the
126
+ // remote http MCP, and the local stdio server is what enables download_clip.
127
+ // Returns false (silently) when Claude Desktop isn't present.
128
+ function writeDesktopConfig(key) {
129
+ const cfgPath = desktopConfigPath();
130
+ try {
131
+ if (!fs.existsSync(path.dirname(cfgPath))) return false; // Desktop not installed
132
+ let cfg = {};
133
+ try { cfg = JSON.parse(fs.readFileSync(cfgPath, "utf8")); } catch { /* new file */ }
134
+ cfg.mcpServers = cfg.mcpServers || {};
135
+ cfg.mcpServers.clipbait = { command: "npx", args: ["-y", "clipbait@latest", "mcp"], env: { CLIPBAIT_API_KEY: key } };
136
+ const tmp = cfgPath + ".clipbait.tmp";
137
+ fs.writeFileSync(tmp, JSON.stringify(cfg, null, 2));
138
+ fs.renameSync(tmp, cfgPath);
139
+ return true;
140
+ } catch { return false; }
141
+ }
142
+
117
143
  // Interactive one-command setup. Grabs the key (from arg / saved / by opening
118
144
  // the browser and prompting), installs the /clipbait command, and connects the
119
- // MCP server to Claude Code.
145
+ // MCP server to Claude Code and Claude Desktop.
120
146
  async function runSetup(providedKey) {
121
147
  let key = providedKey && providedKey.startsWith("cbk_") ? providedKey : loadKey();
122
148
 
@@ -163,6 +189,11 @@ async function runSetup(providedKey) {
163
189
  }
164
190
  }
165
191
 
192
+ // 3) Also configure Claude Desktop if installed (stdio server → download_clip).
193
+ if (writeDesktopConfig(key)) {
194
+ console.log("✓ Connected Clipbait to Claude Desktop (quit + reopen it to load)");
195
+ }
196
+
166
197
  console.log("\n🎬 Done! Restart Claude Code, then type:\n /clipbait https://youtube.com/watch?v=…\n");
167
198
  }
168
199
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clipbait",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Clipbait CLI + MCP server — turn any video into viral clips, and auto-clip live streams, from your terminal or any AI agent.",
5
5
  "bin": { "clipbait": "index.js" },
6
6
  "type": "commonjs",