Turn your WLED-powered Octolamp into a real-time status light for GitHub Copilot CLI. When Copilot is thinking, the lamp breathes green. When it's idle, solid white. If something breaks, it blinks red.
No model-level prompting tricks - this uses Copilot CLI's native hooks system, which fires at session lifecycle events.
This is the companion repository for I made my Octolamp think with GitHub Copilot CLI hooks.
- Speaker: Bea Mendez Gandica, CEO/Founder, Nuevo Foundation
- When: Wednesday, October 28, 2026, 11:20-11:35 AM PDT
- Where: Ship & Tell @ Firehouse
The idea grew out of the Octolamps handed out at GitHub Universe 2025: what if a lamp could show when Copilot CLI is working? This project connects native CLI lifecycle events to a physical light through the WLED API, making agent activity visible beyond the terminal.
The session walks through the build, how Copilot CLI hooks work under the hood, and how to adapt the same approach to your own automations.
Try it yourself: Follow the Quick Start, or explore How Hooks Work. You can use any WLED-compatible light - not just an Octolamp.
| Status | Light Effect | Trigger |
|---|---|---|
| Thinking | 🟢 Breathing green (Apple-style pulse) | userPromptSubmitted - you hit enter |
| Idle | ⚪ Solid white | Stop - agent finishes responding |
| Session end | ⚪ Solid white | sessionEnd - session closes |
| Error | 🔴 Blinking red | errorOccurred - something broke |
- System-level hooks - not dependent on the AI model remembering to call a tool
- Cross-platform - PowerShell (Windows) and Bash (macOS/Linux) scripts
- Self-healing (optional) - auto-reconnects a dedicated WiFi adapter if it drops
- Silent failure - if the WLED device is unreachable, Copilot CLI continues uninterrupted
- Works with any WLED device - not just the Octolamp
You need a WLED-compatible smart light and a way to reach it over the network. The Octolamp is the recommended build - it's a 3D-printable GitHub Octocat lamp designed for WLED.
| Component | US Link | Notes |
|---|---|---|
| ESP8266 D1 Mini | Amazon US | The brains - runs WLED firmware |
| WS2812B LED Strip (60 LEDs/m) | Amazon US | ~2m needed, sold in 5m spools |
| Black PLA Filament | Amazon US | For the outer shell |
| White PLA Filament | Amazon US | For the diffuser and reflector |
| Micro-USB cable | Amazon US | Powers the lamp via USB |
Total cost: Under $20 for electronics (assuming you have a 3D printer and filament).
Full build instructions, STL files, and assembly photos: github.com/martinwoodward/octolamp
Already have a WLED-powered device? Skip the Octolamp build - these hooks work with any WLED controller. Just set WLED_HOST to your device's IP address.
If your WLED device runs in Access Point mode (the default), you'll want a dedicated USB WiFi adapter so your main WiFi stays connected to the internet while the adapter connects to WLED-AP.
| Component | US Link | Notes |
|---|---|---|
| UGREEN AX900 USB WiFi 6 | Amazon US | Compact; check platform compatibility below |
Compatibility: This specific UGREEN AX900 model does not support Windows on ARM or macOS, including Apple silicon Macs. Other options on the market support these platforms; choose an adapter with manufacturer-confirmed support for your exact OS version and processor architecture. This limitation applies to the linked adapter, not the cross-platform hooks.
Not needed if your WLED device is connected to your home/office WiFi network instead of running in AP mode.
- GitHub Copilot CLI installed and authenticated
- A WLED device on the network (see Shopping List above)
curlavailable in your terminal (included on Windows 10+, macOS, and most Linux distros)- Windows: PowerShell 7+ (
pwsh) installed and available in your PATH
Plug your ESP8266/ESP32 into USB and visit the WLED web installer. Flash the latest firmware. By default, the device creates a WiFi access point called WLED-AP (password: wled1234) at IP 4.3.2.1.
Connect your computer (or a dedicated USB WiFi adapter) to the WLED-AP network. For a dedicated Windows adapter, follow the one-time setup below before connecting, so it cannot take over your internet route.
Choose one of the two installation methods:
Installs hooks to ~/.copilot/hooks/ (%USERPROFILE%\.copilot\hooks\ on Windows) so they work from any directory. If COPILOT_HOME is set, installs to its hooks subdirectory instead.
Windows (PowerShell):
git clone https://github.com/beagandica/github-copilot-cli-octolamp-thinking-hook.git
cd github-copilot-cli-octolamp-thinking-hook
.\install.ps1
# For a dedicated USB WiFi adapter, use this instead:
# .\install.ps1 -WledInterface "Wi-Fi 2"macOS / Linux:
git clone https://github.com/beagandica/github-copilot-cli-octolamp-thinking-hook.git
cd github-copilot-cli-octolamp-thinking-hook
chmod +x install.sh
./install.shCopy the .github/hooks/ folder into any repository where you want the status light:
# From inside your project repo:
cp -r /path/to/github-copilot-cli-octolamp-thinking-hook/.github/hooks/ .github/hooks/The hooks JSON uses relative paths, so it works out of the box.
Restart the Copilot CLI process after installation so it reloads the hooks, then submit a prompt - your lamp should breathe green while thinking, then return to white.
All settings are controlled via environment variables - no code changes needed.
The global installers save any WLED_* settings below that are set at installation time into each hook's env block. Windows also saves the adapter supplied with -WledInterface. These saved settings override inherited environment variables; change them by rerunning the installer, then restart Copilot CLI. Unset settings use the controller defaults or the environment inherited at runtime.
| Variable | Default | Description |
|---|---|---|
WLED_HOST |
4.3.2.1 |
IP address of your WLED device |
WLED_BRIGHTNESS |
128 |
LED brightness (0–255) |
WLED_INTERFACE |
(unset) | Network interface name for dedicated adapter mode (e.g., Wi-Fi 2, wlan1) |
WLED_SSID |
WLED-AP |
WiFi SSID to auto-reconnect to (only used when WLED_INTERFACE is set) |
$env:WLED_HOST = "192.168.1.42"
.\install.ps1export WLED_HOST="192.168.1.42"
bash install.sh$env:WLED_INTERFACE = "Wi-Fi 2"
$env:WLED_SSID = "WLED-AP"
$env:WLED_HOST = "4.3.2.1"
.\install.ps1export WLED_INTERFACE="wlan1"
export WLED_SSID="WLED-AP"
export WLED_HOST="4.3.2.1"
bash install.shTip: Installed hooks retain these settings across sessions without modifying your shell profile. Adapter names are local configuration, not hardcoded into the controllers.
If you're using a dedicated USB WiFi adapter (like the UGREEN) to connect to WLED-AP while keeping your main WiFi on your regular network, follow these steps. This is a one-time setup.
When the USB adapter connects to WLED-AP, the ESP8266's DHCP server assigns a default gateway. If Windows picks that route over your main WiFi, all your internet traffic routes through an ESP8266 that can't reach the internet. The setup below prevents this.
# 1. Before connecting, set a static IP with NO gateway
netsh interface ip set address "Wi-Fi 2" static 4.3.2.100 255.255.255.0 none
# 2. Disable DAD - ESP8266 doesn't respond to ARP probes, causing the IP
# to get stuck in "Tentative" state without this
netsh interface ip set interface "Wi-Fi 2" dadtransmits=0
# 3. In the Windows WiFi menu, select the USB adapter (Wi-Fi 2) and save
# WLED-AP with password wled1234. Leave the main Wi-Fi adapter connected
# to your regular network. Once the profile is saved:
netsh wlan connect name="WLED-AP" interface="Wi-Fi 2"
# 4. Auto-connect when the adapter is plugged in
netsh wlan set profileparameter name="WLED-AP" connectionmode=auto interface="Wi-Fi 2"
netsh wlan set profileorder name="WLED-AP" interface="Wi-Fi 2" priority=1
# 5. Remove WLED-AP from your MAIN WiFi adapter (prevents your laptop WiFi
# from accidentally connecting to the Octolamp instead of your network)
netsh wlan delete profile name="WLED-AP" interface="Wi-Fi"
# 6. Disable USB Selective Suspend (prevents Windows from sleeping the adapter)
powercfg /SETACVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0
powercfg /SETDCVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0
powercfg /SETACTIVE SCHEME_CURRENTNote: Replace
"Wi-Fi 2"with whatever Windows names your USB adapter. Check withGet-NetAdapter.
# Adapter connected?
(Get-NetAdapter -Name "Wi-Fi 2").Status # → Up
# IP active (should say "Preferred", not "Tentative")?
Get-NetIPAddress -InterfaceAlias "Wi-Fi 2" -AddressFamily IPv4 |
Format-Table IPAddress, AddressState
# No default route hijacking internet?
Get-NetRoute -InterfaceAlias "Wi-Fi 2" -DestinationPrefix "0.0.0.0/0" -ErrorAction SilentlyContinue
# (should return nothing)
# Octolamp reachable?
curl.exe -s --interface 4.3.2.100 --noproxy "*" http://4.3.2.1/json/state
# (should return JSON)
# Internet still works?
curl.exe -s -o NUL -w "HTTP %{http_code}" https://github.com
# (should return HTTP 200)# Run as Administrator
netsh interface ip set address "Wi-Fi 2" dhcp
netsh interface ip set interface "Wi-Fi 2" dadtransmits=3
Restart-NetAdapter -Name "Wi-Fi 2"The adapter setup persists across plug/unplug cycles:
- Unplug: Hook scripts detect the adapter is missing → silently exit. Copilot CLI is unaffected.
- Plug back in: Windows reconnects to WLED-AP automatically, static IP activates, next hook fires normally.
- Adapter suspended by Windows? The script auto-reconnects and re-disables USB Selective Suspend on every invocation.
Already have Copilot CLI running? Just paste this prompt and let it handle everything:
📋 Click to expand the Copilot CLI auto-setup prompt
I need you to set up the WLED Octolamp thinking hook so my Octolamp shows my Copilot status.
Here's what I need you to do:
1. Clone https://github.com/beagandica/github-copilot-cli-octolamp-thinking-hook.git to a temp folder
2. Run the install script:
- Windows: .\install.ps1
- macOS/Linux: chmod +x install.sh && ./install.sh
3. Detect my OS and set environment variables:
- Set WLED_HOST to 4.3.2.1 (or ask me if my WLED is on a different IP)
- Set WLED_BRIGHTNESS to 128
4. If I'm on Windows and have a dedicated USB WiFi adapter for WLED:
- Ask me what the adapter name is (check Get-NetAdapter for options)
- Set WLED_INTERFACE to that adapter name
- Set WLED_SSID to WLED-AP (or ask me)
- Run the one-time adapter setup as Administrator:
a. netsh interface ip set address "<adapter>" static 4.3.2.100 255.255.255.0 none
b. netsh interface ip set interface "<adapter>" dadtransmits=0
c. netsh wlan set profileparameter name="WLED-AP" connectionmode=auto interface="<adapter>"
d. Disable USB Selective Suspend via powercfg
- Re-run the installer with those env vars set so they are saved in the global hooks
5. Test the connection:
- Verify the WLED device responds at the configured host
- Run the status script with "busy" (should turn green)
- Run the status script with "done" (should turn white)
6. Clean up the temp clone folder
After setup, tell me to restart Copilot CLI so the hooks load.
Copilot CLI hooks execute custom shell commands at key lifecycle points. They are system-level triggers - not dependent on the AI model choosing to call a tool.
The hook configuration maps lifecycle events to the status scripts:
userPromptSubmitted→ fires when you press enter → 🟢 breathing greenStop→ fires when the agent finishes responding → ⚪ solid whitesessionEnd→ fires when the session closes → ⚪ solid whiteerrorOccurred→ fires on any agent error → 🔴 blinking red
Hooks receive JSON input via stdin. The status scripts drain this input and ignore it - they only care about which status to set.
There is deliberately no sessionStart lamp command. Copilot CLI can run it concurrently with userPromptSubmitted on the first prompt; a startup white reset can arrive after green and hide the thinking state. Opening or resuming a session leaves the lamp unchanged until a prompt or completion event.
- Repository hooks go in
.github/hooks/; global hooks go in~/.copilot/hooks/(or$COPILOT_HOME/hooks/when set) - Check that the JSON has
"version": 1 - Restart Copilot CLI after installing hooks (they're discovered at session start)
- Verify your WLED device is reachable:
curl -s http://4.3.2.1/json/state - If using a dedicated adapter, check it's connected:
Get-NetAdapter -Name "Wi-Fi 2" - Test the script directly:
.\wled-status.ps1 -Status "busy"or./wled-status.sh busy - If only the first prompt stays white, reinstall the latest hooks and restart that CLI process. Remove any older WLED
sessionStartreset from repository or user hooks; all sources run together.
This is usually USB Selective Suspend. The script attempts to disable it automatically when WLED_INTERFACE is set, but group policy may override it. See Dedicated WiFi Adapter Setup for the manual fix.
The WLED device's DHCP server assigned a default gateway to your adapter, and Windows is routing all traffic through it. See Dedicated WiFi Adapter Setup - specifically the static IP step that removes the gateway.
Stack a logging hook alongside the status hook in wled-hooks.json:
"Stop": [
{
"type": "command",
"bash": "./wled-status.sh done",
"powershell": "& './wled-status.ps1' -Status 'done'",
"cwd": ".github/hooks",
"timeoutSec": 15
},
{
"type": "command",
"bash": "echo \"$(date '+%Y-%m-%d %H:%M:%S') [Stop] fired\" >> .github/hooks/hook-events.log",
"powershell": "Add-Content -Path '.github/hooks/hook-events.log' -Value \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [Stop] fired\"",
"cwd": ".",
"timeoutSec": 5
}
]github-copilot-cli-octolamp-thinking-hook/
├── .github/
│ └── hooks/
│ ├── wled-hooks.json ← Copilot CLI hook configuration
│ ├── wled-status.ps1 ← Windows (PowerShell) status controller
│ └── wled-status.sh ← macOS/Linux (Bash) status controller
├── tests/
│ └── hook-lifecycle.ps1 ← No-network lifecycle regression check
├── install.ps1 ← Windows global install script
├── install.sh ← macOS/Linux global install script
├── LICENSE ← MIT License
└── README.md ← You are here
With PowerShell 7 and Bash installed, run pwsh -NoProfile -File .\tests\hook-lifecycle.ps1 from the repository root. On Windows with Git for Windows, add -Bash "C:\Program Files\Git\bin\bash.exe".
This checks repository and generated global hooks against the first-prompt startup race and response completion. It mocks HTTP requests and installs only into temporary directories; it does not contact the lamp or change your global hooks.
The scripts communicate with WLED via its JSON API over HTTP POST to /json/state.
| Parameter | Busy (Thinking) | Done (Idle) | Error |
|---|---|---|---|
fx (effect) |
2 (Breathe) |
0 (Solid) |
1 (Blink) |
sx (speed) |
80 |
- | 200 |
ix (intensity) |
100 |
- | - |
col (color) |
[0,255,0] 🟢 |
[255,255,255] ⚪ |
[255,0,0] 🔴 |
- Octolamp by @martinwoodward - the 3D-printable GitHub Octocat lamp this was built for
- WLED - open source firmware for ESP8266/ESP32 LED controllers
- GitHub Copilot CLI - the AI-powered terminal assistant with hooks support
This hook integration is released under the MIT License.
The Octolamp hardware design is separately licensed under CC BY-NC 4.0 by Martin Woodward.