ai-captions 0.1.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 +57 -0
  2. package/cli.js +321 -0
  3. package/package.json +30 -0
package/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # ai-captions
2
+
3
+ Auto-generate accurate video captions with AI. 98+ languages, animated word-by-word styles, emoji highlights, and built-in translation — ready for TikTok, YouTube Shorts, Instagram Reels, and LinkedIn.
4
+
5
+ Built on [reap](https://reap.video)'s captioning engine.
6
+
7
+ ## The problem with manual captions
8
+
9
+ Typing captions by hand: 30-60 minutes per video. Syncing timing: another 15-30 minutes. Translating for other markets: hours. Formatting for each platform: more time.
10
+
11
+ AI captions: upload a video, get perfectly synced animated captions in seconds. In any of 98+ languages.
12
+
13
+ ## Quick Start
14
+
15
+ \`\`\`bash
16
+ npx ai-captions setup
17
+ \`\`\`
18
+
19
+ ## Add AI Agent Skills
20
+
21
+ \`\`\`bash
22
+ npx skills add https://docs.reap.video
23
+ \`\`\`
24
+
25
+ ## MCP Server
26
+
27
+ \`\`\`bash
28
+ npx ai-captions mcp cursor
29
+ npx ai-captions mcp claude
30
+ npx ai-captions mcp vscode
31
+ \`\`\`
32
+
33
+ ## What you get
34
+
35
+ - **98+ languages** — Including romanized scripts (Hinglish, Romanji, etc.)
36
+ - **50+ animated styles** — Word-by-word, highlight, karaoke, minimal, bold
37
+ - **Word-level timing** — Every word synced to the millisecond
38
+ - **Translation** — Auto-translate captions to any supported language
39
+ - **Brand templates** — Lock down fonts, colors, size, and positioning
40
+ - **Emoji support** — Contextual emoji generation
41
+ - **Export options** — Burned-in video, SRT, VTT subtitle files
42
+
43
+ ## The complete platform
44
+
45
+ AI captions is one piece of reap. You also get:
46
+
47
+ - [AI Video Clipping](https://reap.video/tools/ai-video-clipping) — Turn long videos into viral shorts
48
+ - [AI Dubbing](https://reap.video) — Natural voice dubbing in 80+ languages
49
+ - [AI Video Editor](https://reap.video/ai-video-editor) — Transcript editing, filler removal, B-roll
50
+ - [Social Scheduler](https://reap.video) — Publish everywhere from one calendar
51
+ - [REST API](https://docs.reap.video/api-reference) — Automate captioning at any scale
52
+ - [MCP Server](https://reap.video/mcp) — Caption videos from any AI agent
53
+ - [Agent Skills](https://docs.reap.video) — `npx skills add https://docs.reap.video`
54
+
55
+ ## License
56
+
57
+ MIT © [reap](https://reap.video)
package/cli.js ADDED
@@ -0,0 +1,321 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync, spawn } = require("child_process");
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+
7
+ const MCP_URL = "https://docs.reap.video/mcp";
8
+ const APP_URL = "https://reap.video";
9
+ const DOCS_URL = "https://docs.reap.video";
10
+ const API_URL = "https://docs.reap.video/api-reference";
11
+ const SKILLS_SOURCE = "https://docs.reap.video";
12
+
13
+ const args = process.argv.slice(2);
14
+ const command = args[0] || "";
15
+ const PKG = path.basename(process.argv[1]) || "reap-ai";
16
+
17
+ if (command === "mcp") {
18
+ handleMcp(args.slice(1));
19
+ } else if (command === "setup") {
20
+ handleSetup();
21
+ } else if (command === "help" || command === "--help" || command === "-h") {
22
+ printHelp();
23
+ } else if (command === "") {
24
+ handleDefault();
25
+ } else {
26
+ printHelp();
27
+ }
28
+
29
+ function handleDefault() {
30
+ console.log(`
31
+ \x1b[1m\x1b[36m🎬 reap — AI Video Clipping & Repurposing\x1b[0m
32
+
33
+ Turn long videos into viral shorts, captions, and social posts.
34
+ Powered by reap.video — 16,000+ creators, 396,000+ clips generated.
35
+
36
+ \x1b[1mInstall agent skills:\x1b[0m
37
+ \x1b[33mnpx skills add ${SKILLS_SOURCE}\x1b[0m
38
+
39
+ \x1b[1mSet up MCP server:\x1b[0m
40
+ \x1b[2mnpx ${PKG} mcp cursor\x1b[0m Cursor IDE
41
+ \x1b[2mnpx ${PKG} mcp claude\x1b[0m Claude Desktop
42
+ \x1b[2mnpx ${PKG} mcp vscode\x1b[0m VS Code
43
+
44
+ \x1b[1mOr install MCP directly:\x1b[0m
45
+ \x1b[33mnpx add-mcp ${MCP_URL}\x1b[0m
46
+
47
+ \x1b[1mLinks:\x1b[0m
48
+ App ${APP_URL}
49
+ Docs ${DOCS_URL}
50
+ API ${API_URL}
51
+ MCP ${MCP_URL}
52
+
53
+ \x1b[2mRun npx ${PKG} help for all commands.\x1b[0m
54
+ `);
55
+
56
+ promptSkillsInstall();
57
+ }
58
+
59
+ function promptSkillsInstall() {
60
+ if (!process.stdin.isTTY) return;
61
+
62
+ process.stdout.write(
63
+ "\x1b[1mInstall reap skills into your AI agent? (Y/n): \x1b[0m"
64
+ );
65
+
66
+ process.stdin.setRawMode(true);
67
+ process.stdin.resume();
68
+ process.stdin.setEncoding("utf8");
69
+
70
+ process.stdin.once("data", (key) => {
71
+ process.stdin.setRawMode(false);
72
+ process.stdin.pause();
73
+
74
+ const answer = key.trim().toLowerCase();
75
+ console.log(answer || "y");
76
+
77
+ if (answer === "" || answer === "y" || answer === "yes") {
78
+ console.log(
79
+ `\n\x1b[36mRunning: npx skills add ${SKILLS_SOURCE}\x1b[0m\n`
80
+ );
81
+ try {
82
+ const child = spawn("npx", ["skills", "add", SKILLS_SOURCE], {
83
+ stdio: "inherit",
84
+ shell: true,
85
+ });
86
+ child.on("close", (code) => {
87
+ if (code === 0) {
88
+ console.log(
89
+ "\n\x1b[32m✓ reap skills installed successfully.\x1b[0m"
90
+ );
91
+ }
92
+ process.exit(code || 0);
93
+ });
94
+ child.on("error", () => {
95
+ console.log(
96
+ `\n\x1b[33mCouldn't run skills CLI. Install manually:\x1b[0m`
97
+ );
98
+ console.log(` npx skills add ${SKILLS_SOURCE}\n`);
99
+ process.exit(0);
100
+ });
101
+ } catch {
102
+ console.log(
103
+ `\n\x1b[33mCouldn't run skills CLI. Install manually:\x1b[0m`
104
+ );
105
+ console.log(` npx skills add ${SKILLS_SOURCE}\n`);
106
+ process.exit(0);
107
+ }
108
+ } else {
109
+ console.log(
110
+ `\n\x1b[2mSkipped. Run later with: npx skills add ${SKILLS_SOURCE}\x1b[0m\n`
111
+ );
112
+ process.exit(0);
113
+ }
114
+ });
115
+ }
116
+
117
+ function handleSetup() {
118
+ console.log(`
119
+ \x1b[1m\x1b[36m🎬 reap — Quick Start\x1b[0m
120
+
121
+ \x1b[1m1.\x1b[0m Sign up at \x1b[36m${APP_URL}\x1b[0m
122
+ \x1b[1m2.\x1b[0m Upload a video or paste a YouTube URL
123
+ \x1b[1m3.\x1b[0m Get AI-generated clips, captions, and social posts
124
+
125
+ \x1b[1mFor AI agents:\x1b[0m
126
+ Install skills: \x1b[33mnpx skills add ${SKILLS_SOURCE}\x1b[0m
127
+ Add MCP server: \x1b[33mnpx add-mcp ${MCP_URL}\x1b[0m
128
+
129
+ \x1b[1mFor developers:\x1b[0m
130
+ API docs: ${API_URL}
131
+ Get API key: ${APP_URL} → Profile → Settings → API Keys
132
+ `);
133
+
134
+ openBrowser(APP_URL);
135
+ }
136
+
137
+ function handleMcp(args) {
138
+ const client = (args[0] || "").toLowerCase();
139
+
140
+ const configs = {
141
+ claude: {
142
+ label: "Claude Desktop",
143
+ file: "claude_desktop_config.json",
144
+ config: JSON.stringify(
145
+ { mcpServers: { reap: { url: MCP_URL } } },
146
+ null,
147
+ 2
148
+ ),
149
+ },
150
+ "claude-code": {
151
+ label: "Claude Code",
152
+ file: "Terminal",
153
+ config: `claude mcp add reap ${MCP_URL}`,
154
+ isCommand: true,
155
+ },
156
+ cursor: {
157
+ label: "Cursor",
158
+ file: ".cursor/mcp.json",
159
+ config: JSON.stringify(
160
+ { mcpServers: { reap: { url: MCP_URL } } },
161
+ null,
162
+ 2
163
+ ),
164
+ writePath: ".cursor/mcp.json",
165
+ },
166
+ vscode: {
167
+ label: "VS Code",
168
+ file: ".vscode/mcp.json",
169
+ config: JSON.stringify(
170
+ { mcpServers: { reap: { url: MCP_URL } } },
171
+ null,
172
+ 2
173
+ ),
174
+ writePath: ".vscode/mcp.json",
175
+ },
176
+ windsurf: {
177
+ label: "Windsurf",
178
+ file: "~/.windsurf/mcp.json",
179
+ config: JSON.stringify(
180
+ { mcpServers: { reap: { url: MCP_URL } } },
181
+ null,
182
+ 2
183
+ ),
184
+ },
185
+ };
186
+
187
+ if (!client || !configs[client]) {
188
+ console.log(`
189
+ \x1b[1m🔌 reap MCP Server\x1b[0m
190
+
191
+ Choose your AI client:
192
+
193
+ \x1b[2mnpx ${PKG} mcp cursor\x1b[0m Cursor
194
+ \x1b[2mnpx ${PKG} mcp claude\x1b[0m Claude Desktop
195
+ \x1b[2mnpx ${PKG} mcp claude-code\x1b[0m Claude Code (CLI)
196
+ \x1b[2mnpx ${PKG} mcp vscode\x1b[0m VS Code
197
+ \x1b[2mnpx ${PKG} mcp windsurf\x1b[0m Windsurf
198
+
199
+ Or use the universal installer:
200
+ \x1b[33mnpx add-mcp ${MCP_URL}\x1b[0m
201
+
202
+ Also install agent skills:
203
+ \x1b[33mnpx skills add ${SKILLS_SOURCE}\x1b[0m
204
+ `);
205
+ return;
206
+ }
207
+
208
+ const { label, file, config, isCommand, writePath } = configs[client];
209
+
210
+ if (writePath && !isCommand) {
211
+ tryWriteConfig(writePath, config, label);
212
+ } else {
213
+ console.log(`
214
+ \x1b[1m🔌 reap MCP — ${label}\x1b[0m
215
+
216
+ \x1b[2mFile: ${file}\x1b[0m
217
+
218
+ \x1b[36m${config}\x1b[0m
219
+
220
+ ${isCommand ? "Run the command above in your terminal." : `Add the config above to \x1b[1m${file}\x1b[0m and restart ${label}.`}
221
+
222
+ \x1b[2mAlso install agent skills: npx skills add ${SKILLS_SOURCE}\x1b[0m
223
+ `);
224
+ }
225
+ }
226
+
227
+ function tryWriteConfig(relPath, configJson, label) {
228
+ const fullPath = path.resolve(process.cwd(), relPath);
229
+ const dir = path.dirname(fullPath);
230
+
231
+ try {
232
+ let existing = {};
233
+ if (fs.existsSync(fullPath)) {
234
+ try {
235
+ existing = JSON.parse(fs.readFileSync(fullPath, "utf8"));
236
+ } catch {}
237
+ }
238
+
239
+ const incoming = JSON.parse(configJson);
240
+
241
+ if (existing.mcpServers && existing.mcpServers.reap) {
242
+ console.log(`
243
+ \x1b[32m✓ reap MCP already configured in ${relPath}\x1b[0m
244
+
245
+ \x1b[2mRestart ${label} to pick up any changes.\x1b[0m
246
+ \x1b[2mAlso install agent skills: npx skills add ${SKILLS_SOURCE}\x1b[0m
247
+ `);
248
+ return;
249
+ }
250
+
251
+ const merged = {
252
+ ...existing,
253
+ mcpServers: {
254
+ ...(existing.mcpServers || {}),
255
+ ...incoming.mcpServers,
256
+ },
257
+ };
258
+
259
+ fs.mkdirSync(dir, { recursive: true });
260
+ fs.writeFileSync(fullPath, JSON.stringify(merged, null, 2) + "\n");
261
+
262
+ console.log(`
263
+ \x1b[32m✓ reap MCP server added to ${relPath}\x1b[0m
264
+
265
+ Restart ${label} to connect.
266
+
267
+ \x1b[2mAlso install agent skills: npx skills add ${SKILLS_SOURCE}\x1b[0m
268
+ `);
269
+ } catch (err) {
270
+ console.log(`
271
+ \x1b[1m🔌 reap MCP — ${label}\x1b[0m
272
+
273
+ \x1b[33mCouldn't write to ${relPath} automatically.\x1b[0m
274
+ Add this to \x1b[1m${relPath}\x1b[0m manually:
275
+
276
+ \x1b[36m${configJson}\x1b[0m
277
+
278
+ \x1b[2mAlso install agent skills: npx skills add ${SKILLS_SOURCE}\x1b[0m
279
+ `);
280
+ }
281
+ }
282
+
283
+ function printHelp() {
284
+ console.log(`
285
+ \x1b[1m\x1b[36m🎬 reap — AI Video Clipping & Repurposing\x1b[0m
286
+
287
+ \x1b[1mUsage:\x1b[0m
288
+ npx ${PKG} [command]
289
+
290
+ \x1b[1mCommands:\x1b[0m
291
+ (no command) Install agent skills interactively
292
+ mcp [client] Set up MCP server for your AI client
293
+ setup Quick start guide (opens reap.video)
294
+ help Show this message
295
+
296
+ \x1b[1mExamples:\x1b[0m
297
+ npx ${PKG} Install reap skills
298
+ npx ${PKG} mcp cursor Add MCP to Cursor
299
+ npx ${PKG} mcp claude Add MCP to Claude Desktop
300
+ npx ${PKG} setup Open reap.video
301
+
302
+ \x1b[1mDirect installers:\x1b[0m
303
+ npx skills add ${SKILLS_SOURCE}
304
+ npx add-mcp ${MCP_URL}
305
+
306
+ \x1b[1mLinks:\x1b[0m
307
+ App ${APP_URL}
308
+ Docs ${DOCS_URL}
309
+ API ${API_URL}
310
+ MCP ${MCP_URL}
311
+ `);
312
+ }
313
+
314
+ function openBrowser(url) {
315
+ try {
316
+ const plat = process.platform;
317
+ if (plat === "darwin") execSync(`open ${url}`);
318
+ else if (plat === "win32") execSync(`start ${url}`);
319
+ else execSync(`xdg-open ${url}`);
320
+ } catch {}
321
+ }
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "ai-captions",
3
+ "version": "0.1.0",
4
+ "description": "Auto-generate video captions with AI — 98+ languages, animated styles, word-level sync, and subtitle translation",
5
+ "bin": {
6
+ "ai-captions": "./cli.js"
7
+ },
8
+ "keywords": [
9
+ "ai captions",
10
+ "ai caption",
11
+ "auto caption video",
12
+ "ai subtitles",
13
+ "generate captions ai",
14
+ "video captions automatic",
15
+ "ai closed captions",
16
+ "caption video ai",
17
+ "subtitle generator ai",
18
+ "mcp"
19
+ ],
20
+ "author": "reap <hello@reap.video> (https://reap.video)",
21
+ "license": "MIT",
22
+ "homepage": "https://reap.video/tools/ai-captioning",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/reapvideo/cli"
26
+ },
27
+ "engines": {
28
+ "node": ">=16"
29
+ }
30
+ }