11 Automating with AI
12 Supercharging Course Production with GitHub Copilot & AI Tools
As an educator building out reproducible courses with Quarto, you are inherently writing code. Whether it is Markdown for lecture notes, Python or R for your data analysis labs, or simply writing Python scripts to automate your directory structures, you are functioning as a developer.
To assist you in this endeavor, GitHub Copilot serves as an indispensable AI pair programmer. Copilot is integrated directly into your IDE (like Antigravity or VS Code) and provides real-time autocomplete suggestions, conversational assistance, and code generation.
12.1 The AI Editor Stack
For day-to-day course production, the most practical setup is a combination of:
- GitHub for repositories, version history, and publishing
- GitHub Copilot for inline suggestions and chat support while writing code or Quarto
- Classroom 50 for distributing coding assignments and collecting student work
- VS Code or Antigravity when using ChatGPT-connected coding tools for drafting scripts, revising content, and debugging
- Cursor when project-wide AI editing and rapid refactoring are useful
- Gemini and OpenAI APIs when you want scripts to generate metadata, summaries, or structured course assets at scale
Used together, these tools reduce setup time, help standardize materials, and make it easier to maintain course content across semesters.
12.2 Additional Platforms and Resources
The following tools are also useful in analytics and AI-focused teaching workflows:
- Remotion for generating videos programmatically from code: https://www.remotion.dev/
- Manim for mathematical and technical animations in Python: https://docs.manim.community/en/stable/examples.html
- Hugging Face Inference Providers for testing and comparing hosted models and APIs: https://huggingface.co/inference/models
- Hugging Face Academia Hub for institution-level research, teaching, and infrastructure workflows: https://huggingface.co/docs/hub/en/academia-hub
12.3 Copilot for Course Organization Scripts
One of the most powerful uses of Copilot is automating the tedious parts of course administration.
For instance, consider the requirement of generating a consistent module structure (M01, M02, M03) complete with boilerplate Quarto files for lecture notes, presentations, labs, assignments, projects, and participation activities. Instead of creating each file by hand, you can use the generator script included with this book.
If you want Copilot to help you adapt the script, give it this prompt:
“Modify this Quarto course scaffold script so it generates modules named M01 through M07. Each module should include M01_A.qmd, M01_LN1.qmd, M01_LN2.qmd, M01_P1.qmd, M01_P2.qmd, M01_Proj.qmd, M01_Lab1.qmd, M01_Lab2.qmd, M01_Participation1.qmd, and M01_Participation2.qmd.”
12.3.1 The Module Generation Script
The reusable version of the script is included in this repository at scripts/generate_modules.py. Run it from the root of a course project:
python scripts/generate_modules.py .By default, the script creates modules M01 through M07. If your course has an orientation module, add M00:
python scripts/generate_modules.py . --include-module-zeroThe first generated module will look like this:
M01/
M01_A.qmd
M01_LN1.qmd
M01_LN2.qmd
M01_P1.qmd
M01_P2.qmd
M01_Proj.qmd
M01_Lab1.qmd
M01_Lab2.qmd
M01_Participation1.qmd
M01_Participation2.qmd
data/
output/
M01_lecture01_figures/
M01_lecture02_figures/
M01_presentation01_files/
M01_presentation02_files/
M01_P1_files/
M01_P2_files/
Existing files are left untouched unless you explicitly pass --overwrite.
12.3.2 Validating the Module Structure
After generating or editing the scaffold, run the validation script:
python scripts/validate_course_structure.py .The validator checks that every module contains the required M01_* files and support folders. This is useful before building Blackboard content because broken naming conventions often become broken links later.
12.4 Automating Metadata with LLMs (OpenAI / Gemini)
Beyond structural generation, you can use large language models (LLMs) via APIs to automatically populate the YAML metadata in your Quarto files. For example, a script can read your course outline (an Excel or CSV file) and prompt an AI to generate SEO-friendly keywords and summaries for each lecture note.
12.4.1 Setting up API Keys (.env)
Before running API-dependent scripts, you must securely store your API keys. Never hardcode your keys into your Python scripts or commit them to GitHub. Instead, use a .env file.
Create a file named .env in the root of your project directory and add the following placeholder keys. Replace your_... with your actual keys.
# .env
# OpenAI API Key (Required for OpenAI integrations)
OPENAI_API_KEY="your_openai_api_key_here"
# Gemini API Key (Required if you use Google's models instead)
GEMINI_API_KEY="your_gemini_api_key_here"
Ensure your .gitignore file contains the line .env so your keys are not accidentally uploaded to your GitHub repository!
12.4.2 The Metadata Population Script
Once your keys are configured, use the included metadata script to fill YAML front matter in generated .qmd files from a CSV outline:
python scripts/populate_qmd_metadata.py data/generated_schedule.csv --root .The script reads Source File, Title, Lecture, and Description columns. If OPENAI_API_KEY is present, it asks the OpenAI API for a concise page description. If no key is present, it falls back to the workbook description, so the workflow still works offline.
12.5 Additional Automation Scripts
The book repository includes these reusable scripts:
| Script | Purpose |
|---|---|
scripts/generate_course_workbook.py |
Create the standard Course-Schedule.xlsx workbook |
scripts/validate_course_workbook.py |
Check required workbook sheets and columns |
scripts/generate_modules.py |
Create canonical M01_* module folders and files |
scripts/validate_course_structure.py |
Check required module files and folders |
scripts/generate_course_schedule.py |
Produce a draft schedule CSV from the workbook |
scripts/populate_qmd_metadata.py |
Populate YAML metadata in generated .qmd files |
Together, these scripts turn the course-building workflow into a repeatable pipeline: workbook, structure, schedule, metadata, render, Blackboard.
12.7 Responsible AI Use in Education
While GitHub Copilot is a powerful authoring assistant for you as an educator, it also introduces important discussions regarding responsible use in the classroom.
If students are working in GitHub repositories managed through Classroom 50, they may also have access to Copilot through GitHub Education. Verified students can get free access to GitHub Copilot, and Copilot Chat can be used with repository context to answer questions about the codebase. It is critical to establish a clear policy in your syllabus regarding the acceptable use of Generative AI.
Use Copilot to help you generate boilerplate code, format markdown, and troubleshoot errors. However, always review the generated content critically before publishing it to your Blackboard course shell to ensure pedagogical accuracy.
Integrating AI into your workflow does not replace your expertise; it simply accelerates the mechanics of course production, giving you more time to focus on teaching.
12.8 Integrating These Tools in an Analytics Class
In an analytics class, these tools can speed up the parts of course design that are repetitive but still technical. GitHub and Classroom 50 help organize materials, distribute assignments, and keep submissions structured. GitHub Copilot, Cursor, and ChatGPT-connected coding tools help draft scripts, clean up Quarto files, troubleshoot issues, and generate boilerplate more quickly.
For larger automation tasks, OpenAI or Gemini APIs can be used from Python scripts to generate metadata, summaries, or other structured content. Remotion and Manim can support technical video creation, while Hugging Face can support model experimentation or institution-scale AI workflows. The main value is not replacing instructional judgment, but reducing the time spent on setup, formatting, and iteration.