Install Gemini CLI and Google Workspace CLI — connect AI to your Google Calendar and Gmail.
Before we start building your morning briefing, let’s get your AI tools connected to Google Calendar and Gmail.
You will need: a laptop with internet access and a Google account with Gmail and Calendar. No coding experience is required — we will guide you through every step.
1
Install Node.js
Already have Node.js? If you installed it for a previous tutorial, skip this step. Run node --version in your terminal to check — you should see a version number like v22.x.x.
Node.js is a free tool that lets you run Gemini CLI on your computer.
Click the big green LTS button to download the installer
Open the downloaded .pkg file
Click Continue through all the screens — the default settings are fine
Click Install, then Close
How do I know it worked?
Open your terminal and type:
Copy
node --version
You should see a version number like v22.x.x. If you see an error, try closing and reopening your terminal, then run the command again.
2
Install Gemini CLI
Already have Gemini CLI? If you installed it for a previous tutorial, skip this step. Just run gemini in your terminal to check it still works.
Gemini CLI is Google’s free AI assistant. It runs in your terminal and helps you with tasks based on your descriptions.Open your terminal and type:
Copy
npm install -g @google/gemini-cli
Wait for the installation to finish. Then start it by typing:
Copy
gemini
The first time you run it, Gemini CLI will ask you to sign in:
Choose “Sign in with Google”
A browser window will open — sign in with your Google account
Come back to the terminal when it says you’re connected
Free tier: 60 requests per minute, 1,000 requests per day — more than enough for this tutorial and everyday use.
'npm' is not recognised
This means Node.js isn’t installed correctly. Go back and reinstall Node.js. After reinstalling, close your terminal completely and open a new one before trying again.
Permission denied error
Windows: Close PowerShell and reopen it by right-clicking and choosing “Run as Administrator”. Then try the install command again.macOS: Add sudo before the command:
Copy
sudo npm install -g @google/gemini-cli
Enter your computer password when prompted (you won’t see characters as you type — that’s normal).
Type /quit to exit Gemini CLI for now. We will start it again after installing the Google Workspace CLI.
3
Install Google Workspace CLI (gws)
gws is a command-line tool that controls all your Google apps — Gmail, Calendar, Drive, Docs, Sheets — from the terminal. It’s what lets AI manage your Google Workspace without opening a browser.Open your terminal and type:
Copy this command
Copy
npm install -g @googleworkspace/cli
Wait for the installation to finish. Then set up your Google Cloud project:
Copy this command
Copy
gws auth setup
What does gws auth setup do? It creates a Google Cloud project for you, enables the APIs you need, and prepares everything for sign-in. It requires the gcloud CLI — if you don’t have it, see the troubleshooting section below.
Once setup is complete, sign in and choose which Google services to connect:
A browser window will open — sign in with your Google account and approve the permissions.
“Google hasn’t verified this app” warning: This is normal. Click Advanced → Go to [app name] (unsafe) to continue. This is safe for personal use — Google shows this for all apps that haven’t gone through their official review process.
Scope checkboxes: If you see a list of permission checkboxes, select all of them (or click Select all) before clicking Continue. These are the permissions gws needs to read and manage your Google apps.
Verify the installation by checking today’s calendar:
Copy this command
Copy
gws calendar +agenda
You should see your upcoming events listed in your terminal. If you do, gws is working.
Free to use:gws is free and open-source. It connects to Google’s APIs using your own Google account — there are no usage limits beyond Google’s own API quotas.
'gws' is not recognised
The installation may not have added gws to your system PATH. Try closing your terminal completely and opening a new one, then run gws --version. If it still doesn’t work, try reinstalling:
Copy
npm install -g @googleworkspace/cli
'gcloud' is not installed
gws auth setup uses the gcloud CLI to automate project creation. You have two options:
Skip gcloud — set up OAuth credentials manually in the Google Cloud Console. Create a project, enable the APIs you need, create an OAuth Desktop App client, download the JSON, and save it to ~/.config/gws/client_secret.json. Then run gws auth login.
Permission denied error
Windows: Close PowerShell and reopen it by right-clicking and choosing “Run as Administrator”. Then try the install command again.macOS: Add sudo before the command:
Copy
sudo npm install -g @googleworkspace/cli
Enter your computer password when prompted (you won’t see characters as you type — that’s normal).
API not enabled error
If you see an error like “Gmail API has not been used in project…”, the API needs to be enabled:
Look for the enable_url link in the error message
Open that link in your browser
Click Enable
Wait 10 seconds, then retry your command
You can also run gws auth setup again — it enables all required APIs automatically.
'Access blocked' or 403 during login
Your Google account is not listed as a test user for the OAuth app. Open the OAuth consent screen in your Google Cloud project → Test users → Add users → enter your Google account email. Then retry gws auth login.
4
Connect Gemini CLI to gws
Now let’s give Gemini CLI the ability to use gws — so it can read your calendar and email when you ask.Open your terminal and run this command:
This tells Gemini CLI to use the Google Workspace CLI as an extension. Once installed, Gemini can pull your calendar events, triage your inbox, and generate standup summaries — all through natural language prompts.
What is an extension? Extensions are plugins that add new capabilities to Gemini CLI. This extension connects Gemini to your Google Workspace apps — similar to how you might install an app on your phone.
The command fails or hangs
Make sure you have an internet connection and that Node.js is installed correctly. Try running node --version first. If that works but the extension install fails, try closing and reopening your terminal, then running the command again.
5
Install Wispr Flow (optional)
This step is optional. Wispr Flow lets you speak instead of type — handy if you prefer talking over typing. Skip this step if you’d rather type your prompts.
Sign up using this invite link to get a free month of Pro:https://wisprflow.ai/r?CHAN115Both you and the tutorial author benefit — you get a free month of Pro, and they get a free month when you dictate 2,000 words!
Press Enter Command — Automatically press enter when you say “press enter”
Bulk Import — Import snippets and dictionary items
What is Wispr Flow?
Wispr Flow is a voice-to-text tool that lets you dictate instead of type. It works in any application, including your terminal. Instead of typing a long prompt to Gemini CLI, you can just say it out loud. This is especially useful if you find typing slow or tiring.
6
Test the connection
Start Gemini CLI and ask it to read your calendar — this confirms everything is connected.
Copy this command
Copy
gemini
Once Gemini CLI is running, say (with Wispr Flow) or type this prompt:
Say this or copy this prompt
Copy
What meetings do I have today?
You should see Gemini CLI access your Google Calendar and return a list of today’s events. If it does, everything is working.
Gemini asks for permission? If Gemini CLI asks to approve a tool call, type y and press Enter. This is normal — it is asking your permission before accessing your Google data.
Gemini says it has no calendar tools
The extension may not have installed correctly. Try running the install command again: