lifterlms / lifterlms-cli
WP CLI commands for LifterLMS
Package info
github.com/gocodebox/lifterlms-cli
Type:wordpress-plugin
pkg:composer/lifterlms/lifterlms-cli
Requires
- php: >=7.4
Requires (Dev)
- lifterlms/lifterlms-cs: dev-trunk
- lifterlms/lifterlms-tests: ^4.3
This package is auto-updated.
Last update: 2026-07-16 15:26:33 UTC
README
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.
Installation
Install as a WP-CLI package:
wp package install gocodebox/lifterlms-cli
Or clone into your wp-content/plugins directory:
cd wp-content/plugins
git clone https://github.com/gocodebox/lifterlms-cli.git
Requirements:
Quick Start
# 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=42
Commands
Resource Commands
All 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 |
Course Sub-Resource Commands
| Command | Description |
|---|---|
wp llms course content <id> |
Get course structure (sections + lessons) |
wp llms course enrollments <id> |
List students enrolled in a course |
Management Commands
| 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 |
Output Formats
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=count
Limit output to specific fields:
wp llms course list --fields=id,title,status --format=json
Get just the ID after creating/updating:
wp llms course create --title="My Course" --porcelain # Returns: 42
Using with AI Agents
The 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
Remote Sites
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/html
wp @staging llms course list wp @production llms student list --format=json
Documentation
Full command reference is available at developer.lifterlms.com/cli/commands and in the docs/ directory.
Contributing
Please follow the contribution guidelines put forth by the LifterLMS core.