skool-cli 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +90 -109
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,20 +1,8 @@
1
1
  # skool-cli
2
2
 
3
- CLI and programmatic API for [Skool.com](https://www.skool.com) automation. Create classroom lessons, community posts, and manage your Skool groups from the terminal.
3
+ CLI and programmatic API for [Skool.com](https://www.skool.com) automation. Create courses, lessons, posts, and manage your Skool groups from the terminal.
4
4
 
5
- **Skool has no public API.** This tool uses browser automation (Playwright) to give you full programmatic access to Skool's features.
6
-
7
- ## Killer Feature: Classroom Lessons
8
-
9
- Create rich HTML lessons in Skool's classroom with a single command. Supports headers, lists, code blocks, bold, italic, links, and images via TipTap editor injection.
10
-
11
- ```bash
12
- skool create-lesson \
13
- --group my-community \
14
- --module "Getting Started" \
15
- --title "Your First Lesson" \
16
- --file lesson.md
17
- ```
5
+ **Skool has no public API.** This tool uses browser automation (Playwright) for auth and Skool's internal API for all content operations.
18
6
 
19
7
  ## Quick Start
20
8
 
@@ -34,112 +22,136 @@ npx playwright install chromium
34
22
  ### Authentication
35
23
 
36
24
  ```bash
37
- # Login (saves session for future use)
38
25
  skool login --email you@email.com --password yourpass
39
-
40
- # Check session status
41
26
  skool whoami --group my-community
42
27
  ```
43
28
 
44
- ### Classroom (Lessons)
29
+ ### Courses
45
30
 
46
31
  ```bash
47
- # Create lesson from markdown file
48
- skool create-lesson -g my-community -m "Module Name" -t "Lesson Title" -f lesson.md
32
+ # Create a new course
33
+ skool create-course -g my-community -t "Course Name" -d "Description"
49
34
 
50
- # Create lesson from HTML
51
- skool create-lesson -g my-community -m "Module Name" -t "Lesson Title" --html lesson.html
52
-
53
- # Create lesson from content JSON (with skool_class structure)
54
- skool create-lesson -g my-community -m "Module Name" -t "Lesson Title" -f content.json
55
-
56
- # Inline markdown
57
- skool create-lesson -g my-community -m "Module Name" -t "Quick Tip" --markdown "## Hello\n\nThis is a lesson."
35
+ # Create course with privacy setting
36
+ skool create-course -g my-community -t "Premium Course" -d "Desc" --privacy level
37
+ # Privacy options: open (default), level, buy, time, private
38
+ ```
58
39
 
59
- # Edit an existing lesson (get ID from list-lessons --json)
60
- skool edit-lesson --id PAGE_ID --title "Updated Title"
61
- skool edit-lesson --id PAGE_ID --file updated-content.md
62
- skool edit-lesson --id PAGE_ID --title "New Title" --markdown "## Updated\n\nNew content."
40
+ ### Lessons
63
41
 
64
- # Delete a lesson
42
+ ```bash
43
+ # Create lesson from markdown file
44
+ skool create-lesson -g my-community -m "Module" --course "Course" -t "Title" -f lesson.md
45
+
46
+ # Create lesson with video and resources
47
+ skool create-lesson -g my-community -m "Module" --course "Course" -t "Title" \
48
+ --markdown "## Content" \
49
+ --video "https://youtu.be/xxx" \
50
+ --resource "Docs::https://docs.example.com" \
51
+ --resource "Slides::https://slides.example.com"
52
+
53
+ # Create lesson in a specific folder (by name or ID)
54
+ skool create-lesson -g my-community -m "Module" --course "Course" --folder "Module 1" -t "Title" -f content.md
55
+ skool create-lesson -g my-community -m "Module" --course "Course" --folder-id FOLDER_ID -t "Title" -f content.md
56
+
57
+ # Edit an existing lesson
58
+ skool edit-lesson --id PAGE_ID --title "New Title"
59
+ skool edit-lesson --id PAGE_ID --file updated.md
60
+ skool edit-lesson --id PAGE_ID --video "https://youtu.be/xxx"
61
+ skool edit-lesson --id PAGE_ID --resource "Guide::https://example.com"
62
+
63
+ # Move a lesson to a different folder
64
+ skool move-lesson --id PAGE_ID --target-folder "Module 2" -g my-community --course "Course"
65
+ skool move-lesson --id PAGE_ID --target-folder-id FOLDER_ID
66
+
67
+ # Delete a lesson or folder
65
68
  skool delete-lesson --id PAGE_ID
66
69
 
67
- # List lessons (to get IDs)
68
- skool list-lessons -g my-community
70
+ # List lessons and folders
71
+ skool list-lessons -g my-community --course "Course"
69
72
  skool list-lessons -g my-community --json
70
73
  ```
71
74
 
72
- ### Community (Posts)
75
+ ### Folders (Modules)
73
76
 
74
77
  ```bash
75
- # Create a post
76
- skool create-post -g my-community -t "Welcome!" -b "Hello everyone..."
78
+ skool create-folder -g my-community --course "Course" -t "Module Name"
79
+ ```
77
80
 
78
- # Create a post from file
79
- skool create-post -g my-community -t "Weekly Update" -f post.txt -c "General"
81
+ ### Community Posts
80
82
 
81
- # List posts
82
- skool get-posts -g my-community
83
+ ```bash
84
+ skool create-post -g my-community -t "Title" -b "Body text" -c "General"
83
85
  skool get-posts -g my-community --json
84
-
85
- # List categories
86
86
  skool get-categories -g my-community
87
87
  ```
88
88
 
89
89
  ### Members
90
90
 
91
91
  ```bash
92
- # List members
93
92
  skool get-members -g my-community
93
+ skool get-members -g my-community --search "name" --json
94
+ ```
94
95
 
95
- # Search members
96
- skool get-members -g my-community --search "mario"
96
+ ## Content Format
97
97
 
98
- # JSON output
99
- skool get-members -g my-community --json
100
- ```
98
+ Lessons support full markdown:
101
99
 
102
- ## Programmatic API
100
+ - Headings (H1-H4), paragraphs
101
+ - **Bold**, *italic*, ***bold+italic***, ~~strikethrough~~, `inline code`
102
+ - Code blocks with language hints
103
+ - Bullet and numbered lists
104
+ - [Links](url) and ![images](url)
105
+ - > Blockquotes
106
+ - Horizontal rules (`---`)
103
107
 
104
- Use `skool-cli` as a library in your Node.js projects:
108
+ ## Programmatic API
105
109
 
106
110
  ```typescript
107
111
  import { SkoolClient } from 'skool-cli';
108
112
 
109
113
  const client = new SkoolClient();
110
-
111
- // Login
112
114
  await client.login('you@email.com', 'yourpass');
113
115
 
114
- // Create a lesson
116
+ // Create a course
117
+ await client.createCourse({
118
+ group: 'my-community',
119
+ title: 'My Course',
120
+ description: 'Course description',
121
+ });
122
+
123
+ // Create a lesson with video and resources
115
124
  await client.createLesson({
116
125
  group: 'my-community',
117
- module: 'Getting Started',
126
+ module: 'Module 1',
118
127
  title: 'Lesson 1',
119
- markdownContent: '## Hello\n\nThis is a lesson.',
128
+ markdownContent: '## Hello\n\nThis is a lesson with an ![image](https://example.com/img.png)',
129
+ videoUrl: 'https://youtu.be/xxx',
130
+ resources: [
131
+ { title: 'Documentation', link: 'https://docs.example.com' },
132
+ ],
120
133
  });
121
134
 
122
135
  // Edit a lesson
123
136
  await client.editLesson({
124
137
  id: 'lesson-page-id',
125
138
  title: 'Updated Title',
126
- markdownContent: '## Updated\n\nNew content here.',
139
+ markdownContent: '## Updated content',
127
140
  });
128
141
 
129
- // Create a post
130
- await client.createPost({
142
+ // Move a lesson
143
+ await client.moveLesson({
144
+ id: 'lesson-page-id',
145
+ targetFolder: 'Module 2',
131
146
  group: 'my-community',
132
- title: 'Welcome!',
133
- body: 'Hello everyone...',
134
- category: 'General',
147
+ course: 'My Course',
135
148
  });
136
149
 
137
- // Read data
150
+ // Community
151
+ await client.createPost({ group: 'my-community', title: 'Hello!', body: 'Post body' });
138
152
  const { posts } = await client.getPosts('my-community');
139
- const { categories } = await client.getCategories('my-community');
140
153
  const { members } = await client.getMembers('my-community');
141
154
 
142
- // Cleanup
143
155
  await client.close();
144
156
  ```
145
157
 
@@ -149,56 +161,15 @@ await client.close();
149
161
  |----------|-------------|
150
162
  | `SKOOL_EMAIL` | Default email for login |
151
163
  | `SKOOL_PASSWORD` | Default password for login |
152
- | `SKOOL_GROUP` | Default group slug (avoids passing `--group` every time) |
164
+ | `SKOOL_GROUP` | Default group slug (avoids `--group` every time) |
153
165
  | `SKOOL_CLI_HEADLESS` | Set to `false` for visible browser (debugging) |
154
166
  | `SKOOL_CLI_DATA_DIR` | Custom data directory (default: `~/.skool-cli/`) |
155
167
  | `SKOOL_CLI_TIMEOUT` | Operation timeout in ms (default: 30000) |
156
168
 
157
- ## How It Works
158
-
159
- 1. **Login**: Playwright opens a headless Chromium browser and logs into Skool
160
- 2. **Session persistence**: Browser profile is saved to `~/.skool-cli/browser-data/`, so subsequent runs reuse the session without re-logging in
161
- 3. **Operations**: Each command navigates to the appropriate Skool page and interacts with it programmatically
162
- 4. **TipTap injection**: For classroom lessons, HTML is injected directly into Skool's TipTap editor via `editor.commands.setContent()`
163
-
164
- ## Supported Content Formats
165
-
166
- The `create-lesson` command accepts:
167
-
168
- - **Markdown** (`.md`): Converted to TipTap-compatible HTML automatically
169
- - **HTML** (`.html`): Injected directly into the editor
170
- - **JSON** (`.json`): Extracts `skool_class` structure and converts to HTML (compatible with content pipeline JSONs)
171
-
172
- ### Supported HTML Elements
173
-
174
- Headers (h1-h4), paragraphs, bold, italic, strikethrough, inline code, code blocks, ordered/unordered lists, blockquotes, horizontal rules, links, images.
175
-
176
- **Not supported by Skool's editor**: Tables, iframes (except video embeds), forms.
177
-
178
- ## Troubleshooting
179
-
180
- | Issue | Solution |
181
- |-------|----------|
182
- | "Browser not found" | Run `npx playwright install chromium` |
183
- | Login fails | Check email/password. Try `SKOOL_CLI_HEADLESS=false` to see the browser |
184
- | Session expired | Run `skool login` again |
185
- | SAVE button not working | Known Skool quirk. The CLI handles this automatically with a dirty-state trigger |
186
- | Title too long | Automatically truncated to 50 characters |
187
- | Community posts look plain | Skool community posts only support plain text (no HTML) |
188
-
189
169
  ## Use as Claude Code Skill
190
170
 
191
- For Claude Code users, the **skill** approach is lighter than MCP (no context overhead from tool schemas).
192
-
193
171
  Copy `skill/SKILL.md` to your project:
194
172
 
195
- ```bash
196
- mkdir -p .claude/skills/skool-cli
197
- cp node_modules/skool-cli/skill/SKILL.md .claude/skills/skool-cli/SKILL.md
198
- ```
199
-
200
- Or download from GitHub:
201
-
202
173
  ```bash
203
174
  mkdir -p .claude/skills/skool-cli
204
175
  curl -o .claude/skills/skool-cli/SKILL.md https://raw.githubusercontent.com/unikprompt/skool-cli/main/skill/SKILL.md
@@ -208,7 +179,7 @@ Then tell Claude Code: "Create a lesson in Skool about X" and it will use the CL
208
179
 
209
180
  ## Use as MCP Server
210
181
 
211
- For Cursor, Windsurf, or other MCP clients, add to your MCP config:
182
+ For Cursor, Windsurf, or other MCP clients:
212
183
 
213
184
  ```json
214
185
  {
@@ -221,6 +192,16 @@ For Cursor, Windsurf, or other MCP clients, add to your MCP config:
221
192
  }
222
193
  ```
223
194
 
195
+ ## Troubleshooting
196
+
197
+ | Issue | Solution |
198
+ |-------|----------|
199
+ | "Browser not found" | `npx playwright install chromium` |
200
+ | Login fails | Try `SKOOL_CLI_HEADLESS=false` to see the browser |
201
+ | Session expired | Run `skool login` again |
202
+ | Image not showing | URL must allow hotlinking |
203
+ | Title too long | Auto-truncated to 50 chars |
204
+
224
205
  ## Learn More
225
206
 
226
207
  - [LinkedIn](https://www.linkedin.com/in/mario-perez-ed) - Mario Perez Edwards
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skool-cli",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "CLI and programmatic API for Skool.com automation — create lessons, posts, and manage communities via browser automation",
5
5
  "type": "module",
6
6
  "main": "dist/core/skool-client.js",