An open API service indexing awesome lists of open source software.

https://github.com/kallewesterling/syncjar

Edit, preview, and sync Skilljar course content from your local dev environment.
https://github.com/kallewesterling/syncjar

courses customer-education developer-education devrel devrel-community skilljar

Last synced: about 2 months ago
JSON representation

Edit, preview, and sync Skilljar course content from your local dev environment.

Awesome Lists containing this project

README

        


Syncjar


Edit, preview, and sync Skilljar course content locally.


The local-first Skilljar workflow tool for developers, course authors, and content pros.

---

**Syncjar** is a command-line tool that lets you pull, edit, preview, and sync course content from [Skilljar](https://www.skilljar.com/) โ€” all from your local development environment.

It's your local **Skilljar workspace**: Write content, test changes, see diffs, and push updates upstream.

---

## โœจ Key Features

- ๐Ÿ” **Two-way sync** between Skilljar and local files
- โœ๏ธ **Edit each Skilljar content-item** as a standalone HTML file
- ๐Ÿ” **Visual diffs** before syncing changes
- ๐Ÿงช **Local preview** mode for testing courses offline
- ๐Ÿ’พ Uses the Skilljar API with simple setup

---

## ๐Ÿ—‚ Folder Structure

```bash
.
โ”œโ”€โ”€ local-skilljar/
โ”‚ โ””โ”€โ”€ /
โ”‚ โ”œโ”€โ”€ details.json
โ”‚ โ”œโ”€โ”€ lessons-meta.json
โ”‚ โ””โ”€โ”€ lessons/
โ”‚ โ””โ”€โ”€ /
โ”‚ โ””โ”€โ”€ content-.html
โ”‚
โ”œโ”€โ”€ public/
โ”‚ โ”œโ”€โ”€ courses/ # Local preview output
โ”‚ โ””โ”€โ”€ data/
โ”‚ โ””โ”€โ”€ courses.json # Course structure for preview UI
โ”‚
โ”œโ”€โ”€ scripts/
โ”‚ โ”œโ”€โ”€ sync-skilljar-to-local.mjs # Pull from Skilljar
โ”‚ โ”œโ”€โ”€ sync-local-to-skilljar.mjs # Push to Skilljar (with diffing)
โ”‚ โ”œโ”€โ”€ generate-courses-json.mjs # Create preview course index
โ”‚
โ”œโ”€โ”€ .env # API key
โ””โ”€โ”€ README.md
```

## ๐Ÿš€ Setup

Clone the repo and install dependencies:

```bash
git clone https://github.com//syncjar.git
cd syncjar
npm install
```

2. Add your Skilljar API key to a .env file:

```env
SKILLJAR_API_KEY=sk-live-abc123
```

3. Pull your Skilljar content and generate the local preview index:

```bash
npm run build:preview
```

## ๐Ÿ” Sync Local Edits Back to Skilljar

After editing any content file in `local-skilljar//lessons//content-.html`, run:

```bash
npm run sync:push
```

This will show diffs and prompt before updating content upstream.

## ๐Ÿ› ๏ธ Example Workflows

### ๐Ÿ”„ Pull and refresh everything (Skilljar โ†’ local)

```bash
npm run build:preview
```

Runs:

```
npm run pull:skilljar
npm run generate:courses
```

### ๐Ÿ“ Edit content locally and preview it

After these scripts have run, you can edit the .html files in `local-skilljar//lessons//`.

After you make changes, you need to rebuild the local preview index:

```bash
npm run generate:courses
```

Then you can preview the content:

```bash
npx serve public
```

### ๐Ÿ“ค Push changes upstream (local โ†’ Skilljar)

```bash
npm run sync:push
```

With options:

```bash
# Dry run with diffs
npm run sync:push -- --dry-run

# Push a specific lesson
npm run sync:push -- --course This-Is-My-Course-Title --lesson 03-wrap-up

# Show diffs only (no syncing)
npm run sync:push -- --diff-only

# Push everything without prompting
npm run sync:push -- --force

# Push without showing diffs
npm run sync:push -- --no-diff
```

## ๐Ÿ”’ Connect to Your Course Content

This repo does **not** track course content directly. To use it:

1. Clone your private course content repo:

```bash
git clone [email protected]:/.git ~/courses
```

2. Add to the `.env` file in this repo:

```
COURSE_CONTENT_PATH=../courses
```

3. Then run:

```bash
npm run build:preview
```

This keeps your course content private and portable across environments.