coursecast 0.2.4 → 0.2.5
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.
- package/README.md +4 -4
- package/bin/coursecast.mjs +2 -2
- package/package.json +1 -1
- package/src/engines/gemini.mjs +9 -2
package/README.md
CHANGED
|
@@ -36,14 +36,14 @@ The engine is what writes the content. Pick with `--engine`:
|
|
|
36
36
|
|---|---|---|
|
|
37
37
|
| `claude-code` *(default)* | your [Claude Code](https://claude.com/claude-code) CLI | `claude` on PATH |
|
|
38
38
|
| `codex` | your Codex CLI | `codex` on PATH |
|
|
39
|
-
| `gemini` | Google Gemini API, search-grounded | `GEMINI_API_KEY` ([free key](https://aistudio.google.com/apikey)) |
|
|
39
|
+
| `gemini` | Google Gemini API, search-grounded | `GEMINI_API_KEY` ([free key](https://aistudio.google.com/apikey)) + your `--model` choice |
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
coursecast "learn rust" --engine gemini
|
|
42
|
+
coursecast "learn rust" --engine gemini --model gemini-3.5-flash-lite
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
`COURSECAST_RESEARCH=0` skips the web-search research pass
|
|
45
|
+
The gemini engine never picks a model for you — pass `--model` (or set `GEMINI_MODEL`) with
|
|
46
|
+
whatever your key has access to. `COURSECAST_RESEARCH=0` skips the web-search research pass.
|
|
47
47
|
|
|
48
48
|
## All flags
|
|
49
49
|
|
package/bin/coursecast.mjs
CHANGED
|
@@ -25,7 +25,7 @@ USAGE
|
|
|
25
25
|
|
|
26
26
|
OPTIONS
|
|
27
27
|
--engine <id> generation engine: claude-code (default), gemini, codex, stub
|
|
28
|
-
--model <id> model
|
|
28
|
+
--model <id> model to use (required for gemini, e.g. gemini-3.5-flash-lite)
|
|
29
29
|
--storage <id> progress storage: local (default, no setup), cloud (sync across devices)
|
|
30
30
|
--provider <id> deploy target: vercel | netlify (auto-detects what you have installed)
|
|
31
31
|
--lessons <n> target number of lessons (default ~12)
|
|
@@ -38,7 +38,7 @@ OPTIONS
|
|
|
38
38
|
|
|
39
39
|
EXAMPLES
|
|
40
40
|
coursecast "kubernetes basics" # default engine (claude-code)
|
|
41
|
-
coursecast "how DNS works" --engine gemini
|
|
41
|
+
coursecast "how DNS works" --engine gemini --model gemini-3.5-flash-lite
|
|
42
42
|
coursecast "intro to nuclear power" --deploy # generate + ship to your Vercel
|
|
43
43
|
`);
|
|
44
44
|
}
|
package/package.json
CHANGED
package/src/engines/gemini.mjs
CHANGED
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
// schema rather than inventing them from stale training data.
|
|
5
5
|
//
|
|
6
6
|
// Requires: GEMINI_API_KEY (free tier works — https://aistudio.google.com/apikey)
|
|
7
|
-
//
|
|
7
|
+
// and a model of YOUR choice via --model or GEMINI_MODEL — the CLI never
|
|
8
|
+
// picks one for you (it's your key, your cost, your quality bar).
|
|
9
|
+
// Optional: COURSECAST_RESEARCH=0 to skip the web-search research pass.
|
|
8
10
|
|
|
9
11
|
import { buildSyllabusPrompt, buildLessonPrompt, finalizeLesson, extractJsonObject } from './shared-prompts.mjs'
|
|
10
12
|
|
|
11
13
|
export const name = 'gemini'
|
|
12
14
|
|
|
13
15
|
const API = 'https://generativelanguage.googleapis.com/v1beta/models'
|
|
14
|
-
const DEFAULT_MODEL = process.env.GEMINI_MODEL
|
|
16
|
+
const DEFAULT_MODEL = process.env.GEMINI_MODEL // no baked-in default — the user chooses
|
|
15
17
|
const RESEARCH_ON = process.env.COURSECAST_RESEARCH !== '0'
|
|
16
18
|
|
|
17
19
|
function apiKey() {
|
|
@@ -23,6 +25,11 @@ function apiKey() {
|
|
|
23
25
|
// One Gemini call. `json:true` forces a JSON body; `search:true` enables Google Search grounding.
|
|
24
26
|
// (Gemini disallows forced-JSON + grounding together, so a call is one or the other.)
|
|
25
27
|
async function callGemini({ model = DEFAULT_MODEL, prompt, json = false, search = false, maxOutputTokens = 8192 }) {
|
|
28
|
+
if (!model) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
'gemini engine: pick a model with --model (e.g. gemini-3.5-flash, gemini-3.5-flash-lite) or set GEMINI_MODEL.'
|
|
31
|
+
)
|
|
32
|
+
}
|
|
26
33
|
const body = {
|
|
27
34
|
contents: [{ parts: [{ text: prompt }] }],
|
|
28
35
|
generationConfig: { temperature: 0.7, maxOutputTokens },
|