Skip to content

Commit 95e2dd6

Browse files
authored
Merge pull request #74 from salmonumbrella/fix/gmail-scopes-settings
fix(auth): request gmail settings scopes
2 parents dab8249 + 901020c commit 95e2dd6

25 files changed

Lines changed: 4451 additions & 46 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Gmail: include `gmail.settings.sharing` scope for filter operations to avoid 403 insufficientPermissions. (#69) — thanks @ryanh-ai.
88
- Gmail: resync on stale history 404s and skip missing message fetches without masking non-404 failures. (#70) — thanks @antons.
9+
- Classroom: normalize assignee updates + fix grade update masks. (#74) — thanks @salmonumbrella.
910

1011
### Build
1112

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# 🧭 gogcli — Google in your terminal.
22

3-
Google in your terminal — CLI for Gmail, Calendar, Drive, Docs, Slides, Sheets, Contacts, Tasks, People, Groups (Workspace), and Keep (Workspace-only).
3+
Google in your terminal — CLI for Gmail, Calendar, Classroom, Drive, Docs, Slides, Sheets, Contacts, Tasks, People, Groups (Workspace), and Keep (Workspace-only).
44

55
## Features
66

77
- **Gmail** - search threads, send emails, manage labels, drafts, filters, delegation, vacation settings, and watch (Pub/Sub push)
88
- **Email tracking** - track opens for `gog gmail send --track` with a small Cloudflare Worker backend
99
- **Calendar** - list/create/update events, detect conflicts, manage invitations, check free/busy status, team calendars
10+
- **Classroom** - list courses, rosters, coursework, submissions, announcements, topics, invitations, guardians
1011
- **Drive** - list/search/upload/download files, manage permissions, organize folders
1112
- **Contacts** - search/create/update contacts, access Workspace directory
1213
- **Tasks** - manage tasklists and tasks: create/add/update/done/undo/delete/clear
@@ -64,6 +65,7 @@ Before adding an account, create OAuth2 credentials from Google Cloud Console:
6465
- Gmail API: https://console.cloud.google.com/apis/api/gmail.googleapis.com
6566
- Google Calendar API: https://console.cloud.google.com/apis/api/calendar-json.googleapis.com
6667
- Google Drive API: https://console.cloud.google.com/apis/api/drive.googleapis.com
68+
- Google Classroom API: https://console.cloud.google.com/apis/api/classroom.googleapis.com
6769
- People API (Contacts): https://console.cloud.google.com/apis/api/people.googleapis.com
6870
- Google Tasks API: https://console.cloud.google.com/apis/api/tasks.googleapis.com
6971
- Google Sheets API: https://console.cloud.google.com/apis/api/sheets.googleapis.com

docs/spec.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Build a single, clean, modern Go CLI that talks to:
66

77
- Gmail API
88
- Google Calendar API
9+
- Google Classroom API
910
- Google Drive API
1011
- Google People API (Contacts + directory)
1112

@@ -134,7 +135,7 @@ Flag aliases:
134135
### Implemented
135136

136137
- `gog auth credentials <credentials.json|->`
137-
- `gog auth add <email> [--services user|all|gmail,calendar,drive,docs,contacts,tasks,sheets,people,groups] [--readonly] [--drive-scope full|readonly|file] [--manual] [--force-consent]`
138+
- `gog auth add <email> [--services user|all|gmail,calendar,classroom,drive,docs,contacts,tasks,sheets,people,groups] [--readonly] [--drive-scope full|readonly|file] [--manual] [--force-consent]`
138139
- `gog auth services [--markdown]`
139140
- `gog auth keep <email> --key <service-account.json>` (Google Keep; Workspace only)
140141
- `gog auth list`
@@ -165,6 +166,65 @@ Flag aliases:
165166
- `gog calendar delete <calendarId> <eventId>`
166167
- `gog calendar freebusy <calendarIds> --from RFC3339 --to RFC3339`
167168
- `gog calendar respond <calendarId> <eventId> --status accepted|declined|tentative [--send-updates all|none|externalOnly]`
169+
- `gog classroom courses [--state ...] [--max N] [--page TOKEN]`
170+
- `gog classroom courses get <courseId>`
171+
- `gog classroom courses create --name NAME [--owner me] [--state ACTIVE|...]`
172+
- `gog classroom courses update <courseId> [--name ...] [--state ...]`
173+
- `gog classroom courses delete <courseId>`
174+
- `gog classroom courses archive <courseId>`
175+
- `gog classroom courses unarchive <courseId>`
176+
- `gog classroom courses join <courseId> [--role student|teacher] [--user me]`
177+
- `gog classroom courses leave <courseId> [--role student|teacher] [--user me]`
178+
- `gog classroom courses url <courseId...>`
179+
- `gog classroom students <courseId> [--max N] [--page TOKEN]`
180+
- `gog classroom students get <courseId> <userId>`
181+
- `gog classroom students add <courseId> <userId> [--enrollment-code CODE]`
182+
- `gog classroom students remove <courseId> <userId>`
183+
- `gog classroom teachers <courseId> [--max N] [--page TOKEN]`
184+
- `gog classroom teachers get <courseId> <userId>`
185+
- `gog classroom teachers add <courseId> <userId>`
186+
- `gog classroom teachers remove <courseId> <userId>`
187+
- `gog classroom roster <courseId> [--students] [--teachers]`
188+
- `gog classroom coursework <courseId> [--state ...] [--topic TOPIC_ID] [--max N] [--page TOKEN]`
189+
- `gog classroom coursework get <courseId> <courseworkId>`
190+
- `gog classroom coursework create <courseId> --title TITLE [--type ASSIGNMENT|...]`
191+
- `gog classroom coursework update <courseId> <courseworkId> [--title ...]`
192+
- `gog classroom coursework delete <courseId> <courseworkId>`
193+
- `gog classroom coursework assignees <courseId> <courseworkId> [--mode ...] [--add-student ...]`
194+
- `gog classroom materials <courseId> [--state ...] [--topic TOPIC_ID] [--max N] [--page TOKEN]`
195+
- `gog classroom materials get <courseId> <materialId>`
196+
- `gog classroom materials create <courseId> --title TITLE`
197+
- `gog classroom materials update <courseId> <materialId> [--title ...]`
198+
- `gog classroom materials delete <courseId> <materialId>`
199+
- `gog classroom submissions <courseId> <courseworkId> [--state ...] [--max N] [--page TOKEN]`
200+
- `gog classroom submissions get <courseId> <courseworkId> <submissionId>`
201+
- `gog classroom submissions turn-in <courseId> <courseworkId> <submissionId>`
202+
- `gog classroom submissions reclaim <courseId> <courseworkId> <submissionId>`
203+
- `gog classroom submissions return <courseId> <courseworkId> <submissionId>`
204+
- `gog classroom submissions grade <courseId> <courseworkId> <submissionId> [--draft N] [--assigned N]`
205+
- `gog classroom announcements <courseId> [--state ...] [--max N] [--page TOKEN]`
206+
- `gog classroom announcements get <courseId> <announcementId>`
207+
- `gog classroom announcements create <courseId> --text TEXT`
208+
- `gog classroom announcements update <courseId> <announcementId> [--text ...]`
209+
- `gog classroom announcements delete <courseId> <announcementId>`
210+
- `gog classroom announcements assignees <courseId> <announcementId> [--mode ...]`
211+
- `gog classroom topics <courseId> [--max N] [--page TOKEN]`
212+
- `gog classroom topics get <courseId> <topicId>`
213+
- `gog classroom topics create <courseId> --name NAME`
214+
- `gog classroom topics update <courseId> <topicId> --name NAME`
215+
- `gog classroom topics delete <courseId> <topicId>`
216+
- `gog classroom invitations [--course ID] [--user ID]`
217+
- `gog classroom invitations get <invitationId>`
218+
- `gog classroom invitations create <courseId> <userId> --role STUDENT|TEACHER|OWNER`
219+
- `gog classroom invitations accept <invitationId>`
220+
- `gog classroom invitations delete <invitationId>`
221+
- `gog classroom guardians <studentId> [--max N] [--page TOKEN]`
222+
- `gog classroom guardians get <studentId> <guardianId>`
223+
- `gog classroom guardians delete <studentId> <guardianId>`
224+
- `gog classroom guardian-invitations <studentId> [--state ...] [--max N] [--page TOKEN]`
225+
- `gog classroom guardian-invitations get <studentId> <invitationId>`
226+
- `gog classroom guardian-invitations create <studentId> --email EMAIL`
227+
- `gog classroom profile [userId]`
168228
- `gog gmail search <query> [--max N] [--page TOKEN]`
169229
- `gog gmail thread get <threadId> [--download]`
170230
- `gog gmail thread modify <threadId> [--add ...] [--remove ...]`

internal/cmd/classroom.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package cmd
2+
3+
import "github.com/steipete/gogcli/internal/googleapi"
4+
5+
var newClassroomService = googleapi.NewClassroom
6+
7+
type ClassroomCmd struct {
8+
Courses ClassroomCoursesCmd `cmd:"" help:"Courses"`
9+
Students ClassroomStudentsCmd `cmd:"" help:"Course students"`
10+
Teachers ClassroomTeachersCmd `cmd:"" help:"Course teachers"`
11+
Roster ClassroomRosterCmd `cmd:"" help:"Course roster (students + teachers)"`
12+
Coursework ClassroomCourseworkCmd `cmd:"" name:"coursework" aliases:"work" help:"Coursework"`
13+
Materials ClassroomMaterialsCmd `cmd:"" name:"materials" help:"Coursework materials"`
14+
Submissions ClassroomSubmissionsCmd `cmd:"" help:"Student submissions"`
15+
Announcements ClassroomAnnouncementsCmd `cmd:"" help:"Announcements"`
16+
Topics ClassroomTopicsCmd `cmd:"" help:"Topics"`
17+
Invitations ClassroomInvitationsCmd `cmd:"" help:"Invitations"`
18+
Guardians ClassroomGuardiansCmd `cmd:"" help:"Guardians"`
19+
GuardianInvites ClassroomGuardianInvitesCmd `cmd:"" name:"guardian-invitations" help:"Guardian invitations"`
20+
Profile ClassroomProfileCmd `cmd:"" help:"User profiles"`
21+
}

0 commit comments

Comments
 (0)