LearnOS docs
CLI

YouTube

Capture a YouTube video as a lesson, then author it from the transcript.

Turn a YouTube video into a LearnOS lesson. Capture is a two-step flow:

  1. Capture (youtube add) — fetch the video's timestamped transcript (captions), store the raw segments, and write a transcript-derived scaffold as the lesson body. This creates a video lesson, indexed for search immediately.
  2. Author — read the transcript (transcript), synthesize a polished, research-enriched lesson, and write it back with lesson set-content.

youtube add fetches from youtube.com, so your machine must be able to reach YouTube. Captions-only in v1 — videos without captions are reported clearly; speaker diarization is future work. Once a lesson exists, all the usual lesson tools (notes, highlights, flashcards, chat, reviews) work on it unchanged.

Capture

youtube add

Capture a YouTube video as a video lesson: fetch its timestamped transcript, store the raw segments, and write a transcript scaffold.

Parameters
NameTypeDefaultDescription
<url>*stringYouTube URL or 11-char video id (positional).
--coursestringAppend to this course id. Omit to create a new 1-video course.
--titlestringCourse title when creating (defaults to the video title).
--group-secondsnumber90Transcript scaffold section length, in seconds.
--forcebooleanfalseRe-fetch and replace an existing lesson's raw transcript. Leaves content_md (scaffold/authored lesson) untouched.
--formatjson | textjsonOutput format.
Returns
course_id, lesson_id, segment count, duration, and whether an existing capture was reused/refreshed. Searchable immediately.

Re-capturing the same video is idempotent — it returns the existing lesson rather than duplicating it (scoped to the target course when --course is set, so the same video can intentionally live in two courses). Pass --force to re-pull updated captions: it replaces the raw transcript segments only and leaves content_md (your scaffold or authored lesson) untouched.

Read the transcript

transcript

Print a video lesson's raw timestamped transcript — the source for authoring.

Parameters
NameTypeDefaultDescription
<lesson_id>*stringThe video lesson's UUID (positional).
--formatjson | textjsonOutput format. Text mode is `[h:mm:ss] text` per line.
Returns
The transcript segments (start/end seconds, optional speaker, text).

Author the lesson

lesson set-content

Overwrite a lesson's markdown body (the authoring write-back) and re-index it.

Parameters
NameTypeDefaultDescription
<lesson_id>*stringThe lesson UUID to overwrite (positional).
--filestringPath to a markdown file. If omitted, read from stdin.
--formatjson | textjsonOutput format.
Returns
Confirmation that content was replaced. Searchable immediately.

To make a section seek the video player, place an HTML comment <!--t:SECONDS--> right after a heading. The chunker lifts it into the chunk's start_seconds (and strips it from the rendered/searched body):

## Why attention scales
<!--t:412-->

The key idea introduced around the 7-minute mark is…

End to end

# 1. Capture (your machine needs YouTube access). Creates a 1-video course.
learnos youtube add "https://youtu.be/VIDEO_ID" --format text
# → captured lesson <LID> (course <CID>) — N segments

# 2. Read the transcript while authoring (or use the MCP get_transcript tool).
learnos transcript <LID> --format text > transcript.txt

# 3. Write the synthesized, research-enriched lesson back.
learnos lesson set-content <LID> --file ./authored-lesson.md

The authoring step (2–3) is where supplemental research and resources come in — do it by hand, or let an agent drive the MCP get_transcriptupdate_lesson_content tools alongside a research workflow.

On this page

Command Palette

Search for a command to run...