docs/google.md
Google: Gmail, Calendar and Drive
With Google set up, Shrok can search, read, tidy and send your mail, read and change your calendar, and find and read files in your Drive. Before it sends an email or changes your calendar, it asks you on your phone to approve that exact action.
Shrok uses the Google Workspace CLI, gws, and offers Google only when gws is installed and both of its keys are set.
In the Google Cloud console, create a project, turn on the Gmail, Google Calendar and Google Drive APIs, and create an OAuth client of type Desktop app.
Install
gwswhere Shrok's service can find it, such asnpm install -g @googleworkspace/cli.Give Shrok the client's ID and secret as
GOOGLE_WORKSPACE_CLI_CLIENT_IDandGOOGLE_WORKSPACE_CLI_CLIENT_SECRET, the same way you gave it the model key.Log in as the user Shrok runs as, with the same two values in the environment:
sh1 GOOGLE_WORKSPACE_CLI_CLIENT_ID=... GOOGLE_WORKSPACE_CLI_CLIENT_SECRET=... gws auth login -s gmail,calendar,drive On Debian or Ubuntu, run it as the
shrokuser:sudo -u shrok env HOME=/var/lib/shrok ... gws auth login.gwsopens a browser to sign in and keeps its tokens in~/.config/gwsof that user.Restart Shrok. Ask it "what's on my calendar this week?" to check.
Shrok's own sandbox can't read ~/.config/gws, so a command Shrok runs in bash can't take your tokens.