LearnOS docs
CLI

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 learnos

Authenticate

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

CommandPurpose
coursesList 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 ACreate 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 to json, except ask which defaults to text.
  • -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

On this page

Command Palette

Search for a command to run...