fix(using-yt-tools): document venv activation or full-path CLI invocation v0.2.2→0.2.3
Prerequisites: explicit table with two options (activate venv vs full-path). Steps: added step 0 (venv activation) to both Flow A and Flow B. Acceptance: agent can now invoke CLI without "command not found" error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: using-yt-tools
|
name: using-yt-tools
|
||||||
version: 0.2.2
|
version: 0.2.3
|
||||||
description: Two flows for YouTube content. **Iterative-watch** (summary/exploration): transcript with [mm:ss] anchors → pick moments → extract frames. **Targeted-frames** (specific timestamps): extract frames directly, no transcript. Triggers: "что в ролике", "о чём видео", "video summary", "youtube transcript", "покажи кадр на N", или любой youtube.com URL. CLI в `~/projects/.common/lib/yt-tools/`. YouTube-only; для Vimeo/Twitch/local — другие тулзы.
|
description: Two flows for YouTube content. **Iterative-watch** (summary/exploration): transcript with [mm:ss] anchors → pick moments → extract frames. **Targeted-frames** (specific timestamps): extract frames directly, no transcript. Triggers: "что в ролике", "о чём видео", "video summary", "youtube transcript", "покажи кадр на N", или любой youtube.com URL. CLI в `~/projects/.common/lib/yt-tools/`. YouTube-only; для Vimeo/Twitch/local — другие тулзы.
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -26,15 +26,20 @@ Iterative-watching YouTube для агента: clean-markdown транскри
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
CLI entry-points на PATH (из `pip install -e ~/projects/.common/lib/yt-tools/` внутри venv):
|
**CLI invocation** — один из двух вариантов (выбери по ситуации):
|
||||||
|
|
||||||
|
| Вариант | Команда | Trade-off |
|
||||||
|
|---|---|---|
|
||||||
|
| **A. Активация venv** | Windows: `& ~/projects/.common/lib/yt-tools/.venv/Scripts/Activate.ps1`<br>Linux/macOS: `source ~/projects/.common/lib/yt-tools/.venv/bin/activate` | Одна команда, но меняет shell state |
|
||||||
|
| **B. Full-path** | `~/projects/.common/lib/yt-tools/.venv/Scripts/yt-frames.exe URL ...` (Windows)<br>`~/projects/.common/lib/yt-tools/.venv/bin/yt-frames URL ...` (Linux/macOS) | Изолированно, но длиннее в каждом вызове |
|
||||||
|
|
||||||
|
После активации или full-path доступны:
|
||||||
- `yt-transcript`, `yt-frames`, `yt-watch`, `yt-tools`
|
- `yt-transcript`, `yt-frames`, `yt-watch`, `yt-tools`
|
||||||
|
|
||||||
Внешние бинари (любая ОС):
|
**Внешние бинари** (любая ОС):
|
||||||
- `yt-dlp` — fetches metadata + source mp4
|
- `yt-dlp` — fetches metadata + source mp4
|
||||||
- `ffmpeg` — muxes streams + extracts frames
|
- `ffmpeg` — muxes streams + extracts frames
|
||||||
|
|
||||||
Если что-то отсутствует, CLI выдаёт явное `"X not found on PATH"`. Скажи юзеру и стоп.
|
|
||||||
|
|
||||||
Полный install per-OS — в `~/projects/.common/lib/yt-tools/README.md`. **Windows-gotcha:** после `winget install Gyan.FFmpeg` или `winget install yt-dlp.yt-dlp` нужен restart терминала (и Claude Code session) — winget пишет в per-user PATH, который текущий shell не перечитывает.
|
Полный install per-OS — в `~/projects/.common/lib/yt-tools/README.md`. **Windows-gotcha:** после `winget install Gyan.FFmpeg` или `winget install yt-dlp.yt-dlp` нужен restart терминала (и Claude Code session) — winget пишет в per-user PATH, который текущий shell не перечитывает.
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
@@ -51,6 +56,7 @@ CLI entry-points на PATH (из `pip install -e ~/projects/.common/lib/yt-tools
|
|||||||
### Flow A — iterative-watch
|
### Flow A — iterative-watch
|
||||||
|
|
||||||
```
|
```
|
||||||
|
0. Activate venv: & ~/projects/.common/lib/yt-tools/.venv/Scripts/Activate.ps1 (Windows) или source ~/projects/.common/lib/yt-tools/.venv/bin/activate (Linux/macOS)
|
||||||
1. yt-transcript <url> → ./yt-cache/<vid>/transcript.md
|
1. yt-transcript <url> → ./yt-cache/<vid>/transcript.md
|
||||||
2. Read transcript.md, find [mm:ss] anchors that match the question
|
2. Read transcript.md, find [mm:ss] anchors that match the question
|
||||||
3. yt-frames <url> --timestamps 1:23,4:56,… → ./yt-cache/<vid>/frames/frame_*.jpg
|
3. yt-frames <url> --timestamps 1:23,4:56,… → ./yt-cache/<vid>/frames/frame_*.jpg
|
||||||
@@ -58,6 +64,8 @@ CLI entry-points на PATH (из `pip install -e ~/projects/.common/lib/yt-tools
|
|||||||
5. Answer the user, citing both transcript paragraph and frame contents
|
5. Answer the user, citing both transcript paragraph and frame contents
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Альтернатива: skip шаг 0, используй full-path в каждом вызове (см. Prerequisites).
|
||||||
|
|
||||||
**Stdout contract per CLI** (бери последнюю строку, формат зависит от CLI):
|
**Stdout contract per CLI** (бери последнюю строку, формат зависит от CLI):
|
||||||
|
|
||||||
- `yt-transcript`, `yt-watch` — одна строка на stdout: bare absolute path артефакта (`<abs>/transcript.md` или `<abs>/watch.md`).
|
- `yt-transcript`, `yt-watch` — одна строка на stdout: bare absolute path артефакта (`<abs>/transcript.md` или `<abs>/watch.md`).
|
||||||
@@ -68,6 +76,7 @@ Warnings и errors уходят в stderr (`warning: …`, `error: …`); stdout
|
|||||||
### Flow B — targeted-frames
|
### Flow B — targeted-frames
|
||||||
|
|
||||||
```
|
```
|
||||||
|
0. Activate venv: & ~/projects/.common/lib/yt-tools/.venv/Scripts/Activate.ps1 (Windows) или source ~/projects/.common/lib/yt-tools/.venv/bin/activate (Linux/macOS)
|
||||||
1. Parse user's timestamps (mm:ss / h:mm:ss / bare seconds — все работают)
|
1. Parse user's timestamps (mm:ss / h:mm:ss / bare seconds — все работают)
|
||||||
2. yt-frames <url> --timestamps 1:23,4:56,… → ./yt-cache/<vid>/frames/frame_*.jpg
|
2. yt-frames <url> --timestamps 1:23,4:56,… → ./yt-cache/<vid>/frames/frame_*.jpg
|
||||||
3. Read each frame_*.jpg
|
3. Read each frame_*.jpg
|
||||||
|
|||||||
Reference in New Issue
Block a user