CLI overview
Query courses, lessons, sections, and ask the knowledge base from your terminal.
The learnos CLI talks to your hosted LearnOS workspace using
browser OAuth (recommended) or a
personal access token.
It exposes the same primitives the web app and MCP server expose — listing
courses, searching, reading lessons, adding flashcards and notes, asking the
knowledge base, and inspecting progress.
Not yet published
The published learnos binary is planned but not yet shipped. This
reference documents the intended interface.
Install
npm i -g learnos # or: pnpm add -g learnosAuthenticate
learnos login # browser OAuth → ~/.config/learnos/credentials.json
learnos whoamiOr export a PAT for CI: export LEARNOS_TOKEN=los_.... See
CLI auth for details and resolution order.
Commands
| Command | Purpose |
|---|---|
login / logout / whoami | Browser OAuth session management. |
courses | List courses with completion progress. |
search <query> [--course C] [--limit N] | Hybrid FTS + vector search. |
lesson get <id> | Full lesson markdown. |
lesson list --course C [--module M] | Lessons in a course / module. |
chunk get <lesson_id> <anchor> | One section by anchor. |
transcript <lesson_id> | A video lesson's timestamped transcript. |
flashcard add --lesson ID --question Q --answer A | Create a flashcard. |
note add --lesson ID [--content … | stdin] | Append a note entry. |
ask <question> [--course C] [--limit N] [--model M] | One-shot RAG answer. |
progress <course> | Where you left off in one course, plus recent activity. |
activity [--course C] [--lesson L] [--kinds K1,K2] [--limit N] | Recent activity across your library. |
audio generate --scope lesson|module|course … / audio get <id> / audio url <id> | Spoken overviews (mp3). |
presentation … | Slide decks — see Presentations. |
course quality <id-or-title> [--verbose] | Score a course on the six-category quality rubric. |
Global flags
--format json|text— output format. Defaults tojson, exceptaskwhich defaults totext.-h,--help— usage.
Scoping with --course
--course accepts either a course id or a title substring (case-insensitive).
Omit it to search the whole library.
learnos search "promises" --course "Web Development" --format text