CLI overview
Query courses, lessons, sections, and ask the knowledge base from your terminal.
The learnos CLI talks to your hosted LearnOS workspace over HTTP using 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. Until release, run the same
commands from a checkout of the LearnOS repo via pnpm learnos -- <command>
(see the contributor guide).
Install
npm i -g learnos # or: pnpm add -g learnosAuthenticate
Issue a token from learnosapp.com under Settings → Personal access tokens (see Getting started), then export it:
export LEARNOS_TOKEN=los_...The CLI sends this token as a Bearer header on every request; calls run under
your row-level security and are recorded in your usage log.
Commands
| Command | Purpose |
|---|---|
courses | List courses with completion progress. |
course create --title T [--source-url U] | Create a new empty course. |
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. |
lesson add --course ID [--title T] [--module M] [--file F | stdin] | Append one markdown doc as a lesson. |
lesson add-md --course ID [--file F | stdin] | Split one doc into many lessons (H2/H3). |
chunk get <lesson_id> <anchor> | One section by anchor. |
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. |
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