CLI
ask
One-shot answer grounded in your course content, with citations.
ask is the one CLI command that calls a model. It retrieves the most
relevant sections from your library, builds the tutor context, sends a single
completion, and prints the answer plus the sources it drew from. The same
retrieval + prompt the chat UI uses, but headless and one-shot.
askSearch your library, build context, one completion, answer + sources. Does not stream, persist a chat, or run tool calls.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| <question>* | string | — | The question (positional). |
| --course | string | — | Course id or title substring to scope retrieval. Omit for the whole library. |
| --limit | integer | 8 | Sections to retrieve for context. |
| --model | string | google/gemini-3.1-flash-lite | Model id (any supported tutor model). |
| --format | text | json | text | text prints answer + sources; json returns { question, model, answer, sources, hits }. |
Returns
In text mode: the answer, then a numbered Sources list (lesson title · heading).
learnos ask "How does event delegation work?" --course "Web Development"
learnos ask "Summarize closures" --format json