Windows 11 Vibe Coding 與 AI Agent 環境建置

本模組聚焦在 Windows 11 筆電上的 Vibe Coding 與 AI Agent 工作環境建置。先安裝 ChatGPT 桌面 app,再用一鍵安裝腳本準備開發工具;最後以 Chat、ChatGPT Work 與 Codex 的正確工作介面完成幾個小型驗證任務。

學習目標 (Learning Objectives)

完成本模組後,教師應能:

先備條件 (Prerequisites)

項目 說明
個人筆電 Windows 11,具系統管理 (安裝軟體) 權限
網路 可連線下載安裝套件與存取 AI 服務
ChatGPT 帳號 可使用 Codex 的 ChatGPT 帳號;先登入 ChatGPT 桌面 app。實際可用功能依方案、工作區與推出狀況而異,CLI 與 VS Code 擴充套件可使用同一登入帳號。
GitHub 帳號 供 GitHub CLI 登入、clone 專案與部署 GitHub Pages 使用
基本操作 能開啟終端機 (terminal) 並輸入指令

最低電腦需求 (Minimum Computer Requirements)

本工作坊會同時開啟 VS Code、Node.js、Python、終端機與瀏覽器登入頁面,建議筆電至少符合下列規格。標示「建議」者為較順暢的體驗門檻。

項目 最低需求 建議
作業系統 Windows 11 (64 位元),並已安裝 App Installer (winget) Windows 11 且更新至最新版
處理器 64 位元 x64 雙核心 四核心以上
記憶體 (RAM) 8 GB 16 GB
可用磁碟空間 10 GB 20 GB 以上
權限 具系統管理員權限 (可安裝軟體、允許 UAC) 同左
網路 穩定寬頻,可存取 GitHub 與 AI 服務 同左
瀏覽器 Microsoft Edge 或 Chrome (供登入流程使用) 同左

8 GB 記憶體可完成所有任務,但同時開啟 VS Code、瀏覽器與多個終端機時,16 GB 會明顯較順暢。磁碟空間需求包含工具鏈、專案的 node_modules 與 Python 套件。

安裝的工具 (Toolchain)

Windows 11 一鍵安裝腳本與課後指南會在筆電上安裝下列工具:

工具 用途
VS Code 程式碼編輯器,也是日後操作 AI Agent 的主要視窗
Git 版本管理工具,許多 AI 工具會用到
Node.js + npm JavaScript 執行環境,用來啟動 local web server 與安裝 Codex CLI
uv (Python) 管理 Python 與套件,安裝/更新/移除都很簡單
ChatGPT 桌面 app Windows 上的 Chat、ChatGPT Work 與 Codex 入口;可開啟專案、查看變更與使用整合終端機。
Codex CLI(終端機工作流程) OpenAI 的 AI Agent 命令列工具;適合需要直接在終端機操作專案的課程練習。先以可使用 Codex 的 ChatGPT 帳號登入,實際功能依帳號與工作區而異。
GitHub CLI (gh) 用瀏覽器登入 GitHub,clone 專案、推送與部署 GitHub Pages
VS Code 擴充套件 Python、Jupyter、GitLens、ESLint,以及 Codex 編程代理 (openai.chatgpt)

安裝方式一:手動下載與安裝必要工具

若一鍵安裝失敗,或教師的筆電受學校 IT 權限限制,可改用手動安裝。建議仍優先使用 winget 指令;若 winget 不可用,再從官方下載頁面安裝。

工具 官方下載/說明 建議指令或手動操作
App Installer / winget https://learn.microsoft.com/windows/msix/app-installer/install-update-app-installer Windows 11 通常已內建。若winget --version 無法執行,請從 Microsoft Store 安裝或更新 App Installer。
ChatGPT 桌面 app OpenAI:ChatGPT desktop app for Windows winget install --id 9PLM9XGG6VKS --source msstore,或從 Microsoft Store 安裝。安裝後開啟 app,使用 ChatGPT 帳號登入。
VS Code https://code.visualstudio.com/download winget install --id Microsoft.VisualStudioCode --source winget --exact
Git for Windows https://git-scm.com/downloads/win winget install --id Git.Git --source winget --exact
Node.js LTS + npm https://nodejs.org/en/download winget install --id OpenJS.NodeJS.LTS --source winget --exact
uv https://docs.astral.sh/uv/getting-started/installation/ winget install --id astral-sh.uv --source winget --exact
GitHub CLI (gh) https://cli.github.com/ winget install --id GitHub.cli --source winget --exact
Codex CLI https://developers.openai.com/codex/cli 安裝 Node.js 後執行npm install -g "@openai/codex",再執行 codex 登入。

VS Code 擴充套件可在 VS Code 左側 Extensions 視窗搜尋安裝,也可在終端機逐行執行:

code --install-extension ms-python.python
code --install-extension ms-toolsai.jupyter
code --install-extension eamodio.gitlens
code --install-extension dbaeumer.vscode-eslint
code --install-extension openai.chatgpt

手動安裝後,同樣需要關閉並重新開啟終端機,再執行版本檢查:

code --version
git --version
node --version
npm --version
uv --version
gh --version
codex --version

安裝方式二:透過 AI Agent Prompt 安裝(ChatGPT Work,完整存取權)

除了執行批次檔或手動安裝,也可以直接在 ChatGPT 桌面 app 中改用自然語言,讓 AI Agent 自行檢查筆電上缺少哪些工具、依序安裝並回報結果。

⚠️ 完整存取權(Full access)會讓 Agent 不經逐步核准就執行終端機指令,安裝流程結束後請切回先要求核准(Ask for approval)。

建議操作:

我使用的是 Windows 11 筆電,具備系統管理員權限,已安裝 App Installer (winget)。
請幫我檢查並安裝以下開發工具,若已安裝則略過,全部安裝完成後請執行版本檢查指令並回報結果:

1. VS Code(winget id: Microsoft.VisualStudioCode)
2. Git for Windows(winget id: Git.Git)
3. Node.js LTS + npm(winget id: OpenJS.NodeJS.LTS)
4. uv(winget id: astral-sh.uv)
5. GitHub CLI(winget id: GitHub.cli)
6. Codex CLI(先確認 Node.js 已安裝,再執行 npm install -g "@openai/codex")
7. 以下 VS Code 擴充套件:
   - ms-python.python
   - ms-toolsai.jupyter
   - eamodio.gitlens
   - dbaeumer.vscode-eslint
   - openai.chatgpt

安裝規則:
- 每一項工具在安裝前先檢查是否已存在(例如執行「工具 --version」或「winget list --id ...」),已安裝就跳過,不要重複安裝。
- 使用 winget 安裝時加上 --source winget --exact(VS Code 擴充套件改用 code --install-extension)。
- 全部安裝完成後,開新的終端機視窗,依序執行下列指令並把結果貼給我:
  code --version
  git --version
  node --version
  npm --version
  uv --version
  gh --version
  codex --version
- 若任何一項安裝失敗,請停下來告訴我錯誤訊息,不要略過或用其他方式繞過。
- 不要安裝清單以外的軟體,也不要修改系統設定或使用者帳戶權限。

Agent 執行完成後,請比對輸出結果與上方「安裝的工具」表格,確認每個指令都能顯示版本號;若有工具檢查失敗,可回到「安裝方式一:手動下載與安裝必要工具」單獨修復。

安裝方式三:使用 setup-windows.bat 一鍵安裝

優先使用本模組提供的 setup-windows.bat。這個批次檔會檢查 winget,再依序安裝 VS Code、Git、Node.js LTS、uv、GitHub CLI、ChatGPT 桌面 app、Codex CLI 與常用 VS Code 擴充套件。腳本可重複執行;已安裝的項目會自動略過。

建議操作:

& "$HOME\Downloads\setup-windows.bat"
"%USERPROFILE%\Downloads\setup-windows.bat"
code --version
git --version
node --version
npm --version
uv --version
gh --version
codex --version

若腳本顯示 winget not found,請先安裝或更新 Windows 的 App Installer,完成後再重新執行批次檔。

實作流程 (Hands-on Activities)

1. 設定 ChatGPT、Work 與 Codex

2. 連結 GitHub 與部署 GitHub Pages

3. 四項驗證任務 (Verification Tasks)

任務 內容 驗證重點
Python 驗證 以 uv 建立專案並安裝 openpyxl、python-docx,讀取 Excel、整理資料並輸出新的 Excel 檔案 套件與檔案處理可運作
Word 驗證 讀取 Word 文件內容,並產生一份修改後的 Word 檔案 Office 文件處理可運作
JavaScript 驗證 以npx http-server 啟動簡單的 local web server,確認 client-side 與 server-side 程式正常執行 Node.js 與 local host 可運作
Codex 驗證 請 Codex 建立簡單文字檔、修改範例程式或整理指定資料 AI Agent 可讀寫工作區檔案並回報結果

Windows 11 Vibe Coding and AI Agent Environment Setup

This module prepares a Vibe Coding and AI Agent environment on a Windows 11 laptop. Install the ChatGPT desktop app first, then use the setup script for the developer tools. Finally, choose Chat, ChatGPT Work, or Codex for the appropriate verification task.

Learning Objectives

After this module, participants can:

Prerequisites

Item Description
Personal laptop Windows 11, with administrator (software installation) permissions
Network Internet access to download installers and reach AI services
ChatGPT account A ChatGPT account with Codex access; available features vary by plan, workspace, and rollout status. The CLI and VS Code extension can use the same sign-in.
GitHub account Used to sign in to the GitHub CLI, clone the project, and deploy GitHub Pages
Basic skills Comfortable opening a terminal and typing commands

Minimum Computer Requirements

This workshop keeps VS Code, Node.js, Python, a terminal, and browser sign-in pages open at the same time, so the laptop should meet at least the specs below. The "Recommended" column marks the threshold for a smoother experience.

Item Minimum Recommended
Operating system Windows 11 (64-bit) with App Installer (winget) installed Windows 11, fully updated
Processor 64-bit x64 dual-core Quad-core or better
Memory (RAM) 8 GB 16 GB
Free disk space 10 GB 20 GB or more
Permissions Administrator permissions (can install software, allow UAC prompts) Same as minimum
Network Stable broadband with access to GitHub and AI services Same as minimum
Browser Microsoft Edge or Chrome (for sign-in flows) Same as minimum

8 GB of RAM is enough to complete every task, but 16 GB is noticeably smoother once VS Code, a browser, and several terminals are open at the same time. The disk-space estimate includes the toolchain plus each project's node_modules and Python packages.

Toolchain

The Windows 11 setup script and follow-up guide prepare these tools on the laptop:

Tool Purpose
VS Code Code editor; also the main window for working with the AI agent later
Git Version control tool used by many AI tools
Node.js + npm JavaScript runtime, used to start a local web server and install Codex CLI
uv (Python) Manages Python and packages; installing, updating, and removing them is simple
ChatGPT desktop app The Windows entry point for Chat, ChatGPT Work, and Codex. It can open projects, show changes, and provide an integrated terminal.
Codex CLI (terminal workflow) OpenAI's command-line agent for course exercises that work directly in a project. Sign in with a ChatGPT account that has Codex access.
GitHub CLI (gh) Sign in to GitHub through the browser; clone, push, and deploy to GitHub Pages
VS Code extensions Python, Jupyter, GitLens, ESLint, and the Codex coding agent (openai.chatgpt)

Install Method 1: Manual Download and Installation

If the one-click install fails, or the laptop is restricted by school IT policy, install manually instead. Still try the winget command first; if winget isn't available, install from the official download pages.

Tool Official Download / Notes Recommended Command or Manual Steps
App Installer / winget https://learn.microsoft.com/windows/msix/app-installer/install-update-app-installer Windows 11 usually includes this. If winget --version doesn't run, install or update App Installer from the Microsoft Store.
ChatGPT desktop app OpenAI: ChatGPT desktop app for Windows Run winget install --id 9PLM9XGG6VKS --source msstore, or install it from Microsoft Store. Then open the app and sign in.
VS Code https://code.visualstudio.com/download winget install --id Microsoft.VisualStudioCode --source winget --exact
Git for Windows https://git-scm.com/downloads/win winget install --id Git.Git --source winget --exact
Node.js LTS + npm https://nodejs.org/en/download winget install --id OpenJS.NodeJS.LTS --source winget --exact
uv https://docs.astral.sh/uv/getting-started/installation/ winget install --id astral-sh.uv --source winget --exact
GitHub CLI (gh) https://cli.github.com/ winget install --id GitHub.cli --source winget --exact
Codex CLI https://developers.openai.com/codex/cli After installing Node.js, run npm install -g "@openai/codex", then run codex to sign in.

You can install the VS Code extensions by searching in the Extensions panel, or run these commands one by one in a terminal:

code --install-extension ms-python.python
code --install-extension ms-toolsai.jupyter
code --install-extension eamodio.gitlens
code --install-extension dbaeumer.vscode-eslint
code --install-extension openai.chatgpt

After a manual install, close and reopen the terminal too, then run the version checks:

code --version
git --version
node --version
npm --version
uv --version
gh --version
codex --version

Install Method 2: Install via an AI Agent Prompt (ChatGPT Work, Full Access)

Instead of running the batch file or installing manually, you can also open the ChatGPT desktop app and use a natural-language prompt so the agent checks what is missing on the laptop, installs it, and reports back.

⚠️ Full access lets the agent run terminal commands without asking for approval on each step. Switch back to Ask for approval once the install is finished.

Suggested steps:

I'm on a Windows 11 laptop with administrator rights, and App Installer (winget) is already installed.
Please check and install the following developer tools, skipping anything already installed. After everything is installed, run the version-check commands and report the results back to me:

1. VS Code (winget id: Microsoft.VisualStudioCode)
2. Git for Windows (winget id: Git.Git)
3. Node.js LTS + npm (winget id: OpenJS.NodeJS.LTS)
4. uv (winget id: astral-sh.uv)
5. GitHub CLI (winget id: GitHub.cli)
6. Codex CLI (confirm Node.js is installed first, then run npm install -g "@openai/codex")
7. These VS Code extensions:
   - ms-python.python
   - ms-toolsai.jupyter
   - eamodio.gitlens
   - dbaeumer.vscode-eslint
   - openai.chatgpt

Rules:
- Before installing each tool, check whether it already exists (e.g. run "tool --version" or "winget list --id ..."); skip it if it's already installed, don't reinstall.
- When using winget, add --source winget --exact (for VS Code extensions, use code --install-extension instead).
- After everything is installed, open a new terminal window, run the following commands in order, and paste the results back to me:
  code --version
  git --version
  node --version
  npm --version
  uv --version
  gh --version
  codex --version
- If any install step fails, stop and tell me the error message; don't skip it or work around it another way.
- Don't install anything outside this list, and don't change system settings or user account permissions.

Once the agent finishes, compare its output against the Toolchain table above to confirm each command prints a version number. If a check fails, go back to "Install Method 1: Manual Download and Installation" to fix that tool individually.

Install Method 3: One-Click Setup with setup-windows.bat

Start with the supplied setup-windows.bat. It checks winget, then installs VS Code, Git, Node.js LTS, uv, GitHub CLI, the ChatGPT desktop app, Codex CLI, and common VS Code extensions. The script is safe to run again; installed items are skipped.

Suggested steps:

& "$HOME\Downloads\setup-windows.bat"
"%USERPROFILE%\Downloads\setup-windows.bat"
code --version
git --version
node --version
npm --version
uv --version
gh --version
codex --version

If the script prints winget not found, install or update Windows App Installer first, then run the batch file again.

Hands-on Activities

1. Set up ChatGPT Work and Codex

2. Connect GitHub and Deploy GitHub Pages

3. Four Verification Tasks

Task Description What It Verifies
Python check Use uv to create a project, install openpyxl and python-docx, read an Excel file, clean up the data, and write a new Excel file Confirms package installation and file handling work
Word check Read the contents of a Word document and produce a modified Word file Confirms Office document handling works
JavaScript check Start a simple local web server with npx http-server to confirm client-side and server-side code run correctly Confirms Node.js and the local host work
Codex check Ask Codex to create a simple text file, modify a sample script, or organize a specified dataset Confirms the AI agent can read and write workspace files and report results