@barrysongdev4real/listenup-cli 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.
package/LICENSE ADDED
@@ -0,0 +1,145 @@
1
+ PolyForm Noncommercial License 1.0.0
2
+
3
+ https://polyformproject.org/licenses/noncommercial/1.0.0
4
+
5
+ Acceptance
6
+
7
+ In order to get any license under these terms, you must agree to them as
8
+ both strict obligations and conditions to all your licenses.
9
+
10
+ Copyright License
11
+
12
+ The licensor grants you a copyright license for the software to do everything
13
+ you might do with the software that would otherwise infringe the licensor's
14
+ copyright in it for any permitted purpose. However, you may only distribute
15
+ the software according to Distribution License and make changes or new works
16
+ based on the software according to Changes and New Works License.
17
+
18
+ Distribution License
19
+
20
+ The licensor grants you an additional copyright license to distribute copies
21
+ of the software. Your license to distribute covers distributing the software
22
+ with changes and new works permitted by Changes and New Works License.
23
+
24
+ Notices
25
+
26
+ You must ensure that anyone who gets a copy of any part of the software from
27
+ you also gets a copy of these terms or the URL for them above, as well as
28
+ copies of any plain-text lines beginning with `Required Notice:` that the
29
+ licensor provided with the software. For example:
30
+
31
+ Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
32
+
33
+ Changes and New Works License
34
+
35
+ The licensor grants you an additional copyright license to make changes and
36
+ new works based on the software for any permitted purpose.
37
+
38
+ Patent License
39
+
40
+ The licensor grants you a patent license for the software that covers patent
41
+ claims the licensor can license, or becomes able to license, that you would
42
+ infringe by using the software.
43
+
44
+ Noncommercial Purposes
45
+
46
+ Any noncommercial purpose is a permitted purpose.
47
+
48
+ Personal Uses
49
+
50
+ Personal use for research, experiment, and testing for the benefit of public
51
+ knowledge, personal study, private entertainment, hobby projects, amateur
52
+ pursuits, or religious observance, without any anticipated commercial
53
+ application, is use for a permitted purpose.
54
+
55
+ Noncommercial Organizations
56
+
57
+ Use by any charitable organization, educational institution, public research
58
+ organization, public safety or health organization, environmental protection
59
+ organization, or government institution is use for a permitted purpose
60
+ regardless of the source of funding or obligations resulting from the funding.
61
+
62
+ Fair Use
63
+
64
+ You may have "fair use" rights for the software under the law. These terms do
65
+ not limit them.
66
+
67
+ No Other Rights
68
+
69
+ These terms do not allow you to sublicense or transfer any of your licenses to
70
+ anyone else, or prevent the licensor from granting licenses to anyone else.
71
+ These terms do not imply any other licenses.
72
+
73
+ Patent Defense
74
+
75
+ If you make any written claim that the software infringes or contributes to
76
+ infringement of any patent, your patent license for the software granted under
77
+ these terms ends immediately. If your company makes such a claim, your patent
78
+ license ends immediately for work on behalf of your company.
79
+
80
+ Violations
81
+
82
+ The first time you are notified in writing that you have violated any of these
83
+ terms, or done anything with the software not covered by your licenses, your
84
+ licenses can nonetheless continue if you come into full compliance with these
85
+ terms, and take practical steps to correct past violations, within 32 days of
86
+ receiving notice. Otherwise, all your licenses end immediately.
87
+
88
+ No Liability
89
+
90
+ As far as the law allows, the software comes as is, without any warranty or
91
+ condition, and the licensor will not be liable to you for any damages arising
92
+ out of these terms or the use or nature of the software, under any kind of
93
+ legal claim.
94
+
95
+ Definitions
96
+
97
+ The licensor is the individual or entity offering these terms, and the
98
+ software is the software the licensor makes available under these terms.
99
+
100
+ You refers to the individual or entity agreeing to these terms.
101
+
102
+ Your company is any legal entity, sole proprietorship, or other kind of
103
+ organization that you work for, plus all organizations that have control over,
104
+ are under the control of, or are under common control with that organization.
105
+ Control means ownership of substantially all the assets of an entity, or the
106
+ power to direct its management and policies by vote, contract, or otherwise.
107
+ Control can be direct or indirect.
108
+
109
+ Your licenses are all the licenses granted to you for the software under these
110
+ terms.
111
+
112
+ Use means anything you do with the software requiring one of your licenses.
113
+
114
+ Copyright PolyForm Project Inc.
115
+
116
+ Required Notice: Copyright (c) 2026 ListenUp Extension contributors.
117
+ Required Notice: ListenUp Extension is licensed for noncommercial use under
118
+ PolyForm Noncommercial License 1.0.0.
119
+
120
+ Third-Party / Template Notice
121
+
122
+ This project includes portions derived from vite-web-extension, originally
123
+ licensed under the MIT License:
124
+
125
+ The MIT License (MIT)
126
+
127
+ Copyright (c) 2022 Jonathan Braat
128
+
129
+ Permission is hereby granted, free of charge, to any person obtaining a copy
130
+ of this software and associated documentation files (the "Software"), to deal
131
+ in the Software without restriction, including without limitation the rights
132
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
133
+ copies of the Software, and to permit persons to whom the Software is
134
+ furnished to do so, subject to the following conditions:
135
+
136
+ The above copyright notice and this permission notice shall be included in all
137
+ copies or substantial portions of the Software.
138
+
139
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
140
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
141
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
142
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
143
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
144
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
145
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # ListenUp CLI
2
+
3
+ 安全读取 ListenUp Desktop 保存在本机 SQLite 中的 YouTube 原字幕,并校验、导入由用户自己的
4
+ AI 生成的完整译文。CLI 不包含翻译模型、不上传字幕,也不开放任意 SQL。
5
+
6
+ ## 安装
7
+
8
+ 首个版本仅支持 macOS Apple Silicon,需要 Node.js 20 或更高版本:
9
+
10
+ ```bash
11
+ npm install -g @barrysongdev4real/listenup-cli@0.1.0
12
+ listenup --version
13
+ ```
14
+
15
+ ## 常用命令
16
+
17
+ ```bash
18
+ listenup info --json
19
+ listenup video list --json
20
+ listenup subtitle get VIDEO_ID --json
21
+ listenup translation list VIDEO_ID --json
22
+ listenup translation get VIDEO_ID --language ja --json
23
+ listenup translation apply translation.json --dry-run --json
24
+ listenup translation apply translation.json --commit --json
25
+ ```
26
+
27
+ 写操作默认只是 dry-run,只有显式传入 `--commit` 才会修改数据库。默认访问正式版 Desktop
28
+ 数据库;本地开发可传 `--env dev`,测试可以传 `--db /absolute/path/to/test.sqlite`。
29
+
30
+ 完整的 AI 工作流见不可变版本中的
31
+ [`listenup-local-translator`](https://github.com/BarrySong97/listenup-extension/tree/cli-v0.1.0/skills/listenup-local-translator)
32
+ Skill。
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @purpose 启动 npm 包内固定的 macOS arm64 listenup Rust 二进制。
4
+ * @role npm `listenup` bin 的薄平台校验与进程转发层。
5
+ * @deps node:child_process、node:url、vendor/darwin-arm64/listenup
6
+ * @gotcha 不读取数据库或改写 JSON;参数、stdio、signal 和退出状态必须原样转发。
7
+ */
8
+ import { spawn } from "node:child_process";
9
+ import { fileURLToPath } from "node:url";
10
+
11
+ if (process.platform !== "darwin" || process.arch !== "arm64") {
12
+ console.error(
13
+ `listenup 0.1.x supports macOS Apple Silicon only; detected ${process.platform}-${process.arch}.`
14
+ );
15
+ process.exit(1);
16
+ }
17
+
18
+ const binary = fileURLToPath(
19
+ new URL("../vendor/darwin-arm64/listenup", import.meta.url)
20
+ );
21
+ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
22
+ const forwardedSignals = ["SIGINT", "SIGTERM", "SIGHUP"];
23
+
24
+ for (const signal of forwardedSignals) {
25
+ process.on(signal, () => {
26
+ if (!child.killed) child.kill(signal);
27
+ });
28
+ }
29
+
30
+ child.once("error", (error) => {
31
+ console.error(`listenup failed to start: ${error.message}`);
32
+ process.exitCode = 1;
33
+ });
34
+
35
+ child.once("exit", (code, signal) => {
36
+ if (signal) {
37
+ for (const forwardedSignal of forwardedSignals) {
38
+ process.removeAllListeners(forwardedSignal);
39
+ }
40
+ process.kill(process.pid, signal);
41
+ return;
42
+ }
43
+ process.exitCode = code ?? 1;
44
+ });
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@barrysongdev4real/listenup-cli",
3
+ "version": "0.1.0",
4
+ "description": "Safe local CLI for reading ListenUp subtitles and importing AI translations.",
5
+ "license": "PolyForm-Noncommercial-1.0.0",
6
+ "type": "module",
7
+ "bin": {
8
+ "listenup": "./bin/listenup.mjs"
9
+ },
10
+ "engines": {
11
+ "node": ">=20"
12
+ },
13
+ "os": [
14
+ "darwin"
15
+ ],
16
+ "cpu": [
17
+ "arm64"
18
+ ]
19
+ }
Binary file