@tacone/prosey 0.2.4 → 0.3.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/README.md +52 -26
- package/bin/prosey +363 -51
- package/package.json +1 -1
- package/src/config-resolve.test.ts +104 -0
- package/src/config-resolve.ts +17 -0
- package/src/config.test.ts +3 -1
- package/src/config.ts +27 -18
- package/src/default-config.toml +41 -19
- package/src/extract-chapters.test.ts +229 -0
- package/src/extract-chapters.ts +66 -0
- package/src/index.test.ts +12 -0
- package/src/index.ts +275 -26
- package/src/pager.test.ts +1 -1
- package/src/pager.ts +2 -2
- package/src/summarize.test.ts +74 -3
- package/src/summarize.ts +18 -4
- package/src/version-check.ts +32 -0
package/README.md
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/prosey-logo.svg" alt="Prosey logo" width="400"/>
|
|
3
|
+
<br>
|
|
4
|
+
<br>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
1
7
|
# Prosey
|
|
2
8
|
|
|
3
|
-
**Prosey**
|
|
9
|
+
**Prosey** is a CLI tool to download and display video transcriptions from YouTube, so you can get the information you're looking for without wasting hours.
|
|
10
|
+
|
|
11
|
+
The main use cases are:
|
|
12
|
+
|
|
13
|
+
- **Summarize** a YouTube video and display it in the CLI with a single command (quicker).
|
|
14
|
+
- **Read** video captions, formatted and organized in chapters like the original video (often needs more time).
|
|
15
|
+
|
|
16
|
+
Both uses need an AI assistant on your system (default: [opencode](https://opencode.ai/), use `prosey config` to configure your own).
|
|
17
|
+
|
|
18
|
+
If we detect a syntax highlighter on your system, you'll get a nice colored output.
|
|
4
19
|
|
|
5
|
-
|
|
20
|
+
Prosey can also output or store the native json format verbatim.
|
|
6
21
|
|
|
7
22
|
## Features
|
|
8
23
|
|
|
9
|
-
| Feature
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
24
|
+
| Feature | Description |
|
|
25
|
+
| ------------------------------------------ | ----------------------------------------------------------------------------------------------- |
|
|
26
|
+
| **💡 Summarize** | Fetch and summarize a video transcription |
|
|
27
|
+
| **📖 Read** | Fetch and display the transcript formatted in Markdown |
|
|
28
|
+
| **📋 Transcript download** | Fetch YouTube transcripts as plain text or JSON verbatim |
|
|
29
|
+
| **🤖 AI summarization** | Pipe transcripts to any AI agent (opencode, Claude, Copilot, Codex) |
|
|
30
|
+
| **🎨 Smart pager** | Automatic syntax highlighting if bat, glow or mdcat are installed (or configure your own pager) |
|
|
31
|
+
| **🛠️ Customization** | Use `prosey config` to access and edit your configuration / customize the prompts |
|
|
32
|
+
| **💾 Disk caching** | Transcripts and summaries are cached on disk for instant re-read |
|
|
33
|
+
| **📄 Supported formats** | Plain text and JSON |
|
|
17
34
|
|
|
18
35
|
## Quickstart
|
|
19
36
|
|
|
@@ -64,50 +81,59 @@ Grab a compiled binary from the `dist/` directory (requires no runtime).
|
|
|
64
81
|
|
|
65
82
|
```
|
|
66
83
|
prosey [options] <video-url-or-id>
|
|
84
|
+
prosey read [options] <video-url-or-id>
|
|
67
85
|
prosey info [options] <video-url-or-id>
|
|
68
86
|
prosey summarize [options] <video-url-or-id>
|
|
69
87
|
prosey config
|
|
88
|
+
prosey help
|
|
70
89
|
```
|
|
71
90
|
|
|
72
|
-
|
|
73
|
-
|
|
91
|
+
`summarize` is the default command, so `prosey <id>` runs the AI summarizer.
|
|
92
|
+
Use `prosey read <id>` to download and print a richly formatted transcript.
|
|
74
93
|
|
|
75
94
|
The `summarize` command fetches a transcript, prepends the prompt from the
|
|
76
|
-
`[summarize]` config section, and pipes the result to the configured command.
|
|
95
|
+
`[summarize]` config section, and pipes the result to the configured AI command.
|
|
96
|
+
|
|
97
|
+
The `read` command downloads the transcript and prints it to stdout (plain text,
|
|
98
|
+
markdown, or JSON). This is useful when you don't need AI processing.
|
|
99
|
+
|
|
100
|
+
The `info` command shows video metadata (title, channel, duration, views).
|
|
77
101
|
|
|
78
102
|
The `config` command opens your config file in `$EDITOR` for editing. If
|
|
79
103
|
`$EDITOR` is not set, the config file path is printed.
|
|
80
104
|
|
|
105
|
+
The `help` command shows the help message, same as `--help`.
|
|
106
|
+
|
|
81
107
|
### Examples
|
|
82
108
|
|
|
83
109
|
```bash
|
|
84
|
-
#
|
|
110
|
+
# Run the AI summarizer (default command)
|
|
85
111
|
prosey 771PQEDeRmw
|
|
86
112
|
|
|
113
|
+
# Download a plain transcript with details
|
|
114
|
+
prosey read 771PQEDeRmw
|
|
115
|
+
|
|
87
116
|
# Specify language
|
|
88
|
-
prosey https://youtu.be/771PQEDeRmw --lang es
|
|
117
|
+
prosey read https://youtu.be/771PQEDeRmw --lang es
|
|
89
118
|
|
|
90
119
|
# Include timestamps
|
|
91
|
-
prosey 771PQEDeRmw -t
|
|
120
|
+
prosey read 771PQEDeRmw -t
|
|
92
121
|
|
|
93
|
-
# Save to file
|
|
94
|
-
prosey 771PQEDeRmw -o transcript.txt
|
|
122
|
+
# Save transcript to file
|
|
123
|
+
prosey read 771PQEDeRmw -o transcript.txt
|
|
95
124
|
|
|
96
125
|
# JSON output (timestamps always included)
|
|
97
|
-
prosey 771PQEDeRmw --json
|
|
126
|
+
prosey read 771PQEDeRmw --json
|
|
98
127
|
|
|
99
128
|
# Transcript only, no video details
|
|
100
|
-
prosey 771PQEDeRmw --no-details
|
|
129
|
+
prosey read 771PQEDeRmw --no-details
|
|
101
130
|
|
|
102
131
|
# List available transcript languages
|
|
103
|
-
prosey 771PQEDeRmw --list
|
|
132
|
+
prosey read 771PQEDeRmw --list
|
|
104
133
|
|
|
105
134
|
# Show video metadata
|
|
106
135
|
prosey info 771PQEDeRmw
|
|
107
136
|
|
|
108
|
-
# Summarize via the configured command
|
|
109
|
-
prosey summarize 771PQEDeRmw
|
|
110
|
-
|
|
111
137
|
# Edit config in $EDITOR
|
|
112
138
|
prosey config
|
|
113
139
|
```
|
|
@@ -121,7 +147,7 @@ prosey config
|
|
|
121
147
|
| `--list` | List available transcript languages for the video, then exit. |
|
|
122
148
|
| `-o`, `--output <path>` | Write output to file instead of stdout. |
|
|
123
149
|
| `--json` | Output transcript as a JSON array. Each item includes `text`, `offset` (seconds), `duration`, and `timestamp`. |
|
|
124
|
-
| `--text` | Output as plain text (default).
|
|
150
|
+
| `--text` | Output as plain text (default for `prosey read`). |
|
|
125
151
|
| `--details` | Prepend video details (title, channel, duration, views, description) to the transcript (default). |
|
|
126
152
|
| `--no-details` | Suppress video details, transcript only. |
|
|
127
153
|
| `--no-decode-entities` | Preserve raw HTML entities (e.g. `'`). Decoded by default in text mode. |
|
|
@@ -180,7 +206,7 @@ Use `--reset-config` to restore the defaults at any time.
|
|
|
180
206
|
### `pager`
|
|
181
207
|
|
|
182
208
|
Pager command for transcript and summary output. Defaults to `"auto"`, which
|
|
183
|
-
detects the first available of: `bat -lmd` → `glow` → `mdcat -l -p` → `less`.
|
|
209
|
+
detects the first available of: `bat -lmd --style plain` → `glow -p` → `mdcat -l -p` → `less`.
|
|
184
210
|
Set to a custom command (e.g. `"less -R"`) to override. The `PROSEY_PAGER`
|
|
185
211
|
environment variable takes precedence over this setting.
|
|
186
212
|
|