Google Calendar CLI configuration
Set up your own Google client and choose which Calendar changes each profile may make.
Decide what an agent may change in your calendar, and which Google app you sign in with. Settings live in one file,
config.json, in the folder gcal doctor shows. Each profile has its own part, and defaults apply to every
profile.
gcal personal config show
gcal personal config set limit 50
gcal personal config unset limitconfig show lists each setting and where it came from: the file, a variable or the default.
Your own Google client
session start signs in through WireCat's Google app unless you name one of your own. The first of these wins:
--client-file <file>, your Desktop app client file, or--client-id <id>, its client ID;GCAL_GOOGLE_CLIENT_ID;- the
google_client_idsetting of the profile, then of the defaults:gcal config set --defaults google_client_id 1234-abc.apps.googleusercontent.com; - WireCat's app.
With 1 to 3, the secret comes from GCAL_GOOGLE_CLIENT_SECRET, never from the settings file. Google refuses a
Desktop app without its secret, so session start warns before the browser opens when it has none. Only you change
google_client_id: config set refuses it to an agent. gcal doctor shows the app a profile without its own setting
would use as oauth_client, with source flag, env, config or constants.
gcal refuses a client file other users of the computer can read. The client is needed only at sign-in: gcal keeps
it with the sign-in, so later commands and refreshes use the same app, even after you change the setting.
Make your own Google app walks through Google Cloud Console step by step.
Permissions
permissions decides what a command may do for this profile: allow, ask, readonly or deny, per permission
key. Each Google Calendar method has its own key, api.<method>, such as api.calendar.events.insert; api and
api.calendar.events name every method under them. The same key covers api call <method> and the method's own
command, api calendar-events-insert.
gcal personal config set permissions.api readonly # reads only, every method
gcal personal config set permissions.api.calendar.events.insert ask # be asked before each new eventWithout a setting of yours:
- A method that changes Calendar and is easy to undo, such as
calendar.events.insertorcalendar.events.patch, isallow, asevents createandevents updateare. - A method that deletes, such as
calendar.events.deleteorcalendar.calendarList.delete, isask. At a terminalgcalasks before it calls Google; in a script, add--yes. Over MCP there is no one to ask, soasklets the command run. - Sharing a calendar (
calendar.acl.insert,patch,update,delete) isask. Over MCP, after--grant sharing, an agent therefore shares your calendar with anyone without asking you. Setpermissions.api.calendar.acl denyto decide every share yourself. - Deleting a whole calendar (
calendar.calendars.delete) and giving it to another account (calendar.calendars.transferOwnership) aredeny: neither can be undone. Set the key toaskorallowto let them run. sharing.notify, letting Google mail the person a calendar is shared with, isdeny. Google sends that mail unlesssendNotificationsisfalse, so while the key isdenya share must say--send-notifications false.- Emptying a calendar (
calendar.calendars.clear, every event of the main calendar) isdeny, and never offered over MCP. - The event writes that are easy to undo go ahead without a question:
events create,update,moveandrespondareallow, each under its own key, such asevents.create.events delete,--followingincluded, isask. events.notify, letting Google mail the other attendees (--notify), isdeny. Over MCPasklets a command run, so an agent could otherwise mail people.events.delete.series, deleting every occurrence of a repeating event (events delete --series), isdeny. A series update whose new--repeatrule ends it sooner (a newCOUNTor an earlierUNTIL) needs it too.
To stop every change in Google Calendar, set permissions.api readonly. It stops events create, update, move,
respond and delete too, because each of them calls a Google method. Each events command also has its own key,
such as events.create, and a write asks you once even when several of its keys say ask.
gcal personal config set permissions.events.notify allow # let --notify mail attendees
gcal personal config set permissions.sharing.notify allow # let a share mail the person it is shared with
gcal personal config set permissions.events.create ask # be asked before each new event--dry-run lists every key a call checks, with its level, and calls nothing. gcal api show calendar.events.insert
lists the events keys a method also checks, under also_checks.
An events command checks the key of each Google method it calls, but only once you set that key. The built-in ask
of api.calendar.events.delete holds for the api commands only: events delete asks under its own key,
events.delete.
events command | Google method keys it also checks |
|---|---|
create | api.calendar.events.insert (quickAdd for --text) |
update | api.calendar.events.patch, and api.calendar.events.update when a switch between timed and all-day sends the whole event |
respond | api.calendar.events.patch |
import | api.calendar.events.import |
delete | api.calendar.events.delete |
move | api.calendar.events.move |
An api command checks the key of the events command that does the same work, reads included:
| Google method | events key it also checks |
|---|---|
calendar.events.list, instances | events.list |
calendar.events.get | events.show |
calendar.events.insert, quickAdd | events.create |
calendar.events.import | events.import, so it asks as events import does |
calendar.events.patch, update | events.update |
calendar.events.delete, and a patch to cancelled | events.delete |
calendar.events.move | events.move |
A few calls need one more key:
- A method that has Google mail the attendees (
--send-updatesother thannone, or--send-notifications true) also needsevents.notify. - Deleting an event, or patching it to
cancelled, also needsevents.delete.serieswhen the event repeats:gcalreads the event from Google first to find out. - Sharing a calendar (
calendar.acl.insert,patch,update) also needssharing.notifyunless the call passes--send-notifications false("sendNotifications": falseinapi call --params);gcalnever adds it for you. Removing access (calendar.acl.delete) mails nobody, so it needs no extra key.
These defaults only become stricter against a broader key: permissions.api allow keeps both the question and the
deny. To change one, set that method's own key, such as permissions.api.calendar.calendars.clear ask. A key that
names no method is refused, and gcal doctor lists any in the file. GCAL_READ_ONLY=1, or --read-only for one
run, refuses every write, whatever the permissions say. gcal <profile> mcp serve --permission api=readonly makes a
key stricter for that server only.
Run records
A command that fails is kept as a run, for gcal runs list and runs show. record_input decides whether a run
keeps the words you typed; it is true unless you set it to false. Secrets are masked either way; see
Security.