Skip to content

kallewesterling/syncjar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 — 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

.
├── local-skilljar/
│   └── <course-slug>/
│       ├── details.json
│       ├── lessons-meta.json
│       └── lessons/
│           └── <lesson-slug>/
│               └── content-<content_item_id>.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:

git clone https://github.com/<your-org>/syncjar.git
cd syncjar
npm install
  1. Add your Skilljar API key to a .env file:
SKILLJAR_API_KEY=sk-live-abc123
  1. Pull your Skilljar content and generate the local preview index:
npm run build:preview

🔁 Sync Local Edits Back to Skilljar

After editing any content file in local-skilljar/<course>/lessons/<lesson>/content-<content_item_id>.html, run:

npm run sync:push

This will show diffs and prompt before updating content upstream.

🛠️ Example Workflows

🔄 Pull and refresh everything (Skilljar → local)

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/<course>/lessons/<lesson>/.

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

npm run generate:courses

Then you can preview the content:

npx serve public

📤 Push changes upstream (local → Skilljar)

npm run sync:push

With options:

# 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:

    git clone git@github.com:<YOUR-ORG>/<YOUR-COURSE-CONTENT-REPO>.git ~/courses
  2. Add to the .env file in this repo:

    COURSE_CONTENT_PATH=../courses
    
  3. Then run:

    npm run build:preview

This keeps your course content private and portable across environments.

About

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

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors