Skip to content

Commit 130953e

Browse files
committed
add GitHub org and Google Calendar integration to onboard_member.py
New features: - --github flag: Invite users to ContextLab org, add to Lab default + specified teams - --teams flag: Comma-separated team list with fuzzy matching (e.g., 'supereeg' matches 'Super EEG') - --gmail flag: Share lab calendars with appropriate permissions based on rank - Undergrads: read-only access to main calendar, write to others - Grad students/postdocs: write access to all calendars Google Calendar requires service account credentials at ~/.config/cdl/google-credentials.json Running with --gmail without credentials shows setup instructions
1 parent 91746ae commit 130953e

4 files changed

Lines changed: 436 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ cd scripts && python onboard_member.py "First Last"
9999
cd scripts && python onboard_member.py "First Last" --rank "grad student"
100100
cd scripts && python onboard_member.py "First Last" --photo headshot --bio "Bio text..."
101101
cd scripts && python onboard_member.py "First Last" --skip-llm
102+
cd scripts && python onboard_member.py "First Last" --github username --teams "supereeg"
103+
cd scripts && python onboard_member.py "First Last" --gmail user@gmail.com
102104

103105
# Offboard a lab member (move to alumni)
104106
cd scripts && python offboard_member.py "member name"

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,31 @@ python onboard_member.py "First Last" --website "https://example.com"
206206

207207
# Skip LLM bio processing (use simple default)
208208
python onboard_member.py "First Last" --skip-llm
209+
210+
# With GitHub integration (invite to ContextLab org and teams)
211+
python onboard_member.py "First Last" --github username
212+
python onboard_member.py "First Last" --github username --teams "supereeg,hypertools"
213+
214+
# With Google Calendar integration (share lab calendars)
215+
python onboard_member.py "First Last" --gmail user@gmail.com
216+
217+
# Full onboarding with all integrations
218+
python onboard_member.py "First Last" --rank "grad student" --github user --gmail user@gmail.com
209219
```
210220

211221
The script will:
212222
- Process the photo with a hand-drawn border (using face detection)
213223
- Generate or edit the bio using a local LLM (gpt-oss-20b)
214224
- Add the member to `people.xlsx`
215225
- Add the member to `JRM_CV.tex`
226+
- Invite to GitHub organization and teams (if `--github` provided)
227+
- Share Google Calendars with appropriate permissions (if `--gmail` provided)
216228
- Rebuild `people.html`
217229

230+
**GitHub Integration**: Requires `gh` CLI to be authenticated with org admin permissions. Uses fuzzy matching for team names (e.g., "supereeg" matches "Super EEG").
231+
232+
**Google Calendar Integration**: Requires service account credentials at `~/.config/cdl/google-credentials.json`. Run the script with `--gmail` to see setup instructions. Undergrads get read-only access to the main lab calendar; grad students and postdocs get write access. All members get write access to "out of lab" and "CDL resources" calendars.
233+
218234
**Idempotent**: Running twice with the same name updates the existing entry.
219235

220236
#### Adding a New Team Member (Manual)

scripts/AGENTS.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,17 @@ python onboard_member.py "First Last"
8080
python onboard_member.py "First Last" --rank "grad student"
8181
python onboard_member.py "First Last" --photo headshot --bio "Bio text..."
8282
python onboard_member.py "First Last" --website "https://example.com"
83-
python onboard_member.py "First Last" --skip-llm # Skip LLM processing
83+
python onboard_member.py "First Last" --skip-llm
84+
85+
# With GitHub integration (invite to org + teams):
86+
python onboard_member.py "First Last" --github username
87+
python onboard_member.py "First Last" --github username --teams "supereeg,hypertools"
88+
89+
# With Google Calendar integration (share lab calendars):
90+
python onboard_member.py "First Last" --gmail user@gmail.com
91+
92+
# Full onboarding with all integrations:
93+
python onboard_member.py "First Last" --rank "grad student" --github user --gmail user@gmail.com
8494

8595
# Offboard a lab member (move to alumni):
8696
python offboard_member.py "member name"
@@ -95,3 +105,11 @@ See `requirements-build.txt`:
95105
- mediapipe (face detection for add_borders.py)
96106
- Pillow/numpy (image processing)
97107
- transformers/torch (for onboard_member.py LLM bio generation)
108+
- google-api-python-client/google-auth (for Google Calendar integration)
109+
110+
## CREDENTIALS
111+
112+
Google Calendar integration requires service account credentials:
113+
- Location: `~/.config/cdl/google-credentials.json`
114+
- Setup: Run `onboard_member.py` with `--gmail` flag to see setup instructions
115+
- The service account must have access to lab calendars (shared via Google Calendar settings)

0 commit comments

Comments
 (0)