Skip to content

ulams course

Generated from front/cli (ulams schema)

Read edits made in the LMS after the last apply back into a proposed version of the course.

An admin who edits a lesson, a question or the course details in the LMS after an apply changes the live course but not the blueprint. This asks the server to read those edits back into a proposed version (kind author), for titles, summaries, lesson text (block by block) and question wording. Nothing is applied and nothing is approved: review it with course diff --version <id>, approve it (a person only: course apply --approve, or the studio), then course pull brings it into the folder. Edits that cannot be expressed in the blueprint (HTML from the visual editor, added paragraphs, changed correct answers, the landing page) are listed as unmapped and the blueprint keeps its value; where the blueprint changed too, the studio is the place to resolve it. –preview lists what would be read back and stores nothing.

Kind: write. Stability: stable. MCP tool: course_absorb_drift. Scopes: builder:write.

Endpoints: POST /api/admin/course-as-code/sessions/{session}/drift.

Flag Type Required Description
--session (positional) string Builder session id. Default: the one in .ulams/base.json of the course folder.
--dir string Course folder (the one holding ulams.yaml). Default: the current directory.
--preview boolean List what would be read back; store no version.
Terminal window
# See what admins changed in the LMS
ulams course absorb-drift --preview
# Read the edits back into a proposed version
ulams course absorb-drift
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"session": {
"description": "Builder session id. Default: the one in .ulams/base.json of the course folder.",
"type": "string"
},
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"preview": {
"description": "List what would be read back; store no version.",
"type": "boolean"
}
}
}

Apply the course’s current version to the live course; with –approve, approve the proposed version first.

Writes the course through the course services as an unpublished draft (publish with course publish). Run it in the course folder, or pass the session. When the folder has a proposal from course push that nobody approved, apply refuses with CONFIRMATION_REQUIRED (exit 11) unless you pass –approve, which approves it first: only a person can (a login, or a CLI token you created). Agent tokens and MCP clients are refused with APPROVAL_REQUIRES_HUMAN. –version approves a specific proposed version. Waits for the apply to finish unless –no-wait (the folder’s course id is needed to wait).

Kind: write. Stability: stable. MCP tool: course_apply. Scopes: builder:write.

Endpoints: POST /api/admin/course-as-code/sessions/{session}/apply.

Flag Type Required Description
--session (positional) string Builder session id. Default: the one in .ulams/base.json of the course folder.
--dir string Course folder (the one holding ulams.yaml). Default: the current directory.
--version string The proposed version to approve (default: the one course push proposed).
--approve boolean Approve the proposed version before applying (people and CLI tokens only).
--overwrite boolean Overwrite edits an admin made in the course since the last apply.
Terminal window
# Approve what you pushed and apply it
ulams course apply --approve
# Apply a version someone approved in the studio
ulams course apply
# Apply a session without a folder
ulams course apply <session> --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"session": {
"description": "Builder session id. Default: the one in .ulams/base.json of the course folder.",
"type": "string"
},
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"version": {
"description": "The proposed version to approve (default: the one `course push` proposed).",
"type": "string"
},
"approve": {
"description": "Approve the proposed version before applying (people and CLI tokens only).",
"type": "boolean"
},
"overwrite": {
"description": "Overwrite edits an admin made in the course since the last apply.",
"type": "boolean"
}
}
}

Approve a proposed import so it becomes the course’s current version.

Only a person can approve: a login, or a CLI token you created. Agent tokens and MCP clients are refused (APPROVAL_REQUIRES_HUMAN); CI tokens only when the tenant allows it. Approving does not change what learners see; run course apply next. Refused with STALE_PROPOSAL when the course changed after the import was proposed.

Kind: write. Stability: stable. MCP tool: course_approve. Scopes: builder:write.

Endpoints: POST /api/admin/course-as-code/versions/{version}/approve.

Flag Type Required Description
--version (positional) string yes Version id (data.version.id of course import).
Terminal window
# Approve
ulams course approve <version> --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"version": {
"type": "string",
"description": "Version id (data.version.id of `course import`)."
}
},
"required": [
"version"
]
}

Compare any two versions or releases of a course: moved elements, citations, quiz answer keys and a plain summary.

The semantic diff of two versions or releases of one builder course (ids from course releases, or version ids from course export). It lists added, removed, changed, moved and reordered elements, the citations that changed (repointed ones when the source moved), quiz answer-key changes with what learners would get, and what learners would notice. Swap –from and –to for the reverse. A variant course can be compared with its base: pass a version of each. Works with AI switched off and makes no model call. Pass –json for the payload the studio and the MCP tool use (diffVersion 1). Same as course diff <folder> --course <id> --from <a> --to <b>. Visible to the course author and admins.

Kind: read (idempotent). Stability: stable. MCP tool: course_compare. Scopes: builder:read.

Endpoints: GET /api/admin/course-versions/courses/{course}/compare.

Flag Type Required Description
--course (positional) string yes Course id.
--from string yes The older side: a version id or a release id.
--to string yes The newer side: a version id or a release id.
Terminal window
# What changed between two releases
ulams course compare 12 --from 01jb0000000000000000000001 --to 01jb0000000000000000000002
# For a script
ulams course compare 12 --from 01jb0000000000000000000001 --to 01jb0000000000000000000002 --fields data.summary --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"course": {
"type": "string",
"pattern": "^\\d+$",
"description": "Course id."
},
"from": {
"type": "string",
"pattern": "^[0-9a-z]{26}$",
"description": "The older side: a version id or a release id."
},
"to": {
"type": "string",
"pattern": "^[0-9a-z]{26}$",
"description": "The newer side: a version id or a release id."
}
},
"required": [
"course",
"from",
"to"
]
}

Show what changed: the folder against its base (offline), against the server (–remote), a version on the server (–version), or any two versions or releases (–from, –to).

By default compares the folder with the version it is based on (.ulams/base.json): which elements were added, changed or removed, with no network. –remote fetches the server’s current version and shows, field by field, what a push would change. –version shows what a version on the server changes against its parent (or –against another version). –from –to compares any two versions or releases of the course in full (moved elements, citations, quiz answer keys, a plain summary; the same as course compare); the course is the folder’s, or pass –course . –exit-code exits 13 (DIFF_FOUND) when there are differences, for CI.

Kind: read (idempotent). Stability: stable. MCP tool: course_diff (not exposed). Scopes: builder:read.

Endpoints: GET /api/admin/course-as-code/versions/{version}/diff, GET /api/admin/course-versions/courses/{course}/compare.

Flag Type Required Description
--dir (positional) string Course folder (the one holding ulams.yaml). Default: the current directory.
--from string With –to: the older side, a version id or a release id.
--to string With –from: the newer side, a version id or a release id.
--course string With –from and –to: the course (default: the course of the folder).
--remote boolean Compare with the server’s current version instead of the base.
--version string Show what this version on the server changes against its parent.
--against string With –version: another version id to compare with.
--exit-code boolean Exit 13 when there are differences.
Terminal window
# What did I change since the last pull
ulams course diff
# What would a push change on the server
ulams course diff --remote
# Fail CI when the folder drifted
ulams course diff --exit-code --json
# Review a proposed version
ulams course diff --version <version id>
# What changed between two releases
ulams course diff --course 12 --from 01jb0000000000000000000001 --to 01jb0000000000000000000002
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"from": {
"description": "With --to: the older side, a version id or a release id.",
"type": "string",
"pattern": "^[0-9a-z]{26}$"
},
"to": {
"description": "With --from: the newer side, a version id or a release id.",
"type": "string",
"pattern": "^[0-9a-z]{26}$"
},
"course": {
"description": "With --from and --to: the course (default: the course of the folder).",
"type": "string",
"pattern": "^\\d+$"
},
"remote": {
"description": "Compare with the server's current version instead of the base.",
"type": "boolean"
},
"version": {
"description": "Show what this version on the server changes against its parent.",
"type": "string"
},
"against": {
"description": "With --version: another version id to compare with.",
"type": "string"
},
"exitCode": {
"description": "Exit 13 when there are differences.",
"type": "boolean"
}
}
}

Export a course as a Blueprint v3 document.

The current version of the course as one JSON document (data.document), with its version id, the applied version id and any drift. Pass –out to write the whole payload to a file that course import --file accepts. Works with AI switched off. A course that was not made with the builder has no blueprint yet (NOT_ADOPTED).

Kind: read (idempotent). Stability: stable. MCP tool: course_export. Scopes: builder:read.

Endpoints: GET /api/admin/course-as-code/courses/{course}/blueprint.

Flag Type Required Description
--course (positional) string yes Course id.
Terminal window
# Export to a file
ulams course export 12 --out blueprint.json --json
# Print the version ids
ulams course export 12 --fields data.versionId,data.sessionId --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"course": {
"type": "string",
"pattern": "^\\d+$",
"description": "Course id."
}
},
"required": [
"course"
]
}

Format a course folder: canonical YAML, ids, directives, numeric prefixes.

Rewrites the files in place: YAML keys in canonical order (comments stay), ids minted for elements without one, loose Markdown wrapped in author paragraphs, directives printed in one form, module and lesson prefixes renumbered (01-, 02-, …), asset sha256 and size filled. Running it twice changes nothing the second time. –check changes nothing and exits 13 when files would change. Files with syntax errors stop it (exit 7); run course validate for the details.

Kind: local. Stability: stable. MCP tool: course_fmt (not exposed). Scopes: none.

Flag Type Required Description
--dir (positional) string Course folder (the one holding ulams.yaml). Default: the current directory.
--check boolean Only report the files that would change; exit 13 when there are any.
Terminal window
# Format the current folder
ulams course fmt
# Fail CI when the folder is not formatted
ulams course fmt --check
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"check": {
"description": "Only report the files that would change; exit 13 when there are any.",
"type": "boolean"
}
}
}

Import an edited blueprint as a proposed version (nothing changes for learners until it is approved and applied).

Validates the document against Blueprint v3 and the deterministic checks, then stores it as a proposed version of kind import and returns the element diff. A push that equals the current version creates nothing (data.unchanged). A push based on an older version than the server’s is refused with BASE_OUTDATED and the remote diff; export again first. Elements written by hand set origin: author and may have no citations; AI-written elements must cite.

Kind: write. Stability: stable. MCP tool: course_import. Scopes: builder:write.

Endpoints: POST /api/admin/course-as-code/sessions/{session}/imports.

Flag Type Required Description
--session (positional) string Builder session id (data.sessionId of course export).
--file string yes JSON file: a blueprint document, or the file written by course export --out. - reads stdin.
--base string Version the document was exported from (default: data.versionId of the exported file).
--message string Why, shown in the version history.
Terminal window
# Push an edit
ulams course import --file blueprint.json --message 'Fix the install step' --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"session": {
"type": "string",
"description": "Builder session id (data.sessionId of `course export`)."
},
"file": {
"type": "string",
"description": "JSON file: a blueprint document, or the file written by `course export --out`. `-` reads stdin."
},
"base": {
"description": "Version the document was exported from (default: data.versionId of the exported file).",
"type": "string"
},
"message": {
"description": "Why, shown in the version history.",
"type": "string",
"maxLength": 500
}
},
"required": [
"file"
]
}

Create a course folder from a course made with the builder (Markdown and YAML, bound to the course).

Reads the course’s current version from the server and writes it as a course folder (ulams.yaml, course.yaml, modules/…), then records where it stands in .ulams/base.json (commit it). The folder must be empty (a README, a LICENSE and dot files may be there). Only courses made with the course builder have a blueprint (a hand-made one is refused with NOT_ADOPTED). Works with AI switched off. With –dry-run it lists the files and writes nothing.

Kind: read (idempotent). Stability: stable. MCP tool: course_init (not exposed). Scopes: builder:read.

Endpoints: GET /api/admin/course-as-code/courses/{course}/blueprint.

Flag Type Required Description
--dir (positional) string Course folder (the one holding ulams.yaml). Default: the current directory.
--from-course string Course id on the server (required: scaffolding an empty course folder comes with course creation).
--ci string Also write the CI workflow for this host (.github/workflows/ulams.yml at the repository root): validate and preview on pull requests, push on merge, hourly sync pull request.
Terminal window
# Pull a course into a new folder
ulams course init ./kubernetes-101 --from-course 12
# See what would be written
ulams course init ./kubernetes-101 --from-course 12 --dry-run --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"fromCourse": {
"description": "Course id on the server (required: scaffolding an empty course folder comes with course creation).",
"type": "string",
"pattern": "^\\d+$"
},
"ci": {
"description": "Also write the CI workflow for this host (.github/workflows/ulams.yml at the repository root): validate and preview on pull requests, push on merge, hourly sync pull request.",
"type": "string",
"enum": [
"github"
]
}
}
}

Publish the applied course so learners can enrol.

Runs the publish check and publishes. Blocking items stop it (CONFLICT, error.details.blocking); warnings stop it until you have read them and pass –acknowledge-warnings (CONFIRMATION_REQUIRED, error.details.warnings). The course must be applied first. Run it in the course folder, or pass the session.

Kind: write (idempotent). Stability: stable. MCP tool: course_publish. Scopes: builder:write.

Endpoints: POST /api/admin/course-as-code/sessions/{session}/publish.

Flag Type Required Description
--session (positional) string Builder session id. Default: the one in .ulams/base.json of the course folder.
--dir string Course folder (the one holding ulams.yaml). Default: the current directory.
--acknowledge-warnings boolean Acknowledge the publish warnings after reviewing them.
Terminal window
# Publish from the course folder
ulams course publish
# Publish after reading the warnings
ulams course publish --acknowledge-warnings --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"session": {
"description": "Builder session id. Default: the one in .ulams/base.json of the course folder.",
"type": "string"
},
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"acknowledgeWarnings": {
"description": "Acknowledge the publish warnings after reviewing them.",
"type": "boolean"
}
}
}

Bring the folder up to date with the server’s current version (merging your edits with theirs).

Fetches the course’s current version. A folder without local edits is rewritten to match it (files you renamed keep their names, files for removed lessons are deleted, assets and your own files are never touched) and the base moves forward. A folder that already equals the server’s version only moves the base. A folder with local edits is left alone when the server did not change. When both changed, pull merges element by element (three-way, against the version the folder is based on): what only one side changed is taken, and an element both sides changed differently stays as you have it and gets a conflict file in .ulams/conflicts/ (base, yours, the server’s, a diff and a Resolution section) that ulams course resolve settles; pull then exits 6 (SYNC_CONFLICT) with the list. Files the merge does not touch keep your formatting. The base moves to the server’s version, so diff afterwards shows what a push would send. While conflicts are open, pull and push refuse. –dry-run reports what would be merged and written.

Kind: read (idempotent). Stability: stable. MCP tool: course_pull (not exposed). Scopes: builder:read.

Endpoints: GET /api/admin/course-as-code/courses/{course}/blueprint.

Flag Type Required Description
--dir (positional) string Course folder (the one holding ulams.yaml). Default: the current directory.
Terminal window
# Update the folder
ulams course pull
# Preview
ulams course pull --dry-run --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
}
}
}

Propose the folder as a new version of the course (nothing changes for learners until it is approved and applied).

Validates the folder, sends it as a proposed version of kind import based on the version in .ulams/base.json, and prints what it changes. Nothing reaches learners: a person approves the version (in the studio, or –approve / –apply here) and it is applied. –approve approves it; –apply approves and applies it (waiting for the apply unless –no-wait). Agent tokens and MCP clients can only propose: approving is refused with APPROVAL_REQUIRES_HUMAN and the proposal stays (see ulams course apply). A push also waits (SYNC_CONFLICT, exit 6) while an open Living Course update proposal changes elements the push changes too; decide the proposal, or pass –allow-pending. If the server moved on since the base, the server merges what the two sides changed separately and proposes the merged version; when both changed the same element it stops with SYNC_CONFLICT (exit 6) and lists the elements: run ulams course pull to merge them into the folder and settle them with ulams course resolve. Push also refuses while a conflict file is open. A folder equal to its base sends nothing. –dry-run validates and shows what would be sent.

Kind: write. Stability: stable. MCP tool: course_push (not exposed). Scopes: builder:write.

Endpoints: POST /api/admin/course-as-code/sessions/{session}/imports.

Flag Type Required Description
--dir (positional) string Course folder (the one holding ulams.yaml). Default: the current directory.
--message string Why, shown in the version history.
--approve boolean Approve the proposal after pushing it (people and CLI tokens only).
--apply boolean Approve and apply it; waits for the apply unless –no-wait.
--overwrite boolean With –apply: overwrite edits an admin made in the LMS since the last apply.
--allow-pending boolean Store the push although an open Living Course update proposal changes the same elements (the proposal’s items for them become conflicts).
Terminal window
# Propose a change for review
ulams course push --message 'Fix the install step'
# Push although an update proposal is open on the same elements
ulams course push --allow-pending
# Propose, approve and apply as yourself
ulams course push --apply
# Validate and preview without sending
ulams course push --dry-run --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"message": {
"description": "Why, shown in the version history.",
"type": "string",
"maxLength": 500
},
"approve": {
"description": "Approve the proposal after pushing it (people and CLI tokens only).",
"type": "boolean"
},
"apply": {
"description": "Approve and apply it; waits for the apply unless --no-wait.",
"type": "boolean"
},
"overwrite": {
"description": "With --apply: overwrite edits an admin made in the LMS since the last apply.",
"type": "boolean"
},
"allowPending": {
"description": "Store the push although an open Living Course update proposal changes the same elements (the proposal's items for them become conflicts).",
"type": "boolean"
}
}
}

Show one release of a course with the blueprint document of its version.

One release (see course releases) with data.document, the Blueprint v3 document that learners got at that moment. Pass –out to write the whole payload to a file. Works with AI switched off. Visible to the course author and admins.

Kind: read (idempotent). Stability: stable. MCP tool: course_release. Scopes: builder:read.

Endpoints: GET /api/admin/course-versions/releases/{release}.

Flag Type Required Description
--release (positional) string yes Release id.
Terminal window
# Save what learners got in release 3
ulams course release 01jb0000000000000000000003 --out release-3.json --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"release": {
"type": "string",
"pattern": "^[0-9a-z]{26}$",
"description": "Release id."
}
},
"required": [
"release"
]
}

List the releases of a course: the versions learners actually got, newest first.

A release is written by every successful apply (the first generation, an author or chat edit, an accepted source update, an insights improvement, a course-as-code push, an undo or restore). Each shows its number, when it went live, what started it, who approved it and what changed since the previous release. Proposals, rejections and undone versions are not releases. Works with AI switched off. A course that was not made with the builder has no releases (NOT_FOUND). Visible to the course author and admins.

Kind: read (idempotent). Stability: stable. MCP tool: course_releases. Scopes: builder:read.

Endpoints: GET /api/admin/course-versions/courses/{course}/releases.

Flag Type Required Description
--course (positional) string yes Course id.
--page integer
--per-page integer Releases per page (default 25, at most 100).
Terminal window
# The releases of a course
ulams course releases 12
# For a script
ulams course releases 12 --fields data.releases --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"course": {
"type": "string",
"pattern": "^\\d+$",
"description": "Course id."
},
"page": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"perPage": {
"description": "Releases per page (default 25, at most 100).",
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
"required": [
"course"
]
}

Settle one conflict that course pull left in .ulams/conflicts/.

Each conflict is an element both you and the server changed differently. –take local keeps your version (the folder already has it), –take remote replaces the element (and what is inside it) with the server’s version, –take file reads the Resolution section of .ulams/conflicts/.md, which you edit first: a block as a directive, any other element as YAML, or the word (removed). The conflict file is deleted when the element is settled; when none are left, validate and push. The server’s version comes from the version the folder is based on (GET versions/{version}); –take local needs no request. –dry-run shows the files that would change.

Kind: read (idempotent). Stability: stable. MCP tool: course_resolve (not exposed). Scopes: builder:read.

Endpoints: GET /api/admin/course-as-code/versions/{version}.

Flag Type Required Description
--element (positional) string yes The element id (the file name in .ulams/conflicts/ without .md).
--take string yes local: keep yours. remote: take the server’s. file: use the edited Resolution section.
--dir string Course folder (the one holding ulams.yaml). Default: the current directory.
Terminal window
# Keep your version of a block
ulams course resolve 01j9z8aaaaaaaaaaaaaaaaaaaa --take local
# Take the server's version
ulams course resolve 01j9z8aaaaaaaaaaaaaaaaaaaa --take remote
# Use the text you edited in the conflict file
ulams course resolve 01j9z8aaaaaaaaaaaaaaaaaaaa --take file
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"element": {
"type": "string",
"minLength": 1,
"description": "The element id (the file name in .ulams/conflicts/ without .md)."
},
"take": {
"type": "string",
"enum": [
"local",
"remote",
"file"
],
"description": "local: keep yours. remote: take the server's. file: use the edited Resolution section."
},
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
}
},
"required": [
"element",
"take"
]
}

Let Living Course watch this repository’s sources/ folder, so a merged change to the sources proposes updates to the course.

Reads the origin remote and the default branch of the Git repository around the course folder and connects it to the course’s builder session as a Living Course git source that follows sources/** (override with –paths). A merged change to a file in sources/ then reaches Living Course through the host’s push webhook (or ulams living connections check <connection> --commit $GITHUB_SHA from CI) and becomes an update proposal that names the pull request it came from; a merged change to modules/ never does (the Action pushes those as course versions). github.com and gitlab.com are recognised; for any other host pass –host gitlab or –host gitea (Forgejo too). For a private repository pass –token (or set ULAMS_SOURCES_TOKEN): a read-only access token, stored encrypted on the server. The answer shows the webhook address and the webhook secret once; add both to the repository’s webhook settings (content type JSON, push events). Needs a folder created with ulams course init, and the repository must already hold at least one file under sources/ on that branch.

Kind: write. Stability: stable. MCP tool: course_sources_connect (not exposed). Scopes: living-course:write.

Endpoints: POST /api/admin/living-course/sessions/{session}/sources/connect.

Flag Type Required Description
--dir (positional) string Course folder (the one holding ulams.yaml). Default: the current directory.
--host string Git host software for a host other than github.com and gitlab.com (gitea also means Forgejo).
--branch string Branch to follow. Default: the remote’s default branch.
--paths array Globs of the source files. Default: sources/**.
--token string Read-only access token for a private repository (write-only; ULAMS_SOURCES_TOKEN also works).
--schedule string Polling schedule besides the webhook (default: daily).
Terminal window
# Watch sources/ of the repository the folder is in
ulams course sources-connect
# A self-hosted Forgejo
ulams course sources-connect --host gitea --token $FORGEJO_TOKEN
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"host": {
"description": "Git host software for a host other than github.com and gitlab.com (gitea also means Forgejo).",
"type": "string",
"enum": [
"github",
"gitlab",
"gitea"
]
},
"branch": {
"description": "Branch to follow. Default: the remote's default branch.",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"paths": {
"description": "Globs of the source files. Default: sources/**.",
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 255
}
},
"token": {
"description": "Read-only access token for a private repository (write-only; ULAMS_SOURCES_TOKEN also works).",
"type": "string",
"minLength": 1
},
"schedule": {
"description": "Polling schedule besides the webhook (default: daily).",
"type": "string",
"enum": [
"hourly",
"daily",
"weekly",
"manual"
]
}
}
}

Where the folder stands: local edits, the server’s version, what is applied, a proposal waiting for approval.

One request to the server plus the folder. Reports local edits since the base, whether the server moved on (behind), a proposal you pushed and nobody has approved, whether the current version is applied, drift (elements edited in the LMS since the last apply) and open conflicts, and suggests the next command. Always exits 0.

Kind: read (idempotent). Stability: stable. MCP tool: course_status (not exposed). Scopes: builder:read.

Endpoints: GET /api/admin/course-as-code/courses/{course}/blueprint.

Flag Type Required Description
--dir (positional) string Course folder (the one holding ulams.yaml). Default: the current directory.
Terminal window
# Check before pushing
ulams course status --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
}
}
}

Check a course folder offline: files, directive grammar, Blueprint v3 and the deterministic checks.

Reads the course folder (ulams.yaml, course.yaml, modules/) and reports every problem by file, line and column. No server, no network. Errors exit 7 (VALIDATION_FAILED); with –strict warnings do too. –fix first applies what course fmt does (ids, loose Markdown, order prefixes, asset hashes). –format sarif prints SARIF 2.1.0 for code scanning; –out writes it to a file instead.

Kind: local. Stability: stable. MCP tool: course_validate (not exposed). Scopes: none.

Flag Type Required Description
--dir (positional) string Course folder (the one holding ulams.yaml). Default: the current directory.
--fix boolean Apply course fmt first (mint missing ids, wrap loose Markdown, renumber, fill asset hashes).
--strict boolean Treat warnings as failures.
--format string text (default in a terminal), json (the usual envelope) or sarif (SARIF 2.1.0 on stdout, or in –out).
Terminal window
# Validate the current folder
ulams course validate
# Validate a folder and fix what is mechanical
ulams course validate ./kubernetes-101 --fix
# SARIF for GitHub code scanning
ulams course validate --format sarif --out ulams.sarif
# Machine-readable issues
ulams course validate --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"dir": {
"description": "Course folder (the one holding ulams.yaml). Default: the current directory.",
"type": "string"
},
"fix": {
"description": "Apply `course fmt` first (mint missing ids, wrap loose Markdown, renumber, fill asset hashes).",
"type": "boolean"
},
"strict": {
"description": "Treat warnings as failures.",
"type": "boolean"
},
"format": {
"description": "text (default in a terminal), json (the usual envelope) or sarif (SARIF 2.1.0 on stdout, or in --out).",
"type": "string",
"enum": [
"text",
"json",
"sarif"
]
}
}
}

Add a variant for a level, a role or both; –start drafts the outlines of the waiting variants.

The base course must be applied first (409 otherwise). Without –start the variant is only created; with –start the builder drafts one outline per waiting variant from the same sources (one cheap model call each, logged against the variant) and you review each as a diff against the base in the studio or with builder outline show. More variants than COURSE_BUILDER_MAX_VARIANTS are refused (422).

Kind: write. Stability: stable. MCP tool: course_variants_add. Scopes: builder:write.

Endpoints: POST /api/admin/course-builder/sessions/{session}/variants.

Flag Type Required Description
--session (positional) string yes Builder session id (from ulams builder sessions list).
--level string Level of the audience.
--role string Role of the audience, e.g. developer.
--label string Name learners see (default: the level and the role).
--notes string What this audience already knows or needs, as plain text.
--start boolean Draft the outlines of the waiting variants now.
Terminal window
# An expert version for developers
ulams course variants add <session> --level expert --role developer --start --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"session": {
"type": "string",
"description": "Builder session id (from `ulams builder sessions list`)."
},
"level": {
"description": "Level of the audience.",
"type": "string",
"enum": [
"beginner",
"intermediate",
"expert"
]
},
"role": {
"description": "Role of the audience, e.g. developer.",
"type": "string",
"maxLength": 64
},
"label": {
"description": "Name learners see (default: the level and the role).",
"type": "string",
"maxLength": 120
},
"notes": {
"description": "What this audience already knows or needs, as plain text.",
"type": "string",
"maxLength": 600
},
"start": {
"default": false,
"description": "Draft the outlines of the waiting variants now.",
"type": "boolean"
}
},
"required": [
"session"
]
}

Variants of a course by level and role: status, own course, drift from the base, the cap and the cost estimate.

A variant is a branch of one builder session: it shares the sources and citations, is drafted from the approved base course and, once approved, becomes its own course grouped with the base. data.cap is COURSE_BUILDER_MAX_VARIANTS, data.estimate the cost of drafting the variants that are still waiting, in micro-USD (1,000,000 = 1 USD). data.base.ready is false until the base course is applied.

Kind: read (idempotent). Stability: stable. MCP tool: course_variants_list. Scopes: builder:read.

Endpoints: GET /api/admin/course-builder/sessions/{session}/variants.

Flag Type Required Description
--session (positional) string yes Builder session id (from ulams builder sessions list).
Terminal window
# List the variants
ulams course variants list <session> --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"session": {
"type": "string",
"description": "Builder session id (from `ulams builder sessions list`)."
}
},
"required": [
"session"
]
}

Retire a variant (its course, if it has one, is kept).

A retired variant no longer counts against the cap and is not offered; learners already in its course keep their progress.

Kind: destructive (idempotent). Stability: stable. MCP tool: course_variants_retire. Scopes: builder:write.

Endpoints: DELETE /api/admin/course-builder/variants/{variant}.

Flag Type Required Description
--variant (positional) string yes Variant id (from course variants list).
Terminal window
# Retire
ulams course variants retire <variant> --yes --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"variant": {
"type": "string",
"description": "Variant id (from `course variants list`)."
}
},
"required": [
"variant"
]
}

Rename or reorder a variant.

Kind: write (idempotent). Stability: stable. MCP tool: course_variants_update. Scopes: builder:write.

Endpoints: PATCH /api/admin/course-builder/variants/{variant}.

Flag Type Required Description
--variant (positional) string yes Variant id (from course variants list).
--label string
--position integer
--notes string
Terminal window
# Rename
ulams course variants update <variant> --label "Expert, developer" --json
Input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"variant": {
"type": "string",
"description": "Variant id (from `course variants list`)."
},
"label": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"position": {
"type": "integer",
"minimum": 0,
"maximum": 1000
},
"notes": {
"type": "string",
"maxLength": 600
}
},
"required": [
"variant"
]
}