Skip to content
This repository was archived by the owner on Jul 17, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
LifterLMS CLI Changelog
=======================

v0.0.6 - 2026-07-16
-------------------

##### New Features

+ Added `wp llms course content <id>` command to retrieve course structure (sections and lessons) in a single call.
+ Added `wp llms course enrollments <id>` command to list students enrolled in a specific course.
+ Added AI agent usage guide (`docs/ai-agents.md`) with patterns for Claude Code, Cursor, Codex, and similar tools.

##### Updates and Enhancements

+ Rewrote README with installation guide, quick start examples, command reference, output format documentation, and AI agent usage section.
+ Updated minimum PHP version to 7.4 (7.3 reached EOL November 2021).

##### Bug Fixes

+ Skip sub-resources routes in discovery, fix bug in list_items/get_item.



v0.0.5 - 2025-01-21
-------------------

Expand Down
154 changes: 144 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
LLMS-CLI
========
LifterLMS CLI
=============

[![Test PHPUnit][img-gh-testing]][link-gh-testing]
[![GitHub Coding Standards Workflow Status][img-gh-cs]][link-gh-cs]
Expand All @@ -8,32 +8,166 @@ LLMS-CLI

---

The LLMS-CLI is a collection of WP-CLI commands for [LifterLMS](https://github.com/gocodebox/lifterlms).
WP-CLI commands for [LifterLMS](https://github.com/gocodebox/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.

---

## Documentation
## Installation

Install as a WP-CLI package:

```bash
wp package install gocodebox/lifterlms-cli
```

Or clone into your `wp-content/plugins` directory:

```bash
cd wp-content/plugins
git clone https://github.com/gocodebox/lifterlms-cli.git
```

**Requirements:**
- PHP 7.4+
- WordPress 5.0+
- [LifterLMS](https://lifterlms.com) 5.0+
- [WP-CLI](https://wp-cli.org/) 2.x

## Quick Start

```bash
# 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 |

Documentation is automatically generated and imported from the [docs/](./docs) directory into the developer hub at [developer.lifterlms.com/cli/commands](https://developer.lifterlms.com/cli/commands/).
### 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 |

## Installing for development
## Output Formats

To install for development either:
All commands support multiple output formats via `--format`:

+ Download the [latest release](https://github.com/gocodebox/lifterlms-cli/releases) and upload to your WordPress site via FTP or add as new plugin.
+ Clone this repository into your `wp-content/plugins` directory.
```bash
# 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:

```bash
wp llms course list --fields=id,title,status --format=json
```

Get just the ID after creating/updating:

```bash
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](docs/ai-agents.md) for detailed patterns and examples.

Key tips:
- Always use `--format=json` for structured, parseable output
- Use `--fields` to reduce response size
- Use `--porcelain` on 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](https://make.wordpress.org/cli/handbook/guides/running-commands-remotely/) to manage remote sites:

```yaml
# ~/.wp-cli/config.yml
@staging:
ssh: user@staging.example.com/var/www/html
@production:
ssh: user@example.com/var/www/html
```

```bash
wp @staging llms course list
wp @production llms student list --format=json
```

## Documentation

Full command reference is available at [developer.lifterlms.com/cli/commands](https://developer.lifterlms.com/cli/commands/) and in the [docs/](./docs) directory.

## Contributing

Please follow the contribution guidelines put forth by the [LifterLMS core](https://github.com/gocodebox/lifterlms/blob/trunk/.github/CONTRIBUTING.md).




[img-cc-coverage]:https://img.shields.io/codeclimate/coverage/gocodebox/lifterlms-cli?style=for-the-badge&logo=code-climate
[img-cc-maintainability]:https://img.shields.io/codeclimate/maintainability/gocodebox/lifterlms-cli?logo=code-climate&style=for-the-badge
[img-gh-testing]:https://img.shields.io/github/workflow/status/gocodebox/lifterlms-cli/Test%20PHPUnit?label=tests&logo=github&style=for-the-badge
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
},
"require": {
"php": ">=7.3"
"php": ">=7.4"
},
"archive": {
"exclude": [
Expand Down
Loading