WP-CLI commands for LifterLMS. Manage courses, memberships, enrollments, students, and more from the command line.
This is a feature plugin which will be included in the LifterLMS core plugin automatically.
Install as a WP-CLI package:
wp package install gocodebox/lifterlms-cliOr clone into your wp-content/plugins directory:
cd wp-content/plugins
git clone https://github.com/gocodebox/lifterlms-cli.gitRequirements:
# List all courses
wp llms course list
# Get a specific course
wp llms course get 42
# Create a course
wp llms course create --title="Introduction to Python" --status=draft
# Get course structure (sections + lessons)
wp llms course content 42
# List enrolled students
wp llms course enrollments 42
# Enroll a student in a course
wp llms students-enrollments create --student_id=5 --post_id=42
# Check student progress
wp llms students-progress get 5 --post_id=42All resource commands support list, get, create, update, delete, diff, edit, and generate subcommands.
| Command | Description |
|---|---|
wp llms course |
Manage courses |
wp llms section |
Manage sections |
wp llms lesson |
Manage lessons |
wp llms membership |
Manage memberships |
wp llms access-plan |
Manage access plans (pricing) |
wp llms student |
Manage students |
wp llms instructor |
Manage instructors |
wp llms students-enrollments |
Manage student enrollments |
wp llms students-progress |
Manage student progress |
wp llms api-key |
Manage REST API keys |
| Command | Description |
|---|---|
wp llms course content <id> |
Get course structure (sections + lessons) |
wp llms course enrollments <id> |
List students enrolled in a course |
| Command | Description |
|---|---|
wp llms addon |
Manage LifterLMS add-ons (requires LifterLMS Helper) |
wp llms license |
Manage add-on licenses (requires LifterLMS Helper) |
wp llms version |
Display LifterLMS version |
All commands support multiple output formats via --format:
# Default table format
wp llms course list
# JSON (recommended for scripts and AI agents)
wp llms course list --format=json
# CSV
wp llms course list --format=csv
# Just IDs
wp llms course list --format=ids
# YAML
wp llms course list --format=yaml
# Count
wp llms course list --format=countLimit output to specific fields:
wp llms course list --fields=id,title,status --format=jsonGet just the ID after creating/updating:
wp llms course create --title="My Course" --porcelain
# Returns: 42The LifterLMS CLI works with AI coding assistants like Claude Code, Cursor, and Codex. See the AI Agent Guide for detailed patterns and examples.
Key tips:
- Always use
--format=jsonfor structured, parseable output - Use
--fieldsto reduce response size - Use
--porcelainon create/update to get just the new ID - Chain commands with pipes:
wp llms course list --format=ids | xargs -I{} wp llms course get {} --format=json
Use WP-CLI aliases to manage remote sites:
# ~/.wp-cli/config.yml
@staging:
ssh: user@staging.example.com/var/www/html
@production:
ssh: user@example.com/var/www/htmlwp @staging llms course list
wp @production llms student list --format=jsonFull command reference is available at developer.lifterlms.com/cli/commands and in the docs/ directory.
Please follow the contribution guidelines put forth by the LifterLMS core.