@tacone/prosey 0.1.0 → 0.2.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/README.md +61 -31
- package/bin/prosey +14317 -0
- package/package.json +5 -5
- package/src/cache.test.ts +92 -0
- package/src/cache.ts +48 -0
- package/src/config.test.ts +98 -0
- package/src/config.ts +93 -0
- package/src/debug.ts +13 -0
- package/src/default-config.toml +16 -0
- package/src/index.ts +146 -19
- package/src/summarize.test.ts +44 -0
- package/src/summarize.ts +51 -0
- package/bin/prosey.js +0 -604
package/README.md
CHANGED
|
@@ -4,23 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
You can read, skim, search, copy, and manipulate the text using the tools you love the most.
|
|
6
6
|
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
|
-
npx prosey
|
|
10
|
+
npx @tacone/prosey 771PQEDeRmw
|
|
11
|
+
npx @tacone/prosey https://youtu.be/771PQEDeRmw --lang es -o transcript.txt
|
|
12
|
+
npx @tacone/prosey info 771PQEDeRmw
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
## Install
|
|
12
16
|
|
|
13
|
-
### Quick — no install (npx)
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npx prosey dQw4w9WgXcQ
|
|
17
|
-
```
|
|
18
|
-
|
|
19
17
|
### Global install (npm)
|
|
20
18
|
|
|
21
19
|
```bash
|
|
22
|
-
npm install -g prosey
|
|
23
|
-
prosey
|
|
20
|
+
npm install -g @tacone/prosey
|
|
21
|
+
prosey 771PQEDeRmw
|
|
24
22
|
```
|
|
25
23
|
|
|
26
24
|
### From source (development)
|
|
@@ -32,7 +30,7 @@ and running the TypeScript source directly.
|
|
|
32
30
|
git clone https://github.com/tacone/prosey.git
|
|
33
31
|
cd prosey
|
|
34
32
|
bun install
|
|
35
|
-
bun run start --
|
|
33
|
+
bun run start -- 771PQEDeRmw
|
|
36
34
|
```
|
|
37
35
|
|
|
38
36
|
### Prebuilt binary
|
|
@@ -44,37 +42,44 @@ Grab a compiled binary from the `dist/` directory (requires no runtime).
|
|
|
44
42
|
```
|
|
45
43
|
prosey [options] <video-url-or-id>
|
|
46
44
|
prosey info [options] <video-url-or-id>
|
|
45
|
+
prosey summarize [options] <video-url-or-id>
|
|
47
46
|
```
|
|
48
47
|
|
|
49
48
|
Pass a full YouTube URL or a bare video ID. The transcript is printed to
|
|
50
49
|
stdout by default, with video details prepended.
|
|
51
50
|
|
|
51
|
+
The `summarize` command fetches a transcript, prepends the prompt from the
|
|
52
|
+
`[summarize]` config section, and pipes the result to the configured command.
|
|
53
|
+
|
|
52
54
|
### Examples
|
|
53
55
|
|
|
54
56
|
```bash
|
|
55
57
|
# Basic — plain text with details
|
|
56
|
-
prosey
|
|
58
|
+
npx @tacone/prosey 771PQEDeRmw
|
|
57
59
|
|
|
58
60
|
# Specify language
|
|
59
|
-
prosey https://
|
|
61
|
+
npx @tacone/prosey https://youtu.be/771PQEDeRmw --lang es
|
|
60
62
|
|
|
61
63
|
# Include timestamps
|
|
62
|
-
prosey
|
|
64
|
+
npx @tacone/prosey 771PQEDeRmw -t
|
|
63
65
|
|
|
64
66
|
# Save to file
|
|
65
|
-
prosey
|
|
67
|
+
npx @tacone/prosey 771PQEDeRmw -o transcript.txt
|
|
66
68
|
|
|
67
69
|
# JSON output (timestamps always included)
|
|
68
|
-
prosey
|
|
70
|
+
npx @tacone/prosey 771PQEDeRmw --json
|
|
69
71
|
|
|
70
72
|
# Transcript only, no video details
|
|
71
|
-
prosey
|
|
73
|
+
npx @tacone/prosey 771PQEDeRmw --no-details
|
|
72
74
|
|
|
73
75
|
# List available transcript languages
|
|
74
|
-
prosey
|
|
76
|
+
npx @tacone/prosey 771PQEDeRmw --list
|
|
75
77
|
|
|
76
78
|
# Show video metadata
|
|
77
|
-
prosey info
|
|
79
|
+
npx @tacone/prosey info 771PQEDeRmw
|
|
80
|
+
|
|
81
|
+
# Summarize via the configured command
|
|
82
|
+
npx @tacone/prosey summarize 771PQEDeRmw
|
|
78
83
|
```
|
|
79
84
|
|
|
80
85
|
## Options
|
|
@@ -111,15 +116,6 @@ When `--json` is used, the output is an array of objects:
|
|
|
111
116
|
`timestamp` is always present in JSON mode. Video details are suppressed
|
|
112
117
|
(silently) since JSON is structured data.
|
|
113
118
|
|
|
114
|
-
## Binary
|
|
115
|
-
|
|
116
|
-
Build a single-file binary with no external dependencies:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
bun run build
|
|
120
|
-
./dist/prosey dQw4w9WgXcQ
|
|
121
|
-
```
|
|
122
|
-
|
|
123
119
|
## Development
|
|
124
120
|
|
|
125
121
|
This project uses **[Bun](https://bun.sh)** for development.
|
|
@@ -128,12 +124,46 @@ This project uses **[Bun](https://bun.sh)** for development.
|
|
|
128
124
|
bun run typecheck # TypeScript check
|
|
129
125
|
bun run start # Run the CLI from source
|
|
130
126
|
bun run test # Run unit tests
|
|
131
|
-
bun run build # Compile
|
|
127
|
+
bun run build # Compile Node bundle to bin/prosey
|
|
132
128
|
```
|
|
133
129
|
|
|
134
|
-
Before publishing to npm, `bun run build
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
Before publishing to npm, `bun run build` runs automatically via the `prepack`
|
|
131
|
+
hook, producing a Node-compatible JS bundle at `bin/prosey`.
|
|
132
|
+
|
|
133
|
+
## Configuration
|
|
134
|
+
|
|
135
|
+
Prosey reads configuration from a TOML file. The location follows the
|
|
136
|
+
[XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
|
|
137
|
+
(`~/.config/prosey/config.toml`), or you can set the `PROSEY_CONFIG_PATH`
|
|
138
|
+
environment variable to use a custom path.
|
|
139
|
+
|
|
140
|
+
The config file is created automatically on first run with default values.
|
|
141
|
+
Use `--reset-config` to restore the defaults at any time.
|
|
142
|
+
|
|
143
|
+
The `[summarize]` section configures the `summarize` command:
|
|
144
|
+
|
|
145
|
+
| Key | Description |
|
|
146
|
+
| --------- | ------------------------------------------------ |
|
|
147
|
+
| `prompt` | Instruction prepended to the transcript |
|
|
148
|
+
| `command` | Shell command that receives the prompt via stdin |
|
|
149
|
+
|
|
150
|
+
## Cache
|
|
151
|
+
|
|
152
|
+
Transcripts and summaries are cached to `/tmp/prosey/`. Repeated invocations
|
|
153
|
+
for the same video and options are instant and work offline. Use `--no-cache`
|
|
154
|
+
to skip cache reads and force a fresh fetch.
|
|
155
|
+
|
|
156
|
+
When running `prosey summarize`, the command runs inside the cache directory
|
|
157
|
+
for that video. This prevents the AI agent from picking up project-specific
|
|
158
|
+
files like `AGENTS.md` or `CLAUDE.md` from the current folder, and limits its
|
|
159
|
+
ability to modify files outside that directory.
|
|
160
|
+
|
|
161
|
+
## Exit codes
|
|
162
|
+
|
|
163
|
+
| Code | Meaning |
|
|
164
|
+
| ---- | ----------------------- |
|
|
165
|
+
| `0` | Success |
|
|
166
|
+
| `65` | Invalid video URL or ID |
|
|
137
167
|
|
|
138
168
|
## How it works
|
|
139
169
|
|