Skip to content
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- **First-run guidance:** `coursecode create` now tells you to open the project in your AI tool and describe the course. Projects created through the plugin skip that step because the AI tool is already running.
- **README:** Quick Start leads with the Claude Code and Codex plugin, then the `npx` path.
- **New project tooling:** New projects use ESLint 10, and `create` no longer prints npm's audit and funding notices.
- **Package homepage:** The npm `homepage` points to coursecodeframework.com.

### Fixed
- **Commands that failed without a global install:** The commands `create` prints now use `npx coursecode`, so they work after `npx coursecode create`.
- **New course metadata:** New projects start at version `1.0.0` instead of `2.0.0` and no longer carry the template author's name. Their first package is named `<course>_v1.0.0_<format>.zip`.
- **`narration` help:** The command description lists all five text-to-speech providers instead of only ElevenLabs.

## [0.4.3] - 2026-10-29

### Added
Expand Down
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,29 @@ Framework documentation lives at [coursecodeframework.com/docs](https://courseco

---

## Installation
## Quick Start

### Required
### With the plugin (recommended)

[Node.js](https://nodejs.org/) 22.15 or later. You can run every command through `npx coursecode`, or install the CLI globally for the shorter `coursecode` command:
The Claude Code and Codex plugin guides your AI tool from a new project to an LMS package, and it works before a project exists. It is not yet in the Claude Code or Codex plugin directories, so install it from this repository:

```bash
npm install -g coursecode
```
# Claude Code
claude plugin marketplace add course-code-framework/coursecode
claude plugin install coursecode@coursecode

Learner courses support Chrome 111+, Edge 111+, Firefox 114+, and Safari 16.4+. SCORM compatibility describes LMS communication and packaging; it does not imply Internet Explorer support.
# Codex
codex plugin marketplace add course-code-framework/coursecode
codex plugin add coursecode@coursecode
```

### Recommended
Then start your AI tool in an empty folder and describe the course you want.

- A code or text editor, such as [VS Code](https://code.visualstudio.com/), [Cursor](https://cursor.com/), or similar
- An AI coding tool with MCP support, such as [Claude Code](https://claude.com/claude-code), [Codex](https://developers.openai.com/codex), [Cursor](https://cursor.com/), or VS Code with GitHub Copilot
- [GitHub Desktop](https://desktop.github.com/) for version control
The plugin needs [Node.js](https://nodejs.org/) 22.15 or later but no global `coursecode` install. If Node.js is missing, its `setup` skill offers to install it. The plugin bundles the MCP server below and six skills: setup, new-course, outline, build-slides, review, and publish. See [plugin/README.md](plugin/README.md).

---
### With npx

## Quick Start
With [Node.js](https://nodejs.org/) 22.15 or later installed, create a project:

```bash
npx coursecode create my-course
Expand All @@ -76,21 +78,21 @@ Start with the [User Guide](framework/docs/USER_GUIDE.md) for a complete walkthr

---

## Claude Code and Codex Plugin
## Requirements

The plugin adds guided skills for each stage, from a new project to an LMS package, and works before a project exists. Start your AI tool in an empty folder and describe the course you want. It is not yet in the Claude Code or Codex plugin directories, so install it from this repository:
[Node.js](https://nodejs.org/) 22.15 or later. You can run every command through `npx coursecode`, or install the CLI globally for the shorter `coursecode` command used in the rest of this guide:

```bash
# Claude Code
claude plugin marketplace add course-code-framework/coursecode
claude plugin install coursecode@coursecode

# Codex
codex plugin marketplace add course-code-framework/coursecode
codex plugin add coursecode@coursecode
npm install -g coursecode
```

The plugin bundles the MCP server below and six skills: setup, new-course, outline, build-slides, review, and publish. It needs Node.js but no global `coursecode` install. See [plugin/README.md](plugin/README.md).
Learner courses support Chrome 111+, Edge 111+, Firefox 114+, and Safari 16.4+. SCORM compatibility describes LMS communication and packaging; it does not imply Internet Explorer support.

Also recommended:

- A code or text editor, such as [VS Code](https://code.visualstudio.com/), [Cursor](https://cursor.com/), or similar
- An AI coding tool with MCP support, such as [Claude Code](https://claude.com/claude-code), [Codex](https://developers.openai.com/codex), [Cursor](https://cursor.com/), or VS Code with GitHub Copilot
- [GitHub Desktop](https://desktop.github.com/) for version control

---

Expand Down
2 changes: 1 addition & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ program
// Narration command
program
.command('narration')
.description('Generate audio narration from text using ElevenLabs')
.description('Generate audio narration from text using ElevenLabs, OpenAI, Azure, Google Cloud, or Deepgram')
.option('-f, --force', 'Regenerate all narration (ignore cache)')
.option('-s, --slide <id>', 'Generate narration for a specific slide only')
.option('--dry-run', 'Preview what would be generated')
Expand Down
2 changes: 1 addition & 1 deletion framework/scripts/tts-providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* 3. Default to deepgram
*
* Environment Variables:
* TTS_PROVIDER - Explicit provider selection: elevenlabs, openai, azure
* TTS_PROVIDER - Explicit provider selection: elevenlabs, openai, azure, google, deepgram
*/

import { ElevenLabsProvider } from './elevenlabs-provider.js';
Expand Down
31 changes: 22 additions & 9 deletions lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const PACKAGE_ROOT = path.join(__dirname, '..');
const REQUIRED_PROJECT_DIRECTORIES = [
{
path: path.join('course', 'references'),
placeholder: '# Place source documents here (docx, pptx, pdf)\n# Run `coursecode convert` to convert them to markdown\n'
placeholder: '# Place source documents here (docx, pptx, pdf)\n# Run `npx coursecode convert` to convert them to markdown\n'
},
{
path: path.join('course', 'references', 'converted'),
Expand Down Expand Up @@ -169,7 +169,8 @@ function npmInstall(cwd) {
return new Promise((resolve, reject) => {
const npmCli = process.env.COURSECODE_NPM_CLI;
const command = npmCli ? process.execPath : 'npm';
const args = npmCli ? [npmCli, 'install'] : ['install'];
const installArgs = ['install', '--no-audit', '--no-fund'];
const args = npmCli ? [npmCli, ...installArgs] : installArgs;
const child = spawn(command, args, {
cwd,
stdio: 'inherit',
Expand All @@ -187,6 +188,19 @@ function npmInstall(cwd) {
});
}

/**
* Next steps after create. Commands use npx because the project's own CLI
* works whether or not coursecode is installed globally.
*/
export function formatNextSteps({ directoryName, currentDirectory = false, plugin = false }) {
const changeDirectory = currentDirectory ? '' : `cd ${directoryName}\n `;
const preview = `To preview your course:\n\n ${plugin ? changeDirectory : ''}npx coursecode preview\n\n Then open http://localhost:4173\n`;

if (plugin) return `\n ${preview}`;

return `\n Open the project in your AI tool and describe the course you want:\n\n ${changeDirectory}claude # or codex, or open the folder in Cursor or VS Code\n\n ${preview}`;
}

/**
* Initialize git repository
*/
Expand Down Expand Up @@ -350,8 +364,8 @@ export async function create(name, options = {}) {

Next steps:
- Edit course-config.js with your course metadata
- Create slides with: coursecode new slide <id>
- Create assessments with: coursecode new assessment <id>
- Create slides with: npx coursecode new slide <id>
- Create assessments with: npx coursecode new assessment <id>
`);
} else {
console.log(`
Expand All @@ -365,8 +379,8 @@ export async function create(name, options = {}) {

The project includes example slides (prefixed with "example-") that
demonstrate framework features. When ready to build your own course:
- Run: coursecode clean
- Or create a blank project: coursecode create <name> --blank
- Run: npx coursecode clean
- Or create a blank project: npx coursecode create <name> --blank
`);
}

Expand All @@ -384,11 +398,10 @@ export async function create(name, options = {}) {

child.on('error', () => {
console.warn(' ⚠️ Failed to start preview server. Run manually:');
console.log(` cd ${directoryName} && coursecode preview\n`);
console.log(` cd ${directoryName} && npx coursecode preview\n`);
});
} else {
const changeDirectory = currentDirectory ? '' : `cd ${directoryName}\n `;
console.log(`\n To preview your course:\n\n ${changeDirectory}coursecode preview\n\n Then open http://localhost:4173\n`);
console.log(formatNextSteps({ directoryName, currentDirectory, plugin: options.plugin === true }));
}

return {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"bugs": {
"url": "https://github.com/course-code-framework/coursecode/issues"
},
"homepage": "https://github.com/course-code-framework/coursecode/blob/main/framework/docs/USER_GUIDE.md",
"homepage": "https://coursecodeframework.com",
"engines": {
"node": ">=22.15.0"
},
Expand Down
3 changes: 1 addition & 2 deletions template/course/course-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ export const courseConfig = {
metadata: {
title: 'CourseCode',
description: 'CourseCode template for course development',
version: '2.0.0',
author: 'Seth Vincent',
version: '1.0.0',
language: 'en'
},
layout: 'article',
Expand Down
2 changes: 1 addition & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"archiver": "^8.0.0",
"eslint": "^9.39.4",
"eslint": "^10.13.0",
"globals": "^17.7.0",
"vite": "~8.1.6",
"vite-plugin-static-copy": "^4.1.1"
Expand Down
46 changes: 45 additions & 1 deletion tests/create.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import fs from 'fs';
import os from 'os';
import path from 'path';
import {
create,
formatNextSteps,
stampCourseTitle,
toCurrentDirectoryCourseTitle,
toCurrentDirectoryPackageName,
Expand Down Expand Up @@ -67,7 +68,50 @@ export const courseConfig = {
});
});

describe('formatNextSteps', () => {
it('sends new projects to an AI tool and keeps the preview command', () => {
const message = formatNextSteps({ directoryName: 'my-course' });

expect(message).toContain('cd my-course\n claude');
expect(message).toContain('Cursor or VS Code');
expect(message).toContain('npx coursecode preview');
});

it('skips the AI tool step when the plugin created the project', () => {
const message = formatNextSteps({ directoryName: 'my-course', currentDirectory: true, plugin: true });

expect(message).not.toContain('claude');
expect(message).not.toContain('cd my-course');
expect(message).toContain('npx coursecode preview');
});
});

describe('create', () => {
it.each([
['example', {}],
['blank', { blank: true }]
])('prints commands that work without a global install for %s projects', async (_label, options) => {
const log = vi.spyOn(console, 'log').mockImplementation(() => {});

try {
await create('Npx Course', { install: false, ...options });
const output = log.mock.calls.flat().join('\n');

expect(output).toContain('npx coursecode');
expect(output).not.toMatch(/(?<!npx )coursecode (preview|clean|new|create)\b/);
} finally {
log.mockRestore();
}
});

it('starts new courses at version 1.0.0 with no author', async () => {
await create('Version Course', { install: false });

const config = fs.readFileSync(path.join(tempDir, 'version-course', 'course', 'course-config.js'), 'utf-8');
expect(config).toContain("version: '1.0.0'");
expect(config).not.toMatch(/^\s*author:/m);
});

it('creates a directory-safe project and stamps the human course title', async () => {
const result = await create('CourseCode Demo', { install: false });

Expand Down
Loading