@wovin/tranz-cli 0.0.26
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 +15 -0
- package/README.md +447 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +10 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +6 -0
- package/dist/commands/prep/index.d.ts +59 -0
- package/dist/commands/prep/index.js +177 -0
- package/dist/commands/scribe/index.d.ts +43 -0
- package/dist/commands/scribe/index.js +383 -0
- package/dist/commands/split/index.d.ts +23 -0
- package/dist/commands/split/index.js +95 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/utils/file-utils.d.ts +5 -0
- package/dist/utils/file-utils.js +15 -0
- package/dist/utils/formatBytes.d.ts +14 -0
- package/dist/utils/formatBytes.js +22 -0
- package/dist/utils/secrets.d.ts +18 -0
- package/dist/utils/secrets.js +40 -0
- package/oclif.manifest.json +284 -0
- package/package.json +90 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026, gotjoshua
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
# @wovin/tranz-cli
|
|
2
|
+
|
|
3
|
+
CLI for audio and video transcription
|
|
4
|
+
|
|
5
|
+
[](https://jsr.io/@wovin/tranz-cli)
|
|
6
|
+
[](https://oclif.io)
|
|
7
|
+
|
|
8
|
+
- [Quick Start](#quick-start)
|
|
9
|
+
- [Setup / Configuration](#setup--configuration)
|
|
10
|
+
- [Commands](#commands)
|
|
11
|
+
|
|
12
|
+
# Quick Start
|
|
13
|
+
|
|
14
|
+
Transcribe an audio file using the Mistral provider with speaker diarization and segment-level timestamps:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
tranz scribe --provider mistral --timestamps segment --diarization path/to/audio.file
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
# Setup / Configuration
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
# npm
|
|
26
|
+
npm install -g @wovin/tranz-cli
|
|
27
|
+
|
|
28
|
+
# pnpm
|
|
29
|
+
pnpm add -g @wovin/tranz-cli
|
|
30
|
+
|
|
31
|
+
# yarn
|
|
32
|
+
yarn global add @wovin/tranz-cli
|
|
33
|
+
|
|
34
|
+
# deno
|
|
35
|
+
deno install -g jsr:@wovin/tranz-cli
|
|
36
|
+
|
|
37
|
+
# jsr (for any runtime)
|
|
38
|
+
npx jsr add -g @wovin/tranz-cli
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## API Key Configuration
|
|
42
|
+
|
|
43
|
+
The `scribe` command supports multiple transcription providers. For API-based providers (Mistral, GreenPT), you need to configure an API key.
|
|
44
|
+
|
|
45
|
+
### Option 1: Environment Variable (Recommended)
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
export MISTRAL_API_KEY="your-api-key-here"
|
|
49
|
+
tranz scribe path/to/audio.mp3
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Option 2: Secret File
|
|
53
|
+
|
|
54
|
+
Create a secret file in the project directory:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
mkdir -p secret
|
|
58
|
+
echo "your-api-key-here" > secret/mistral
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The tool will automatically look for `secret/mistral` if the `MISTRAL_API_KEY` environment variable is not set.
|
|
62
|
+
|
|
63
|
+
## Supported Providers
|
|
64
|
+
|
|
65
|
+
- **whisper** (default) - Local Whisper transcription (no API key needed)
|
|
66
|
+
- **mistral** - Mistral Voxtral transcription API
|
|
67
|
+
- **greenpt** - GreenPT transcription API
|
|
68
|
+
|
|
69
|
+
For GreenPT, use the same pattern with `GREENPT_API_KEY` or `secret/greenpt`.
|
|
70
|
+
|
|
71
|
+
## Common Examples
|
|
72
|
+
|
|
73
|
+
### Basic transcription with Whisper (local, no API key)
|
|
74
|
+
```sh
|
|
75
|
+
tranz scribe path/to/audio.mp3
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Mistral with specific model
|
|
79
|
+
```sh
|
|
80
|
+
tranz scribe path/to/audio.mp3 --provider mistral --model voxtral-mini-latest
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Mistral with word-level timestamps and diarization
|
|
84
|
+
```sh
|
|
85
|
+
tranz scribe path/to/audio.mp3 --provider mistral --timestamps word --diarization
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Transcribe with preprocessing and normalization
|
|
89
|
+
```sh
|
|
90
|
+
tranz scribe path/to/audio.mp3 --prep --norm
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### GreenPT with language specification
|
|
94
|
+
```sh
|
|
95
|
+
tranz scribe path/to/audio.mp3 --provider greenpt --language en
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
# Usage
|
|
99
|
+
|
|
100
|
+
```sh-session
|
|
101
|
+
$ npm install -g @wovin/tranz-cli
|
|
102
|
+
$ tranz COMMAND
|
|
103
|
+
running command...
|
|
104
|
+
$ tranz (--version)
|
|
105
|
+
@wovin/tranz-cli/0.0.26 linux-x64 node-v22.20.0
|
|
106
|
+
$ tranz --help [COMMAND]
|
|
107
|
+
USAGE
|
|
108
|
+
$ tranz COMMAND
|
|
109
|
+
...
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
# Commands
|
|
113
|
+
|
|
114
|
+
- [`tranz help [COMMANDS]`](#tranz-help-commands)
|
|
115
|
+
- [`tranz plugins`](#tranz-plugins)
|
|
116
|
+
- [`tranz plugins:install PLUGIN...`](#tranz-pluginsinstall-plugin)
|
|
117
|
+
- [`tranz plugins:inspect PLUGIN...`](#tranz-pluginsinspect-plugin)
|
|
118
|
+
- [`tranz plugins:install PLUGIN...`](#tranz-pluginsinstall-plugin-1)
|
|
119
|
+
- [`tranz plugins:link PLUGIN`](#tranz-pluginslink-plugin)
|
|
120
|
+
- [`tranz plugins:uninstall PLUGIN...`](#tranz-pluginsuninstall-plugin)
|
|
121
|
+
- [`tranz plugins:uninstall PLUGIN...`](#tranz-pluginsuninstall-plugin-1)
|
|
122
|
+
- [`tranz plugins:uninstall PLUGIN...`](#tranz-pluginsuninstall-plugin-2)
|
|
123
|
+
- [`tranz plugins update`](#tranz-plugins-update)
|
|
124
|
+
- [`tranz prep INPUT`](#tranz-prep-input)
|
|
125
|
+
- [`tranz scribe INPUT`](#tranz-scribe-input)
|
|
126
|
+
|
|
127
|
+
## `tranz help [COMMANDS]`
|
|
128
|
+
|
|
129
|
+
Display help for tranz.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
USAGE
|
|
133
|
+
$ tranz help [COMMANDS] [-n]
|
|
134
|
+
|
|
135
|
+
ARGUMENTS
|
|
136
|
+
COMMANDS Command to show help for.
|
|
137
|
+
|
|
138
|
+
FLAGS
|
|
139
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
140
|
+
|
|
141
|
+
DESCRIPTION
|
|
142
|
+
Display help for tranz.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
_See code:_ [_@oclif/plugin-help_](https://github.com/oclif/plugin-help/blob/v5.2.15/src/commands/help.ts)
|
|
146
|
+
|
|
147
|
+
## `tranz plugins`
|
|
148
|
+
|
|
149
|
+
List installed plugins.
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
USAGE
|
|
153
|
+
$ tranz plugins [--json] [--core]
|
|
154
|
+
|
|
155
|
+
FLAGS
|
|
156
|
+
--core Show core plugins.
|
|
157
|
+
|
|
158
|
+
GLOBAL FLAGS
|
|
159
|
+
--json Format output as json.
|
|
160
|
+
|
|
161
|
+
DESCRIPTION
|
|
162
|
+
List installed plugins.
|
|
163
|
+
|
|
164
|
+
EXAMPLES
|
|
165
|
+
$ tranz plugins
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
_See code:_ [_@oclif/plugin-plugins_](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/index.ts)
|
|
169
|
+
|
|
170
|
+
## `tranz plugins:install PLUGIN...`
|
|
171
|
+
|
|
172
|
+
Installs a plugin into the CLI.
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
USAGE
|
|
176
|
+
$ tranz plugins:install PLUGIN...
|
|
177
|
+
|
|
178
|
+
ARGUMENTS
|
|
179
|
+
PLUGIN Plugin to install.
|
|
180
|
+
|
|
181
|
+
FLAGS
|
|
182
|
+
-f, --force Run yarn install with force flag.
|
|
183
|
+
-h, --help Show CLI help.
|
|
184
|
+
-v, --verbose
|
|
185
|
+
|
|
186
|
+
DESCRIPTION
|
|
187
|
+
Installs a plugin into the CLI.
|
|
188
|
+
Can be installed from npm or a git url.
|
|
189
|
+
|
|
190
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
191
|
+
|
|
192
|
+
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
|
|
193
|
+
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
|
|
194
|
+
the CLI without the need to patch and update the whole CLI.
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
ALIASES
|
|
198
|
+
$ tranz plugins add
|
|
199
|
+
|
|
200
|
+
EXAMPLES
|
|
201
|
+
$ tranz plugins:install myplugin
|
|
202
|
+
|
|
203
|
+
$ tranz plugins:install https://github.com/someuser/someplugin
|
|
204
|
+
|
|
205
|
+
$ tranz plugins:install someuser/someplugin
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## `tranz plugins:inspect PLUGIN...`
|
|
209
|
+
|
|
210
|
+
Displays installation properties of a plugin.
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
USAGE
|
|
214
|
+
$ tranz plugins:inspect PLUGIN...
|
|
215
|
+
|
|
216
|
+
ARGUMENTS
|
|
217
|
+
PLUGIN [default: .] Plugin to inspect.
|
|
218
|
+
|
|
219
|
+
FLAGS
|
|
220
|
+
-h, --help Show CLI help.
|
|
221
|
+
-v, --verbose
|
|
222
|
+
|
|
223
|
+
GLOBAL FLAGS
|
|
224
|
+
--json Format output as json.
|
|
225
|
+
|
|
226
|
+
DESCRIPTION
|
|
227
|
+
Displays installation properties of a plugin.
|
|
228
|
+
|
|
229
|
+
EXAMPLES
|
|
230
|
+
$ tranz plugins:inspect myplugin
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
_See code:_ [_@oclif/plugin-plugins_](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/inspect.ts)
|
|
234
|
+
|
|
235
|
+
## `tranz plugins:install PLUGIN...`
|
|
236
|
+
|
|
237
|
+
Installs a plugin into the CLI.
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
USAGE
|
|
241
|
+
$ tranz plugins:install PLUGIN...
|
|
242
|
+
|
|
243
|
+
ARGUMENTS
|
|
244
|
+
PLUGIN Plugin to install.
|
|
245
|
+
|
|
246
|
+
FLAGS
|
|
247
|
+
-f, --force Run yarn install with force flag.
|
|
248
|
+
-h, --help Show CLI help.
|
|
249
|
+
-v, --verbose
|
|
250
|
+
|
|
251
|
+
DESCRIPTION
|
|
252
|
+
Installs a plugin into the CLI.
|
|
253
|
+
Can be installed from npm or a git url.
|
|
254
|
+
|
|
255
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
256
|
+
|
|
257
|
+
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
|
|
258
|
+
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
|
|
259
|
+
the CLI without the need to patch and update the whole CLI.
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
ALIASES
|
|
263
|
+
$ tranz plugins add
|
|
264
|
+
|
|
265
|
+
EXAMPLES
|
|
266
|
+
$ tranz plugins:install myplugin
|
|
267
|
+
|
|
268
|
+
$ tranz plugins:install https://github.com/someuser/someplugin
|
|
269
|
+
|
|
270
|
+
$ tranz plugins:install someuser/someplugin
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
_See code:_ [_@oclif/plugin-plugins_](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/install.ts)
|
|
274
|
+
|
|
275
|
+
## `tranz plugins:link PLUGIN`
|
|
276
|
+
|
|
277
|
+
Links a plugin into the CLI for development.
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
USAGE
|
|
281
|
+
$ tranz plugins:link PLUGIN
|
|
282
|
+
|
|
283
|
+
ARGUMENTS
|
|
284
|
+
PATH [default: .] path to plugin
|
|
285
|
+
|
|
286
|
+
FLAGS
|
|
287
|
+
-h, --help Show CLI help.
|
|
288
|
+
-v, --verbose
|
|
289
|
+
|
|
290
|
+
DESCRIPTION
|
|
291
|
+
Links a plugin into the CLI for development.
|
|
292
|
+
Installation of a linked plugin will override a user-installed or core plugin.
|
|
293
|
+
|
|
294
|
+
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
|
|
295
|
+
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
EXAMPLES
|
|
299
|
+
$ tranz plugins:link myplugin
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
_See code:_ [_@oclif/plugin-plugins_](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/link.ts)
|
|
303
|
+
|
|
304
|
+
## `tranz plugins:uninstall PLUGIN...`
|
|
305
|
+
|
|
306
|
+
Removes a plugin from the CLI.
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
USAGE
|
|
310
|
+
$ tranz plugins:uninstall PLUGIN...
|
|
311
|
+
|
|
312
|
+
ARGUMENTS
|
|
313
|
+
PLUGIN plugin to uninstall
|
|
314
|
+
|
|
315
|
+
FLAGS
|
|
316
|
+
-h, --help Show CLI help.
|
|
317
|
+
-v, --verbose
|
|
318
|
+
|
|
319
|
+
DESCRIPTION
|
|
320
|
+
Removes a plugin from the CLI.
|
|
321
|
+
|
|
322
|
+
ALIASES
|
|
323
|
+
$ tranz plugins unlink
|
|
324
|
+
$ tranz plugins remove
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## `tranz plugins:uninstall PLUGIN...`
|
|
328
|
+
|
|
329
|
+
Removes a plugin from the CLI.
|
|
330
|
+
|
|
331
|
+
```
|
|
332
|
+
USAGE
|
|
333
|
+
$ tranz plugins:uninstall PLUGIN...
|
|
334
|
+
|
|
335
|
+
ARGUMENTS
|
|
336
|
+
PLUGIN plugin to uninstall
|
|
337
|
+
|
|
338
|
+
FLAGS
|
|
339
|
+
-h, --help Show CLI help.
|
|
340
|
+
-v, --verbose
|
|
341
|
+
|
|
342
|
+
DESCRIPTION
|
|
343
|
+
Removes a plugin from the CLI.
|
|
344
|
+
|
|
345
|
+
ALIASES
|
|
346
|
+
$ tranz plugins unlink
|
|
347
|
+
$ tranz plugins remove
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
_See code:_ [_@oclif/plugin-plugins_](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/uninstall.ts)
|
|
351
|
+
|
|
352
|
+
## `tranz plugins:uninstall PLUGIN...`
|
|
353
|
+
|
|
354
|
+
Removes a plugin from the CLI.
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
USAGE
|
|
358
|
+
$ tranz plugins:uninstall PLUGIN...
|
|
359
|
+
|
|
360
|
+
ARGUMENTS
|
|
361
|
+
PLUGIN plugin to uninstall
|
|
362
|
+
|
|
363
|
+
FLAGS
|
|
364
|
+
-h, --help Show CLI help.
|
|
365
|
+
-v, --verbose
|
|
366
|
+
|
|
367
|
+
DESCRIPTION
|
|
368
|
+
Removes a plugin from the CLI.
|
|
369
|
+
|
|
370
|
+
ALIASES
|
|
371
|
+
$ tranz plugins unlink
|
|
372
|
+
$ tranz plugins remove
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
## `tranz plugins update`
|
|
376
|
+
|
|
377
|
+
Update installed plugins.
|
|
378
|
+
|
|
379
|
+
```
|
|
380
|
+
USAGE
|
|
381
|
+
$ tranz plugins update [-h] [-v]
|
|
382
|
+
|
|
383
|
+
FLAGS
|
|
384
|
+
-h, --help Show CLI help.
|
|
385
|
+
-v, --verbose
|
|
386
|
+
|
|
387
|
+
DESCRIPTION
|
|
388
|
+
Update installed plugins.
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
_See code:_ [_@oclif/plugin-plugins_](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/update.ts)
|
|
392
|
+
|
|
393
|
+
## `tranz prep INPUT`
|
|
394
|
+
|
|
395
|
+
Prepare audio file - normalize, noise reduce, split on silence
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
USAGE
|
|
399
|
+
$ tranz prep INPUT [-n] [-o <value>] [-s <value>] [-d <value>]
|
|
400
|
+
|
|
401
|
+
ARGUMENTS
|
|
402
|
+
INPUT input file
|
|
403
|
+
|
|
404
|
+
FLAGS
|
|
405
|
+
-d, --sildur=<value> [default: 1.1] silence duration
|
|
406
|
+
-n, --norm do normalization?
|
|
407
|
+
-o, --output=<value> [default: ./out] output directory
|
|
408
|
+
-s, --silence=<value> [default: -45dB] silence threshold
|
|
409
|
+
|
|
410
|
+
DESCRIPTION
|
|
411
|
+
Prepare audio file - normalize, noise reduce, split on silence
|
|
412
|
+
|
|
413
|
+
EXAMPLES
|
|
414
|
+
$ tranz prep path/to/audio.mp3
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
_See code:_ [_src/commands/prep/index.ts_](https://gitlab.com/onezoomin/ztax/tranz/-/blob/main/packages/tranz-cli/src/commands/prep/index.ts)
|
|
418
|
+
|
|
419
|
+
## `tranz scribe INPUT`
|
|
420
|
+
|
|
421
|
+
Transcribe audio file - optionally prepare first
|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
USAGE
|
|
425
|
+
$ tranz scribe INPUT [-o <value>] [-p] [-n] [-d]
|
|
426
|
+
|
|
427
|
+
ARGUMENTS
|
|
428
|
+
INPUT input file
|
|
429
|
+
|
|
430
|
+
FLAGS
|
|
431
|
+
-d, --separate_speakers separate via diarization
|
|
432
|
+
-n, --norm do normalization?
|
|
433
|
+
-o, --output=<value> [default: ./out] output directory
|
|
434
|
+
-p, --prep do prep?
|
|
435
|
+
|
|
436
|
+
DESCRIPTION
|
|
437
|
+
Transcribe audio file - optionally prepare first
|
|
438
|
+
|
|
439
|
+
EXAMPLES
|
|
440
|
+
$ tranz scribe 'path/to/16khz-audiofile.wav'
|
|
441
|
+
runs whisper and outputs and saves a transcription json
|
|
442
|
+
|
|
443
|
+
$ tranz scribe 'path/to/whatever-audiofile.mp3' -p
|
|
444
|
+
first prepares and then runs whisper and outputs and saves a transcription json
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
_See code:_ [_src/commands/scribe/index.ts_](https://gitlab.com/onezoomin/ztax/tranz/-/blob/main/packages/tranz-cli/src/commands/scribe/index.ts)
|
package/bin/dev.cmd
ADDED
package/bin/dev.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import {fileURLToPath} from 'node:url'
|
|
4
|
+
import {dirname} from 'node:path'
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
7
|
+
const __dirname = dirname(__filename)
|
|
8
|
+
|
|
9
|
+
// In dev mode, run from the parent directory
|
|
10
|
+
await (await import('@oclif/core')).run(process.argv.slice(2), __dirname)
|
package/bin/run.cmd
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Command, Config } from '@oclif/core';
|
|
2
|
+
type GenericObject = Record<string, any>;
|
|
3
|
+
type FfmpegResults = {
|
|
4
|
+
ffmpegChain: any;
|
|
5
|
+
outputPath: string;
|
|
6
|
+
};
|
|
7
|
+
type PrepProps = {
|
|
8
|
+
input: string;
|
|
9
|
+
outdir: string;
|
|
10
|
+
silthr: string;
|
|
11
|
+
sildur: string;
|
|
12
|
+
norm: boolean;
|
|
13
|
+
verbose: boolean;
|
|
14
|
+
};
|
|
15
|
+
type PrepResult = {
|
|
16
|
+
props: PrepProps;
|
|
17
|
+
info: GenericObject;
|
|
18
|
+
results: FfmpegResults;
|
|
19
|
+
};
|
|
20
|
+
export default class Prep extends Command {
|
|
21
|
+
static description: string;
|
|
22
|
+
static DEFAULTS: {
|
|
23
|
+
SILDUR: string;
|
|
24
|
+
SILBUF: number;
|
|
25
|
+
SILTHR: string;
|
|
26
|
+
RNNN: string;
|
|
27
|
+
};
|
|
28
|
+
static args: {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
required: boolean;
|
|
32
|
+
}[];
|
|
33
|
+
static flags: {
|
|
34
|
+
norm: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
|
|
35
|
+
verbose: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
|
|
36
|
+
outdir: import("@oclif/core/lib/interfaces/parser").OptionFlag<string>;
|
|
37
|
+
silthr: import("@oclif/core/lib/interfaces/parser").OptionFlag<string>;
|
|
38
|
+
sildur: import("@oclif/core/lib/interfaces/parser").OptionFlag<string>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* subroutines
|
|
42
|
+
*/
|
|
43
|
+
static normalize: (path: string, outputDir: string) => Promise<string>;
|
|
44
|
+
static removeSilence: (inputPath: string, silence: string | number, sildur: string | number, output?: string) => Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* cli only (depends on config and fs situation)
|
|
47
|
+
*/
|
|
48
|
+
static ensureRnnnIsCached: (config: Config) => Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* doPrep
|
|
51
|
+
*/
|
|
52
|
+
doPrep(props: PrepProps): Promise<PrepResult>;
|
|
53
|
+
/**
|
|
54
|
+
* only for cli parsing
|
|
55
|
+
*/
|
|
56
|
+
run(): Promise<void>;
|
|
57
|
+
static examples: string[];
|
|
58
|
+
}
|
|
59
|
+
export {};
|