Module 1 — 安裝指南 (Windows 11 與 macOS)

Orientation

Module 1 的目標,是把每台筆電變成可驗收的 AI Agent 工作環境。Module 1 turns each laptop into a reviewable AI agent workspace.

學員不需要先會寫程式;重點是照流程裝好工具、登入、連接 GitHub,並用四項任務確認環境真的能工作。Learners do not need prior coding experience. The goal is to install the tools, sign in, connect GitHub, and prove the environment works with four checks.

這是一份給「完全沒有寫過程式」的老師的逐步安裝指南。照著做,就能在自己的筆電上建立一套可運作的 AI Agent 工作環境。建議先看「一鍵安裝」;若遇到問題,再參考「手動安裝」與「常見問題」。

Infographic showing a laptop connected to the core AI Agent workspace tools.

開始前

Before Setup

安裝時不要猜錯誤;保留訊息,比自己亂試更重要。Do not guess at setup errors; preserve the message and ask for help.

先看一鍵安裝Start with one-command setup

腳本會安裝主要工具,且可重複執行。The scripts install the core tools and can be re-run safely.

看到紅字要複製Copy red errors

把完整錯誤貼給老師或 AI Agent 解讀。Copy the whole error for the instructor or AI agent to interpret.

重開終端機Reopen Terminal

很多工具裝好後,需要重新開啟終端機才會進 PATH。Many tools need a fresh terminal before they appear on PATH.

這份指南會在你的筆電上安裝下列工具:

工具用途
VS Code程式碼編輯器,也是日後操作 AI Agent 的主要視窗
Git版本管理工具,許多 AI 工具會用到
Node.js + npmJavaScript 執行環境,用來啟動 local web server 與安裝 Codex CLI
uv (Python)管理 Python 與套件,安裝/更新/移除都很簡單
Codex CLIOpenAI 的 AI Agent 命令列工具,可用免費或 ChatGPT Plus 帳號
Playwright MCPCodex 的瀏覽器外掛 (plugin),讓 AI Agent 能開網頁、點擊、填表單與擷取畫面
GitHub CLI (gh)用瀏覽器登入 GitHub,下載 (clone) 專案、推送與部署 GitHub Pages
VS Code 擴充套件Python、Jupyter、Git、JavaScript,以及 Codex AI 編程代理
唯一要記住的一條規則:如果畫面出現紅色錯誤訊息,把整段文字複製起來,貼給授課老師或貼給 AI Agent,請它幫你解讀。不要自己猜、也不要直接關掉。

最低電腦需求

Requirements

8 GB 可以完成任務;16 GB 會讓工作坊明顯順很多。8 GB can finish the tasks; 16 GB makes the workshop much smoother.

Windows 11

64 位元、App Installer / winget、10 GB 以上空間、可安裝軟體與穩定網路。64-bit Windows, App Installer / winget, 10 GB free space, install permission, and stable network.

macOS

macOS 12 以上、Apple Silicon 或 Intel、10 GB 以上空間、可執行 Homebrew 與 sudo。macOS 12 or later, Apple Silicon or Intel, 10 GB free space, and permission for Homebrew and sudo.

VS Code Node.js Python / uv Chromium

本工作坊會同時開啟 VS Code、Node.js、Python 與一個由 Codex 操控的 Chromium 瀏覽器。請先確認你的筆電符合下列規格 (標示「建議」者為較順暢的門檻)。

Windows 11

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

macOS

項目最低需求建議
作業系統macOS 12 MontereymacOS 13 Ventura 以上
處理器Apple Silicon (M1 以上) 或 Intel x86_64Apple Silicon
記憶體 (RAM)8 GB16 GB
可用磁碟空間10 GB20 GB 以上
權限系統管理員帳號 (可執行 Homebrew 與 sudo)同左
網路穩定寬頻,可存取 GitHub 與 AI 服務同左
瀏覽器Safari 或 Chrome (供登入流程)同左
8 GB 記憶體可完成所有任務,但同時開啟 VS Code、瀏覽器與多個終端機時,16 GB 會明顯較順暢。磁碟空間需含工具鏈、Chromium 瀏覽器與專案的 node_modules 與 Python 套件。

一鍵安裝

One-command Setup

優先走一鍵安裝;失敗時重開終端機再跑一次。Use one-command setup first; if it fails, reopen Terminal and run it again.

取得腳本Get script

Windows 用 setup-windows.bat;macOS 用 setup-macos.sh。Windows uses setup-windows.bat; macOS uses setup-macos.sh.

執行Run

照平台步驟執行,允許必要權限。Follow the platform steps and allow required permissions.

看總結Read summary

結束時確認 OK / FAIL 數量。Check the OK / FAIL count at the end.

重開Restart

關閉並重新開啟終端機,再繼續登入。Close and reopen Terminal before sign-in.

請依你的作業系統選擇下方分頁,照著三個步驟做。腳本可以重複執行:萬一中途出錯,重開終端機後再跑一次即可,已安裝的工具會自動略過。

Infographic showing Windows and macOS one-command setup flows merging into a completion check.

步驟 1 — 取得安裝腳本

向授課老師索取 setup-windows.bat 檔案 (或從工作坊提供的連結下載),並存到「下載 (Downloads)」資料夾。

步驟 2 — 執行腳本

最簡單的方式:到「下載」資料夾用滑鼠雙擊 setup-windows.bat 即可開始安裝。

若你想從終端機執行,先按 Win + X 選「終端機 (Terminal)」,再依你看到的提示字元貼上對應指令:

PowerShell (提示字元為 PS C:\…>):

& "$HOME\Downloads\setup-windows.bat"

命令提示字元 Command Prompt (提示字元為 C:\…>):

"%USERPROFILE%\Downloads\setup-windows.bat"

按 Enter 後等待。安裝過程可能跳出權限或使用者帳戶控制 (UAC) 視窗,請按「是 / 允許」。結束時畫面會列出 [OK] 與 [FAIL] 的數量總結。腳本可重複執行,出錯就重開終端機再跑一次。

看到「全部完成!」後,請關閉並重新開啟終端機,再進入下方「登入 AI Agent」。

步驟 1 — 取得安裝腳本

向授課老師索取 setup-macos.sh 檔案 (或從工作坊提供的連結下載),並存到「下載 (Downloads)」資料夾。

步驟 2 — 開啟終端機

按 Command + 空白鍵 開啟 Spotlight,輸入「Terminal」後按 Enter。

步驟 3 — 貼上並執行這一行

bash ~/Downloads/setup-macos.sh

按 Enter 後等待。安裝 Homebrew 時可能要求輸入「登入密碼」(輸入時畫面不會顯示字元,屬正常現象)。結束時畫面會列出每項工具的 OK 或 FAIL 總結。

看到「全部完成!」後,請關閉並重新開啟終端機,再進入下方「登入 AI Agent」。

手動安裝 (備用方案)

Manual Fallback

手動安裝不是另一套課程,而是用來補救失敗項目。Manual install is not a second course; it is a fallback for failed items.

基礎工具Base tools

VS Code, Git, Node.js LTS, uv

Agent 工具Agent tools

Codex CLI, Playwright MCP, GitHub CLI

VS Code 擴充VS Code extensions

Python, Jupyter, GitLens, ESLint, Codex

每裝完一項就重開終端機,再用檢查清單確認版本。After installing each item, reopen Terminal and confirm it with the checklist.

如果一鍵安裝某項失敗,或你想自己一步一步來,可依下表逐項安裝。安裝完每項後,關閉並重新開啟終端機,再用「檢查清單」確認。

工具下載 / 安裝方式備註
VS Codecode.visualstudio.com/download下載後雙擊安裝;安裝時勾選「加入 PATH」
Gitgit-scm.com/downloads一路按「下一步」採用預設值即可
Node.js LTSnodejs.org選擇「LTS」版本,安裝後即有 npm
uv (Python)docs.astral.sh/uv依該頁的一行安裝指令操作
Codex CLI於終端機執行 npm install -g @openai/codex需先裝好 Node.js
Playwright MCP於終端機執行 npx -y playwright install chromium 下載瀏覽器,再執行 codex mcp add playwright -- npx -y @playwright/mcp@latest 註冊給 Codex需先裝好 Node.js 與 Codex CLI
GitHub CLIcli.github.com裝好後執行 gh auth login

VS Code 擴充套件 (extensions)

開啟 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 指令」,請關閉並重新開啟終端機;macOS 使用者可在 VS Code 內按 Cmd+Shift+P,執行「Shell Command: Install 'code' command in PATH」。

登入 AI Agent

Sign In

登入完成後,先用一個最小任務確認 Agent 真的能動。After sign-in, use one tiny task to confirm the agent really works.

codex "請建立一個名為 hello.txt 的檔案,內容寫上 Hello, AI Agent"
終端機登入Terminal sign-in

輸入 codex,依瀏覽器登入流程完成授權。Run codex and finish the browser-based authorization flow.

VS Code 共用帳號VS Code shares the account

Codex CLI 與 VS Code 擴充套件使用同一個 ChatGPT 帳號。Codex CLI and the VS Code extension use the same ChatGPT account.

  1. 開啟終端機,輸入 codex 後按 Enter。
  2. 依畫面指示選擇用帳號登入,瀏覽器會開啟登入頁;用你的免費或 ChatGPT Plus 帳號登入後回到終端機。
  3. 執行下方「Hello, AI Agent」測試,確認 Agent 能接收指令並回應。
codex "請建立一個名為 hello.txt 的檔案,內容寫上 Hello, AI Agent"

若 Agent 成功建立檔案並回報結果,代表 AI Agent 環境已可運作。

VS Code 內的 Codex 擴充套件 (openai.chatgpt) 與這裡的 Codex CLI 共用同一個 ChatGPT 帳號,登入一次即可同時在終端機與編輯器中使用。

讓 Codex 操作瀏覽器 (Playwright MCP)

Browser Plugin

Playwright MCP 讓 Codex 能開網頁、點擊、填表單與擷取畫面。Playwright MCP lets Codex open pages, click, fill forms, and capture screens.

下載瀏覽器Install browser

npx -y playwright install chromium

註冊外掛Register plugin

codex mcp add playwright -- npx -y @playwright/mcp@latest

確認啟用Confirm enabled

codex mcp list

做畫面測試Run a screen test

請 Codex 開網頁並截圖。Ask Codex to open a page and save a screenshot.

要讓 AI Agent 能開網頁、點擊、填表單與擷取畫面,需要為 Codex 安裝 Playwright MCP 外掛 (plugin)。一鍵安裝腳本已經幫你裝好並註冊;若你採用手動安裝,請執行下面兩個步驟。

Infographic showing browser control, account authorization, repository sync, and static site publishing.

步驟 1 — 下載瀏覽器

npx -y playwright install chromium

步驟 2 — 把外掛註冊給 Codex

codex mcp add playwright -- npx -y @playwright/mcp@latest

步驟 3 — 確認外掛已啟用

codex mcp list

清單中應出現 playwright 且狀態為 enabled。接著可請 Codex 開啟一個網頁並擷取畫面,驗證它能操作瀏覽器。

指令可重複執行:若 playwright 已註冊,重跑安裝腳本會自動略過。

連結 GitHub

GitHub

GitHub CLI 用瀏覽器完成登入,讓 clone、push、部署少掉一堆帳密問題。GitHub CLI signs in through the browser, reducing credential friction for clone, push, and deployment.

登入Sign in

gh auth login

確認Confirm

gh auth status

設定提交身分Set commit identity

git config --global user.name
git config --global user.email

要把專案下載 (clone) 下來、或把網站上傳到 GitHub,需要先讓電腦「連上」你的 GitHub 帳號。我們使用 GitHub CLI (gh),全程用瀏覽器登入,不需要產生 SSH 金鑰、也不需要在終端機輸入密碼。

安裝腳本已經幫你裝好 gh。若顯示「找不到 gh」,請關閉並重新開啟終端機。

步驟 1 — 登入

gh auth login

依畫面方向鍵選擇,建議選項依序為:GitHub.com → HTTPS → 詢問是否用 Git 認證時選 Yes → Login with a web browser。畫面會顯示一組一次性代碼 (one-time code),按 Enter 開啟瀏覽器,貼上代碼並授權即可。完成後它也會自動設定好 git,之後 clone / push 都不必再登入。

步驟 2 — 確認登入狀態

gh auth status

步驟 3 — 設定提交身分 (只需做一次)

commit 需要知道你的名字與信箱,請把下方換成你自己的資料:

git config --global user.name "你的名字"
git config --global user.email "你的信箱@example.com"

步驟 4 — 下載 (clone) 一個專案

gh repo clone 你的帳號/專案名稱

部署到 GitHub Pages

Publishing

GitHub Pages 的教學重點,是把本機資料夾變成可分享的靜態網站。GitHub Pages turns a local folder into a shareable static website.

建立紀錄Create history

git init
git add .
git commit

建立 repoCreate repo

gh repo create ... --push

開啟 PagesEnable Pages

用指令或 GitHub 網頁設定。Use the command or GitHub web settings.

等待上線Wait for publish

網址通常約一分鐘後可用。The site usually appears after about a minute.

GitHub Pages 可以把一個靜態網站 (例如只有 index.html 的資料夾) 免費發佈成公開網址。請先用終端機進到你的網站資料夾,再依序執行。

步驟 1 — 建立本機版本紀錄

git init
git add .
git commit -m "first site"

步驟 2 — 建立 GitHub repo 並上傳

下面一行會建立一個公開 repo、設定遠端並把內容推上去 (請把 我的網站 換成你想要的名稱):

gh repo create 我的網站 --public --source=. --remote=origin --push

步驟 3 — 開啟 Pages

方法 A (指令):

gh api -X POST repos/{owner}/{repo}/pages -f "source[branch]=main" -f "source[path]=/"

方法 B (網頁,較直覺):到該 repo 的 Settings → Pages,在 Branch 選 main、資料夾選 / (root),按 Save。

完成後網址會是 https://你的帳號.github.io/我的網站/,可能需要等一分鐘左右才會生效。

驗證 (四項任務)

Verification

不是看到安裝完成就結束;要用四項任務驗收工具鏈。Setup is not done when install ends; verify the toolchain with four tasks.

ExcelExcel

讀取資料並輸出新 Excel。Read data and output a new Excel file.

WordWord

讀取 Word 並產出修改版。Read a Word file and produce an edited version.

Local serverLocal server

用 Node.js 啟動本機網站。Start a local site with Node.js.

BrowserBrowser

讓 Codex 開網頁並截圖。Have Codex open a page and save a screenshot.

下列四項對應 Module 1 的驗證任務。可直接把每個指令貼給 codex,或自行在終端機執行。

Infographic showing four verification tasks and a troubleshooting retry loop.
任務內容驗證重點
Python 驗證讀取 Excel、整理資料、輸出新的 Excel套件與檔案處理可運作
Word 驗證讀取 Word、產生修改後的 WordOffice 文件處理可運作
JavaScript 驗證啟動簡單的 local web serverNode.js 與 local host 可運作
瀏覽器驗證請 Codex 透過 Playwright MCP 開啟指定網頁並擷取畫面或讀取內容瀏覽器外掛與 AI Agent 操作瀏覽器可運作

準備 Python 專案 (Excel + Word)

uv init verify-python
cd verify-python
uv add openpyxl python-docx

接著請 AI Agent 幫你寫一支程式:讀取一個 Excel、整理後輸出新檔,再讀取一個 Word、輸出修改後的版本。

啟動 local web server (JavaScript)

npx http-server

看到網址 (例如 http://127.0.0.1:8080) 後,用瀏覽器開啟即代表成功。按 Ctrl + C 可停止。

讓 Codex 操作瀏覽器 (Playwright)

確認 codex mcp list 中的 playwright 為 enabled 後,請 Codex 開啟一個網頁並擷取畫面:

codex "用瀏覽器開啟 https://example.com,並把整頁擷圖存成 example.png"

若 Agent 成功產生截圖,代表瀏覽器外掛可運作。

檢查清單

Checklist

完成的標準,是每一個核心命令都有回應,且 Playwright 顯示 enabled。Completion means every core command responds, and Playwright shows enabled.

✓

VS Code 與必要 extensions 已安裝。VS Code and required extensions are installed.

✓

code, git, node, npm, uv, gh, codex 都有版本資訊。code, git, node, npm, uv, gh, and codex all report versions.

✓

codex mcp list 有 playwright 且為 enabled。codex mcp list includes playwright and shows enabled.

✓

Hello 測試與四項驗證任務都成功。The Hello test and all four verification tasks succeed.

在終端機逐行執行下列指令,每一行都應顯示版本號 (而非「找不到指令」)。

code --version
git --version
node -v
npm -v
uv --version
gh --version
codex --version
codex mcp list

常見問題

Troubleshooting and Notes

常見問題多半不是「不會寫程式」,而是 PATH、權限、網路或登入狀態。Most setup issues are not coding issues; they are PATH, permission, network, or sign-in state.

處理原則Handling rule

先複製完整錯誤,再重開終端機、重跑腳本,或依常見問題逐項排除。Copy the full error first, then reopen Terminal, rerun the script, or follow the troubleshooting table.

使用與來源說明Use and source notes

本投影片供 AI Agent 工作坊 Module 1 課堂投影使用,重點整理自同專案的 Module 1 安裝指南。實際工具版本、登入畫面與下載連結仍以使用當下官方頁面為準。These slides are for AI Agent Workshop Module 1 classroom projection and are based on the Module 1 setup guide in this project. Tool versions, sign-in screens, and download pages should follow the current official pages when used.

症狀原因與解法
'xxx' 不是內部或外部命令 / command not found多半是 PATH 還沒更新。關閉並重新開啟終端機後再試;仍不行就重跑一鍵安裝腳本。
找不到 winget (Windows)到 Microsoft Store 安裝「應用程式安裝程式 (App Installer)」,或先用手動安裝。
找不到 brew (macOS)重開終端機讓 Homebrew 進入 PATH;或重跑一鍵安裝腳本 (它會自動安裝 Homebrew)。
雙擊 .bat 後黑視窗一閃就消失改從已開啟的終端機執行 (見「一鍵安裝」的指令),才看得到訊息;或在腳本最後保留 pause。
找不到 gh (GitHub CLI)關閉並重新開啟終端機;仍不行就重跑一鍵安裝腳本。
codex mcp list 沒有 playwright手動執行 codex mcp add playwright -- npx -y @playwright/mcp@latest 重新註冊;確認 Codex CLI 已安裝。
Codex 操作瀏覽器時找不到瀏覽器 (browser not found)執行 npx -y playwright install chromium 重新下載瀏覽器。
gh auth login 沒有自動開啟瀏覽器把畫面顯示的網址複製起來,自己貼到瀏覽器開啟,再輸入一次性代碼。
GitHub Pages 顯示 404等約一分鐘再重新整理;並確認 Pages 的 Branch 為 main、資料夾為 / (root)。
下載很慢或卡住多半是網路或代理 (proxy) 問題。換較穩定的網路,或請授課老師協助設定 proxy。
一直跳出權限/UAC 視窗屬正常現象,按「是 / 允許」即可。

Module 1 — Setup Guide (Windows 11 & macOS)

Orientation

Module 1 的目標,是把每台筆電變成可驗收的 AI Agent 工作環境。Module 1 turns each laptop into a reviewable AI agent workspace.

學員不需要先會寫程式;重點是照流程裝好工具、登入、連接 GitHub,並用四項任務確認環境真的能工作。Learners do not need prior coding experience. The goal is to install the tools, sign in, connect GitHub, and prove the environment works with four checks.

A step-by-step setup guide for teachers with zero programming experience. Follow it to get a working AI Agent environment on your own laptop. Start with "One-command setup"; if anything fails, use "Manual install" and "Troubleshooting."

Infographic showing a laptop connected to the core AI Agent workspace tools.

Before you start

Before Setup

安裝時不要猜錯誤;保留訊息,比自己亂試更重要。Do not guess at setup errors; preserve the message and ask for help.

先看一鍵安裝Start with one-command setup

腳本會安裝主要工具,且可重複執行。The scripts install the core tools and can be re-run safely.

看到紅字要複製Copy red errors

把完整錯誤貼給老師或 AI Agent 解讀。Copy the whole error for the instructor or AI agent to interpret.

重開終端機Reopen Terminal

很多工具裝好後,需要重新開啟終端機才會進 PATH。Many tools need a fresh terminal before they appear on PATH.

This guide installs the following tools on your laptop:

ToolPurpose
VS CodeCode editor and your main window for driving the AI Agent later
GitVersion-control tool used by many AI tools
Node.js + npmJavaScript runtime, used to start a local web server and install the Codex CLI
uv (Python)Manages Python and packages; easy to install, update, and remove
Codex CLIOpenAI's AI Agent command-line tool; works with a free or ChatGPT Plus account
Playwright MCPCodex browser plugin that lets the AI Agent open pages, click, fill forms, and take screenshots
GitHub CLI (gh)Sign in to GitHub via browser; clone projects, push, and deploy GitHub Pages
VS Code extensionsPython, Jupyter, Git, JavaScript, and the Codex coding agent
The one rule to remember: if you see a red error message, copy the whole text and paste it to your instructor or to the AI Agent and ask it to explain. Do not guess, and do not just close it.

Minimum computer requirements

Requirements

8 GB 可以完成任務;16 GB 會讓工作坊明顯順很多。8 GB can finish the tasks; 16 GB makes the workshop much smoother.

Windows 11

64 位元、App Installer / winget、10 GB 以上空間、可安裝軟體與穩定網路。64-bit Windows, App Installer / winget, 10 GB free space, install permission, and stable network.

macOS

macOS 12 以上、Apple Silicon 或 Intel、10 GB 以上空間、可執行 Homebrew 與 sudo。macOS 12 or later, Apple Silicon or Intel, 10 GB free space, and permission for Homebrew and sudo.

VS Code Node.js Python / uv Chromium

This workshop runs VS Code, Node.js, Python, and a Chromium browser driven by Codex at the same time. Make sure your laptop meets the specs below ("Recommended" is the threshold for a smoother experience).

Windows 11

ItemMinimumRecommended
Operating systemWindows 11 (64-bit) with App Installer (winget)Windows 11, fully updated
Processor64-bit x64 dual-coreQuad-core or better
Memory (RAM)8 GB16 GB
Free disk space10 GB20 GB or more
PrivilegesAdministrator rights (install software, allow UAC)Same
NetworkStable broadband reaching GitHub and AI servicesSame
BrowserMicrosoft Edge or Chrome (for sign-in flows)Same

macOS

ItemMinimumRecommended
Operating systemmacOS 12 MontereymacOS 13 Ventura or later
ProcessorApple Silicon (M1+) or Intel x86_64Apple Silicon
Memory (RAM)8 GB16 GB
Free disk space10 GB20 GB or more
PrivilegesAdmin account (run Homebrew and sudo)Same
NetworkStable broadband reaching GitHub and AI servicesSame
BrowserSafari or Chrome (for sign-in flows)Same
8 GB of RAM completes every task, but 16 GB is noticeably smoother when VS Code, the browser, and several terminals are open together. Disk space covers the toolchain, the Chromium browser, and per-project node_modules and Python packages.

One-command setup

One-command Setup

優先走一鍵安裝;失敗時重開終端機再跑一次。Use one-command setup first; if it fails, reopen Terminal and run it again.

取得腳本Get script

Windows 用 setup-windows.bat;macOS 用 setup-macos.sh。Windows uses setup-windows.bat; macOS uses setup-macos.sh.

執行Run

照平台步驟執行,允許必要權限。Follow the platform steps and allow required permissions.

看總結Read summary

結束時確認 OK / FAIL 數量。Check the OK / FAIL count at the end.

重開Restart

關閉並重新開啟終端機,再繼續登入。Close and reopen Terminal before sign-in.

Pick your operating system below and follow the three steps. The scripts are safe to re-run: if something fails midway, reopen Terminal and run it again; installed tools are skipped automatically.

Infographic showing Windows and macOS one-command setup flows merging into a completion check.

Step 1 — Get the setup script

Get setup-windows.bat from your instructor (or the workshop download link) and save it to your Downloads folder.

Step 2 — Run the script

Easiest way: open your Downloads folder and double-click setup-windows.bat to start the install.

If you prefer running it from a terminal, press Win + X and choose "Terminal", then paste the line that matches your prompt:

PowerShell (prompt looks like PS C:\…>):

& "$HOME\Downloads\setup-windows.bat"

Command Prompt (prompt looks like C:\…>):

"%USERPROFILE%\Downloads\setup-windows.bat"

Press Enter and wait. A permission or User Account Control (UAC) window may appear; click "Yes / Allow." At the end you will see a count of [OK] and [FAIL] items. The script is safe to re-run: if something fails, reopen Terminal and run it again.

After you see "All done!", close and reopen Terminal, then go to "Sign in to the Agent" below.

Step 1 — Get the setup script

Get setup-macos.sh from your instructor (or the workshop download link) and save it to your Downloads folder.

Step 2 — Open Terminal

Press Command + Space to open Spotlight, type "Terminal", and press Enter.

Step 3 — Paste and run this one line

bash ~/Downloads/setup-macos.sh

Press Enter and wait. Installing Homebrew may ask for your login password (characters will not show as you type, which is normal). At the end you will see an OK/FAIL summary per tool.

After you see "All done!", close and reopen Terminal, then go to "Sign in to the Agent" below.

Manual install (fallback)

Manual Fallback

手動安裝不是另一套課程,而是用來補救失敗項目。Manual install is not a second course; it is a fallback for failed items.

基礎工具Base tools

VS Code, Git, Node.js LTS, uv

Agent 工具Agent tools

Codex CLI, Playwright MCP, GitHub CLI

VS Code 擴充VS Code extensions

Python, Jupyter, GitLens, ESLint, Codex

每裝完一項就重開終端機,再用檢查清單確認版本。After installing each item, reopen Terminal and confirm it with the checklist.

If one item fails in the one-command setup, or you prefer to do it step by step, install each tool from the table. After each one, close and reopen Terminal, then confirm with the checklist.

ToolDownload / installNote
VS Codecode.visualstudio.com/downloadDouble-click to install; tick "Add to PATH"
Gitgit-scm.com/downloadsAccept the defaults (keep clicking Next)
Node.js LTSnodejs.orgChoose the "LTS" version; npm comes with it
uv (Python)docs.astral.sh/uvUse the one-line install command on that page
Codex CLIRun npm install -g @openai/codex in TerminalInstall Node.js first
Playwright MCPRun npx -y playwright install chromium to get the browser, then codex mcp add playwright -- npx -y @playwright/mcp@latest to register it with CodexInstall Node.js and the Codex CLI first
GitHub CLIcli.github.comAfter install, run gh auth login

VS Code extensions

Open VS Code, click the square Extensions icon on the left, search for and install the items below; or run the commands in 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
If Terminal says "code: command not found", close and reopen Terminal; on macOS you can open VS Code, press Cmd+Shift+P, and run "Shell Command: Install 'code' command in PATH".

Sign in to the Agent

Sign In

登入完成後,先用一個最小任務確認 Agent 真的能動。After sign-in, use one tiny task to confirm the agent really works.

codex "請建立一個名為 hello.txt 的檔案,內容寫上 Hello, AI Agent"
終端機登入Terminal sign-in

輸入 codex,依瀏覽器登入流程完成授權。Run codex and finish the browser-based authorization flow.

VS Code 共用帳號VS Code shares the account

Codex CLI 與 VS Code 擴充套件使用同一個 ChatGPT 帳號。Codex CLI and the VS Code extension use the same ChatGPT account.

  1. Open Terminal, type codex and press Enter.
  2. Follow the prompt to sign in; your browser opens a login page. Sign in with your free or ChatGPT Plus account and return to Terminal.
  3. Run the "Hello, AI Agent" test below to confirm the agent receives instructions and responds.
codex "Create a file named hello.txt containing the text Hello, AI Agent"

If the agent creates the file and reports back, your AI Agent environment is working.

The Codex extension inside VS Code (openai.chatgpt) shares the same ChatGPT account as the Codex CLI here, so signing in once works in both the terminal and the editor.

Let Codex drive a browser (Playwright MCP)

Browser Plugin

Playwright MCP 讓 Codex 能開網頁、點擊、填表單與擷取畫面。Playwright MCP lets Codex open pages, click, fill forms, and capture screens.

下載瀏覽器Install browser

npx -y playwright install chromium

註冊外掛Register plugin

codex mcp add playwright -- npx -y @playwright/mcp@latest

確認啟用Confirm enabled

codex mcp list

做畫面測試Run a screen test

請 Codex 開網頁並截圖。Ask Codex to open a page and save a screenshot.

To let the AI Agent open pages, click, fill forms, and take screenshots, install the Playwright MCP plugin for Codex. The one-command setup already installs and registers it; if you went the manual route, run the two steps below.

Infographic showing browser control, account authorization, repository sync, and static site publishing.

Step 1 — Download the browser

npx -y playwright install chromium

Step 2 — Register the plugin with Codex

codex mcp add playwright -- npx -y @playwright/mcp@latest

Step 3 — Confirm the plugin is enabled

codex mcp list

You should see playwright with status enabled. Then ask Codex to open a page and screenshot it to confirm it can drive the browser.

The commands are safe to re-run: if playwright is already registered, re-running the setup script skips it.

Connect to GitHub

GitHub

GitHub CLI 用瀏覽器完成登入,讓 clone、push、部署少掉一堆帳密問題。GitHub CLI signs in through the browser, reducing credential friction for clone, push, and deployment.

登入Sign in

gh auth login

確認Confirm

gh auth status

設定提交身分Set commit identity

git config --global user.name
git config --global user.email

To clone a project or upload a site to GitHub, your computer first needs to be "connected" to your GitHub account. We use the GitHub CLI (gh), which signs in entirely through the browser: no SSH keys to generate, and no password typed in the terminal.

The setup script already installed gh for you. If you see "gh: command not found", close and reopen Terminal.

Step 1 — Sign in

gh auth login

Use the arrow keys to choose, in order: GitHub.com → HTTPS → Yes when asked to authenticate Git → Login with a web browser. A one-time code appears; press Enter to open the browser, paste the code, and authorize. It also configures git automatically, so future clone / push need no further login.

Step 2 — Confirm sign-in

gh auth status

Step 3 — Set your commit identity (once)

Commits need your name and email. Replace the values below with your own:

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Step 4 — Clone a project

gh repo clone your-account/your-repo

Deploy to GitHub Pages

Publishing

GitHub Pages 的教學重點,是把本機資料夾變成可分享的靜態網站。GitHub Pages turns a local folder into a shareable static website.

建立紀錄Create history

git init
git add .
git commit

建立 repoCreate repo

gh repo create ... --push

開啟 PagesEnable Pages

用指令或 GitHub 網頁設定。Use the command or GitHub web settings.

等待上線Wait for publish

網址通常約一分鐘後可用。The site usually appears after about a minute.

GitHub Pages publishes a static website (e.g. a folder with just an index.html) to a free public URL. In Terminal, first go into your website folder, then run these in order.

Step 1 — Create a local history

git init
git add .
git commit -m "first site"

Step 2 — Create the GitHub repo and push

This one line creates a public repo, sets the remote, and pushes (replace my-site with the name you want):

gh repo create my-site --public --source=. --remote=origin --push

Step 3 — Turn on Pages

Option A (command):

gh api -X POST repos/{owner}/{repo}/pages -f "source[branch]=main" -f "source[path]=/"

Option B (web, more visual): go to the repo's Settings → Pages, set Branch to main and folder to / (root), then Save.

Your site URL will be https://your-account.github.io/my-site/. It can take about a minute to go live.

Verify (four tasks)

Verification

不是看到安裝完成就結束;要用四項任務驗收工具鏈。Setup is not done when install ends; verify the toolchain with four tasks.

ExcelExcel

讀取資料並輸出新 Excel。Read data and output a new Excel file.

WordWord

讀取 Word 並產出修改版。Read a Word file and produce an edited version.

Local serverLocal server

用 Node.js 啟動本機網站。Start a local site with Node.js.

BrowserBrowser

讓 Codex 開網頁並截圖。Have Codex open a page and save a screenshot.

These four match the Module 1 verification tasks. Paste each command to codex, or run them yourself in Terminal.

Infographic showing four verification tasks and a troubleshooting retry loop.
TaskContentFocus
Python checkRead an Excel file, process data, output a new ExcelPackages and file handling work
Word checkRead a Word file, produce a modified WordOffice document handling works
JavaScript checkStart a simple local web serverNode.js and local host work
Browser checkAsk Codex to open a given page via Playwright MCP and screenshot or read itBrowser plugin and agent browser control work

Set up the Python project (Excel + Word)

uv init verify-python
cd verify-python
uv add openpyxl python-docx

Then ask the AI Agent to write a program: read an Excel and output a new one, then read a Word and output a modified version.

Start a local web server (JavaScript)

npx http-server

When you see a URL (e.g. http://127.0.0.1:8080), open it in a browser to confirm. Press Ctrl + C to stop.

Let Codex drive a browser (Playwright)

After confirming playwright is enabled in codex mcp list, ask Codex to open a page and screenshot it:

codex "Open https://example.com in a browser and save a full-page screenshot as example.png"

If the agent produces the screenshot, the browser plugin works.

Checklist

Checklist

完成的標準,是每一個核心命令都有回應,且 Playwright 顯示 enabled。Completion means every core command responds, and Playwright shows enabled.

✓

VS Code 與必要 extensions 已安裝。VS Code and required extensions are installed.

✓

code, git, node, npm, uv, gh, codex 都有版本資訊。code, git, node, npm, uv, gh, and codex all report versions.

✓

codex mcp list 有 playwright 且為 enabled。codex mcp list includes playwright and shows enabled.

✓

Hello 測試與四項驗證任務都成功。The Hello test and all four verification tasks succeed.

Run each command in Terminal; every line should print a version number (not "command not found").

code --version
git --version
node -v
npm -v
uv --version
gh --version
codex --version
codex mcp list

Troubleshooting

Troubleshooting and Notes

常見問題多半不是「不會寫程式」,而是 PATH、權限、網路或登入狀態。Most setup issues are not coding issues; they are PATH, permission, network, or sign-in state.

處理原則Handling rule

先複製完整錯誤,再重開終端機、重跑腳本,或依常見問題逐項排除。Copy the full error first, then reopen Terminal, rerun the script, or follow the troubleshooting table.

使用與來源說明Use and source notes

本投影片供 AI Agent 工作坊 Module 1 課堂投影使用,重點整理自同專案的 Module 1 安裝指南。實際工具版本、登入畫面與下載連結仍以使用當下官方頁面為準。These slides are for AI Agent Workshop Module 1 classroom projection and are based on the Module 1 setup guide in this project. Tool versions, sign-in screens, and download pages should follow the current official pages when used.

SymptomCause and fix
'xxx' is not recognized / command not foundUsually PATH has not refreshed. Close and reopen Terminal and try again; if it still fails, re-run the one-command script.
winget not found (Windows)Install "App Installer" from the Microsoft Store, or use the manual install.
brew not found (macOS)Reopen Terminal so Homebrew is on PATH; or re-run the one-command script (it installs Homebrew automatically).
Double-clicking the .bat flashes a black window and closesRun it from an already-open Terminal (see "One-command setup") so you can read the messages; the script also keeps a pause at the end.
gh: command not found (GitHub CLI)Close and reopen Terminal; if it still fails, re-run the one-command script.
playwright missing from codex mcp listRe-register it manually with codex mcp add playwright -- npx -y @playwright/mcp@latest; make sure the Codex CLI is installed.
"browser not found" when Codex drives the browserRun npx -y playwright install chromium to download the browser again.
gh auth login did not open a browserCopy the URL shown on screen, open it in your browser yourself, then enter the one-time code.
GitHub Pages shows 404Wait about a minute and refresh; confirm Pages Branch is main and folder is / (root).
Downloads are slow or stuckUsually a network or proxy issue. Switch to a more stable network, or ask your instructor to help configure the proxy.
Repeated permission/UAC promptsThis is normal; click "Yes / Allow".