clip-anything 0.0.0-stage → 0.5.1
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/LICENSE +21 -0
- package/README.md +21 -2
- package/bin/clip-anything.js +108 -0
- package/package.json +40 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ship at Midnight
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# clip-anything (npm launcher)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A thin launcher for the [Clip Anything](https://github.com/shreyassaw5394/clip-anything) Python CLI: long gameplay recording in, the top N vertical (9:16) highlight clips out, with a `report.json` that says why each moment was picked. Free, local, open source. Nothing is uploaded.
|
|
4
|
+
|
|
5
|
+
This package contains no video code. Its only job is to find `uvx` (from [uv](https://docs.astral.sh/uv/)) or `pipx` on your PATH and run `uvx clip-anything <your arguments>`. If neither is installed it prints the install lines and exits.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npx clip-anything gameplay.mp4
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Needs:
|
|
12
|
+
|
|
13
|
+
- `uv` (`curl -LsSf https://astral.sh/uv/install.sh | sh`, or `winget install astral-sh.uv`) or `pipx`
|
|
14
|
+
- `ffmpeg` and `ffprobe` on PATH (`brew install ffmpeg`, `sudo apt install ffmpeg`, `winget install Gyan.FFmpeg`)
|
|
15
|
+
- Python 3.11+ (uv fetches one if needed)
|
|
16
|
+
|
|
17
|
+
All options, exit codes, the config file and the full documentation live in the main README. If you already have uv, `uvx clip-anything gameplay.mp4` is the same thing with one hop fewer.
|
|
18
|
+
|
|
19
|
+
Privacy: nothing leaves your computer unless you turn on captions (one-time model download, asks first), a local Ollama model, or cloud AI with your own OpenAI/Anthropic key; no account, no telemetry ([docs/privacy.md](https://github.com/shreyassaw5394/clip-anything/blob/main/docs/privacy.md)).
|
|
20
|
+
A free, non-commercial passion project, provided as is without warranty; clip picks, captions and AI titles can be wrong and you are responsible for the rights to what you process and post ([docs/terms.md](https://github.com/shreyassaw5394/clip-anything/blob/main/docs/terms.md)).
|
|
21
|
+
|
|
22
|
+
Zero dependencies. MIT. Game names appear only to describe what a recording contains; Clip Anything is not affiliated with or endorsed by any game publisher.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// Thin launcher for the clip-anything Python CLI. No dependencies.
|
|
4
|
+
// Order: uvx (uv) -> pipx run -> an installed `clip-anything` on PATH.
|
|
5
|
+
// Spawns with an argument array and no shell, so paths with spaces and
|
|
6
|
+
// Windows both work. Everything else is the Python tool's job.
|
|
7
|
+
|
|
8
|
+
const { spawnSync } = require("node:child_process");
|
|
9
|
+
const fs = require("node:fs");
|
|
10
|
+
const path = require("node:path");
|
|
11
|
+
|
|
12
|
+
const PKG = "clip-anything";
|
|
13
|
+
// Until the PyPI release is live, uvx/pipx pull the tool from the tagged source. Set
|
|
14
|
+
// CLIP_ANYTHING_SOURCE to override (a PyPI spec like "clip-anything==0.6.0", or a git URL).
|
|
15
|
+
const SOURCE =
|
|
16
|
+
process.env.CLIP_ANYTHING_SOURCE ||
|
|
17
|
+
"git+https://github.com/shreyassaw5394/clip-anything@v0.5.1";
|
|
18
|
+
const IS_WIN = process.platform === "win32";
|
|
19
|
+
|
|
20
|
+
function which(cmd) {
|
|
21
|
+
const dirs = (process.env.PATH || "").split(path.delimiter).filter(Boolean);
|
|
22
|
+
const exts = IS_WIN
|
|
23
|
+
? (process.env.PATHEXT || ".EXE;.CMD;.BAT").split(";").filter(Boolean)
|
|
24
|
+
: [""];
|
|
25
|
+
for (const dir of dirs) {
|
|
26
|
+
for (const ext of exts) {
|
|
27
|
+
const candidate = path.join(dir, cmd + ext);
|
|
28
|
+
try {
|
|
29
|
+
fs.accessSync(candidate, fs.constants.X_OK);
|
|
30
|
+
if (fs.statSync(candidate).isFile()) return candidate;
|
|
31
|
+
} catch {
|
|
32
|
+
/* keep looking */
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function run(file, args) {
|
|
40
|
+
// On Windows a .cmd/.bat shim cannot be spawned without a shell, so only
|
|
41
|
+
// real executables are used here; uv, pipx and the pip console script are.
|
|
42
|
+
const result = spawnSync(file, args, { stdio: "inherit", windowsHide: true });
|
|
43
|
+
if (result.error) {
|
|
44
|
+
process.stderr.write(`clip-anything: could not start ${file}: ${result.error.message}\n`);
|
|
45
|
+
return 127;
|
|
46
|
+
}
|
|
47
|
+
if (result.signal) {
|
|
48
|
+
process.kill(process.pid, result.signal);
|
|
49
|
+
return 128;
|
|
50
|
+
}
|
|
51
|
+
return result.status == null ? 1 : result.status;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function uvHint() {
|
|
55
|
+
return IS_WIN
|
|
56
|
+
? ' winget install astral-sh.uv (or: powershell -c "irm https://astral.sh/uv/install.ps1 | iex")'
|
|
57
|
+
: " curl -LsSf https://astral.sh/uv/install.sh | sh (or: brew install uv)";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function ffmpegHint() {
|
|
61
|
+
if (process.platform === "darwin") return " brew install ffmpeg";
|
|
62
|
+
if (IS_WIN) return " winget install Gyan.FFmpeg";
|
|
63
|
+
return " sudo apt install ffmpeg (or your distro's package)";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function main(argv) {
|
|
67
|
+
if (!which("ffmpeg") || !which("ffprobe")) {
|
|
68
|
+
process.stderr.write(
|
|
69
|
+
"clip-anything: ffmpeg/ffprobe not found on PATH. The tool needs both. Install:\n" +
|
|
70
|
+
ffmpegHint() +
|
|
71
|
+
"\n\n"
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const uvx = which("uvx");
|
|
76
|
+
if (uvx) return run(uvx, ["--from", SOURCE, PKG, ...argv]);
|
|
77
|
+
|
|
78
|
+
const pipx = which("pipx");
|
|
79
|
+
if (pipx) return run(pipx, ["run", "--spec", SOURCE, PKG, ...argv]);
|
|
80
|
+
|
|
81
|
+
const installed = which(PKG);
|
|
82
|
+
if (installed && path.resolve(installed) !== path.resolve(__filename)) {
|
|
83
|
+
return run(installed, argv);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
process.stderr.write(
|
|
87
|
+
[
|
|
88
|
+
"clip-anything: this npm package is only a launcher for the Python tool,",
|
|
89
|
+
"and neither `uvx` (uv) nor `pipx` is on your PATH.",
|
|
90
|
+
"",
|
|
91
|
+
"Install uv (recommended), then run this command again:",
|
|
92
|
+
uvHint(),
|
|
93
|
+
"",
|
|
94
|
+
"Or install the tool directly with pipx or pip:",
|
|
95
|
+
" pipx install clip-anything",
|
|
96
|
+
" python3 -m pip install --user clip-anything",
|
|
97
|
+
"",
|
|
98
|
+
"ffmpeg is also required:",
|
|
99
|
+
ffmpegHint(),
|
|
100
|
+
"",
|
|
101
|
+
"Project: https://github.com/shreyassaw5394/clip-anything",
|
|
102
|
+
"",
|
|
103
|
+
].join("\n")
|
|
104
|
+
);
|
|
105
|
+
return 127;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
process.exitCode = main(process.argv.slice(2));
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clip-anything",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Thin launcher for the clip-anything Python CLI: long gameplay recording in, top N vertical highlight clips out. Runs uvx clip-anything.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"clip-anything": "bin/clip-anything.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/clip-anything.js",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18"
|
|
15
|
+
},
|
|
16
|
+
"os": [
|
|
17
|
+
"darwin",
|
|
18
|
+
"linux",
|
|
19
|
+
"win32"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"video",
|
|
23
|
+
"clips",
|
|
24
|
+
"highlights",
|
|
25
|
+
"shorts",
|
|
26
|
+
"gameplay",
|
|
27
|
+
"ffmpeg",
|
|
28
|
+
"launcher"
|
|
29
|
+
],
|
|
30
|
+
"author": "Shreyas Sawant (https://github.com/shreyassaw5394)",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/shreyassaw5394/clip-anything.git",
|
|
35
|
+
"directory": "npm"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/shreyassaw5394/clip-anything#readme",
|
|
38
|
+
"bugs": "https://github.com/shreyassaw5394/clip-anything/issues",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"test": "node bin/clip-anything.js --version"
|
|
41
|
+
}
|
|
42
|
+
}
|