2026年7月11日 星期六

INHON 應宏 Carbonbook 筆電維修 (五)

前一篇測試已完成 Python/Node 開發環境布建, 本篇要來安裝 AI 專案開發工具 : Claude Code 與 Antigravity CLI. 

本系列本系列之前的文章參考 :  



1. 安裝 Claude Code : 

安裝 Windows 原生 Claude Code 介面作法參考 :


其實是利用安裝 Git 時附帶的 git-bash.

先用 scoop which git 指令查找 git-bash 的位置 :

PS C:\Users\tony1> scoop which git   
~\scoop\apps\git\current\cmd\git.exe

然後設定一個環境變數在執行 cluade 指令時呼叫 git.exe, 前面代表使用者目錄的波浪符號 ~ 須置換為真正的使用者路徑 C:\Users\tony1, 並且將 git.exe 改成 git-bash.exe, 這樣 Claude Code 作為一個外部引擎去讀取環境變數時才讀得到, 完整的絕對位置如下 : 

C:\Users\tony1\scoop\apps\git\current\cmd\git.exe

用下列指令新增一個使用者環境變數 CLAUDE_CODE_GIT_BASH_PATH

PS C:\Users\tony1> [Environment]::SetEnvironmentVariable("CLAUDE_CODE_GIT_BASH_PATH", "C:\Users\tony1\scoop\apps\git\current\git-bash.exe", "User")

開啟一個新的 PS 視窗用下列指令檢查環境變數是否正確 :

PS C:\Users\tony1> $env:CLAUDE_CODE_GIT_BASH_PATH   
C:\Users\tony1\scoop\apps\git\current\git-bash.exe

安裝 Windows 原生版的 Claude Code : 

PS C:\Users\tony1> irm https://claude.ai/install.ps1 | iex   
Setting up Claude Code...

√ Claude Code successfully installed!

  Version: 2.1.206

  Location: C:\Users\tony1\.local\bin\claude.exe


  Next: Run claude --help to get started

‼ Setup notes:
  ●Native installation exists but C:\Users\tony1\.local\bin is not in your PATH. Add it by opening: System
    Properties →Environment Variables →Edit User PATH →New →Add the path above. Then restart your
    terminal.


✅ Installation complete!

安裝完成後須將 Claude Code 的執行檔目錄路徑加入使用者環境變數 Path 中, 這樣以後才能在任何路徑下執行 Claude Code, 可用下面兩個 PS 指令設定 : 

PS C:\Users\tony1> $oldPath = [Environment]::GetEnvironmentVariable("PATH", "User")  
PS C:\Users\tony1> [Environment]::SetEnvironmentVariable("PATH", "$oldPath;C:\Users\tony1\.local\bin", "User")

開一個新的 PS 視窗, 用下列指令檢查環境變數是否有設定進去 : 

PS C:\Users\tony1> $env:PATH -split ";"   
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
C:\Program Files\Bandizip\
C:\Users\tony1\scoop\apps\nvm\current
C:\Users\tony1\scoop\apps\nvm\current\nodejs\nodejs
C:\Users\tony1\scoop\apps\git\current\cmd
C:\Users\tony1\scoop\persist\uv\tools\shims
C:\Users\tony1\scoop\persist\uv\python\shims
C:\Users\tony1\scoop\apps\python\current\Scripts
C:\Users\tony1\scoop\apps\python\current
C:\Users\tony1\scoop\shims
C:\Users\tony1\AppData\Local\Microsoft\WindowsApps
C:\Users\tony1\.local\bin

輸入 claude 按 Enter 啟動 Claude Code 介面 :

PS C:\Users\tony1> claude   
Welcome to Claude Code v2.1.206

 Let's get started.

 Choose the text style that looks best with your terminal
 To change this later, run /theme

   1. Auto (match terminal)
 > 2. Dark mode √
   3. Light mode
   4. Dark mode (colorblind-friendly)
   5. Light mode (colorblind-friendly)
   6. Dark mode (ANSI colors only)
   7. Light mode (ANSI colors only)

 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
  1  function greet() {
  2 -  console.log("Hello, World!");
  2 +  console.log("Hello, Claude!");
  3  }
 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
  Syntax theme: Monokai Extended (ctrl+t to disable)




這樣便完成 Claude Code 安裝了.


2. 安裝 Antigravity CLI : 

Antigravity 是 2026/6/18 之後 Google 提供給個人帳戶使用的 Coding 代理工具, 比 Gemini CLI 功能還多, 除了可以使用 Gemini 模型外也可以用 /model 指令選擇使用 Claude 或 GTP 模型, 參考 :


與 Cluade Code 類似, 谷歌提供 Windows 原生版 Antigravity CLI 安裝指令稿, 開啟 PS 視窗輸入下列指令安裝 :

PS C:\Users\tony1> irm https://antigravity.google/cli/install.ps1 | iex  
I0711 09:00:44.658613  9148 installer.go:27] Running Antigravity CLI setup...
I0711 09:00:44.827074  9148 installer_windows.go:45] Configuring Windows user PATH registry environment...
I0711 09:00:44.827608  9148 installer_windows.go:117] Successfully added %LOCALAPPDATA%\agy\bin to User PATH registry variable.
I0711 09:00:44.827608  9148 installer_windows.go:148] Broadcasting environment update system-wide...
I0711 09:00:45.058274  9148 installer_windows.go:167] Environment update broadcast completed.

Warning: C:\Users\tony1\AppData\Local\agy\bin is not present in your active Environment PATH.
Please restart your active terminal session, or add it manually if needed.


✅ Antigravity CLI binary placed successfully at C:\Users\tony1\AppData\Local\agy\bin\agy.exe
Note: The binary is installed, but it is not in your active PATH. Please follow the instructions above to add it, then restart your terminal session.

開啟一個新的 PS 視窗, 輸入 agy 就可啟動 Antigravity 了 :

PS C:\Users\tony1> agy 




用 Google Auth 登入, 複製金鑰貼到 agy 即可. 

至此就完成這次的 INHON Carbonbook 的復原工程了, 4GB DRAM 跑起來還是很輕快不卡頓, 沒想到因為無法開機塵封多年後, 只是把金手指接點清潔一下就恢復生機, 真是太棒了. 

不過畢竟是超過 12 年的老機器了, 第一次重灌 Win10 後去系統資訊裡修改裝置名稱, 重開機後網路卡介面居然消失無法連網, Gemini 提供了好幾招都無法喚回, 只好再次重灌, 結果仍然無法找回網路卡, 應該是網卡 GG 了, 只好插一顆 USB 網卡來上網. 這台筆電因為性能較最近修好的其他兩台好,所以會定位在備用機而非下載機. 

沒有留言 :