video-to-shorts 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 +59 -0
  2. package/cli.js +321 -0
  3. package/package.json +30 -0
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # video-to-shorts
2
+
3
+ Convert any long video into shorts for TikTok, YouTube, and Instagram. Paste a URL or upload a file — AI handles the clipping, captioning, reframing, and formatting.
4
+
5
+ Built on [reap](https://reap.video)'s video engine.
6
+
7
+ ## Before and after
8
+
9
+ **Before**: Watch full video → find moments → cut manually → add captions → reformat for each platform → export 3 times. Time: 3-5 hours.
10
+
11
+ **After**: Upload → AI finds the best moments → shorts are captioned, reframed, and formatted for every platform. Time: minutes.
12
+
13
+ ## Quick Start
14
+
15
+ \`\`\`bash
16
+ npx video-to-shorts 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 video-to-shorts mcp cursor
29
+ npx video-to-shorts mcp claude
30
+ \`\`\`
31
+
32
+ ## Supported conversions
33
+
34
+ | Input | Output formats |
35
+ |-------|---------------|
36
+ | YouTube video URL | TikTok (9:16), Shorts (9:16), Reels (9:16) |
37
+ | Podcast MP4/MOV | Vertical shorts with speaker reframing |
38
+ | Webinar recording | Highlight clips with captions |
39
+ | Interview footage | Quote-driven shorts with animated text |
40
+ | Lecture/course video | Bite-sized learning segments |
41
+
42
+ ## What's included
43
+
44
+ - [AI Clipping](https://reap.video/tools/ai-video-clipping) — Finds the best moments in your video
45
+ - [Vertical Reframing](https://reap.video/tools/ai-video-clipping) — Speaker-tracked 9:16 crop
46
+ - [Animated Captions](https://reap.video/tools/ai-captioning) — 98+ languages, 50+ styles
47
+ - [AI Dubbing](https://reap.video) — 80+ languages for global reach
48
+ - [Engagement Scoring](https://reap.video/tools/ai-video-clipping) — Know which shorts to post first
49
+ - [Social Publishing](https://reap.video) — Schedule to all platforms from one calendar
50
+ - [API](https://docs.reap.video/api-reference) — Batch convert videos programmatically
51
+ - [MCP](https://reap.video/mcp) — Convert videos from any AI agent
52
+
53
+ ## Pricing
54
+
55
+ Free to start. Paid from $10/mo. [Compare plans →](https://reap.video/pricing)
56
+
57
+ ## License
58
+
59
+ 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": "video-to-shorts",
3
+ "version": "0.1.0",
4
+ "description": "Convert long videos to shorts — AI-powered video to TikTok, Reels, and YouTube Shorts converter",
5
+ "bin": {
6
+ "video-to-shorts": "./cli.js"
7
+ },
8
+ "keywords": [
9
+ "video to shorts",
10
+ "long video to shorts",
11
+ "convert video to shorts",
12
+ "video to youtube shorts",
13
+ "video to tiktok",
14
+ "video to reels",
15
+ "video converter shorts",
16
+ "make shorts from video",
17
+ "video shorts maker",
18
+ "mcp"
19
+ ],
20
+ "author": "reap <hello@reap.video> (https://reap.video)",
21
+ "license": "MIT",
22
+ "homepage": "https://reap.video/tools/ai-video-clipping",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/reapvideo/cli"
26
+ },
27
+ "engines": {
28
+ "node": ">=16"
29
+ }
30
+ }