(Event: Build with AI 2026 @ Google Taipei 101 / Presentation: SpeakerDeck / Materials: kkdai/BwAI-2026 / Example: kkdai/bwai2026-sample)
Background: When the CLI Becomes a "Thinking Colleague"
After Google I/O in 2026, Gemini CLI is no longer just another terminal toy that packages LLM, but a development tool that can mount MCPs, plan on its own, run gcloud on its own, and stop to ask you when it doesn't understand.
In this Build with AI 2026 workshop, I compressed this tool flow into two hands-on sessions:
- Workshop 1: Environment Preparation + Two Essential Official MCPs — Connecting Gemini CLI to Google's official knowledge and Maps Platform.
- Workshop 2: Tell Gemini CLI a Sentence and Deploy a LINE Bot to Cloud Run — No more hand-typing that long and painful
gcloud run deploy ....
The entire teaching material has been open-sourced at kkdai/BwAI-2026, the example project is at kkdai/bwai2026-sample, and the event slides are on SpeakerDeck. This is the full text version of the on-site walkthrough, including the three pitfalls we encountered on stage that day.
Why Gemini CLI + MCP? First, Look at the Timeline
The update pace of Gemini API and its ecosystem has been very dense in the past year:
| Time | New Stuff | Impact on Workflow |
|---|---|---|
| 2025/08 | Gemini YouTube Video Understanding | Directly feed URLs of videos to the model |
| 2025/11 | Gemini File Search | Managed RAG, no need to connect your own vector DB |
| 2025/12 | Google Search Grounding (Vertex) | Model answers can be grounded to search results |
| 2025/12 | Maps Grounding & Maps Platform Assist MCP | Native map scenarios |
| 2026/02 | Google Developer Knowledge API + MCP Server | Official documentation becomes a tool queryable by LLM |
| 2026/03 | Gemini 3 Flash + Tool Combo | Single call chains multiple grounding tools |
Core Observation: Google has made each new capability into an MCP Server, which means that Gemini CLI can upgrade the IDE from "an LLM that can write code" to "an LLM that can write code using Google's official resources" with just one line of gemini mcp add.
This workshop, I chose two MCPs that are most impactful for LINE Bot developers to demonstrate.
Workshop 1: Environment Preparation and Official MCP Installation
Why It's Recommended to Start with Cloud Shell
The biggest fear in on-site workshops is the environment issue like "Teacher, I can't find Python 3.11 here". I put the entire demonstration directly on Google Cloud Shell:
-
gcloudis pre-installed. -
geminiCLI is pre-installed (the latest Cloud Shell image is built-in). -
gcloud authautomatically links with the Cloud Shell account, saving the OAuth dance.
Go to https://console.cloud.google.com/, first confirm that the project is the one you just created (don't accidentally open the company's official environment), and then click Cloud Shell in the upper right corner:
# Verify that both tools are there
gcloud --version
gemini --version
[!TIP] If you want to run it locally, you can follow the Gemini CLI official installation guide, but in the workshop, we all use Cloud Shell to avoid the tragedy of "everyone's environment is different".
What is MCP? Explained in Three Sentences
- MCP (Model Context Protocol) is an open protocol proposed by Anthropic that allows LLM clients to communicate with external capability providers in a unified format.
- Gemini CLI is the MCP client, and you can
gemini mcp add ...to mount any server that complies with the MCP specification. - Google itself has now packaged several APIs into official MCP servers, which is equivalent to equipping your AI assistant with "Google's internal knowledge base".
MCP #1: Google Developer Knowledge
This MCP turns the official documentation of the Google family (Cloud / Android / Web / Firebase / Workspace…) into a tool that Gemini can call. The advantage over web search is that: it returns chunks that have been officially indexed, with the correct source URL, and will not be misled by outdated blogs.
Setup Steps
- Enable Developer Knowledge API at Google Cloud Console.
- Create an API Key in "Credentials" and restrict it to only call the Developer Knowledge API (the principle of least privilege).
- Run in Cloud Shell:
gemini mcp add -t http \
-H "X-Goog-Api-Key: YOUR_API_KEY" \
google-developer-knowledge \
https://developerknowledge.googleapis.com/mcp \
--scope user
--scope user means that this MCP is valid for all your projects, and you don't need to install it again next time you change repos.
Verification
Enter gemini interactive mode, first type:
/mcp list
You should see google-developer-knowledge with the status Connected. Then throw a typical question:
Please help me query the latest deployment limits of Google Cloud Run (Deployment Limits) and list the top three.
Correct behavior:
- Gemini will call the
google-developer-knowledgetool. - The answer content is referenced from official pages like
cloud.google.com/run/quotas. - Finally, it includes a reference URL.
MCP #2: Google Maps Platform Code Assist
This MCP is specifically designed to help you write code for Google Maps integration — including the latest calling methods for Maps JavaScript API, Places API, and Routes API. It is extremely friendly to developers who "want map features but are too lazy to flip through three docs".
gemini mcp add -s user -t http \
maps-code-assist-mcp \
https://mapscodeassist.googleapis.com/mcp
Verification
I want to embed a Google map in a webpage, please write a basic JavaScript code for me,
with the center point set to Taipei 101.
Expected behavior:
- Gemini calls
maps-code-assist-mcp. - The generated code will not use the deprecated
new google.maps.Map()synchronous loader, but will use the currently recommendedimportLibraryasync pattern. - It will proactively remind you to get the Maps JavaScript API Key and make referer restrictions.
If you see it still generating the old writing style from 2020, then the MCP is not mounted correctly — re-/mcp list to check the status.
Workshop 2: Deploying a LINE Bot to Cloud Run
This part uses the example project kkdai/bwai2026-sample. It is a LINE Bot file backup helper:
- Users put images / videos / audio / PDFs into the LINE chat box.
- The bot automatically saves the files to the user's own Google Drive, in folders by
YYYY-MM. - Supports commands like
/recent_files,/search_files <keyword>,/disconnect_drive.
Tech stack: Go + LINE Messaging API SDK + Google Drive API + Firestore (to store OAuth token) + Cloud Run.
git clone https://github.com/kkdai/bwai2026-sample
cd bwai2026-sample
Deployment Flow Overview
[Phase One] Get LINE Keys (Channel Secret + Access Token)
↓
[Phase Two] GCP Project Setup (Enable Run / Build / Firestore / Artifact / Drive API)
↓
[Phase Three] Set up OAuth Consent Screen + Gemini CLI Login
↓
[Phase Four] Tell Gemini CLI a sentence in Chinese and deploy to Cloud Run
↓
[Phase Five] Fill in the Webhook URL in LINE Developers Console
Phase One: LINE Keys
- Create an official account at LINE Official Account Manager.
- In the background, "Settings → Messaging API" enable Messaging API, and create a Provider.
- Back to LINE Developers Console corresponding Channel:
-
Basic settings→ Get Channel Secret. -
Messaging API→ Click Issue to get Channel Access Token (long-lived).
-
- Very important: Go back to OA Manager and disable "Auto-reply messages", otherwise your code will never be able to get the messages to reply to.
Phase Two: GCP Project Activation
# Switch to the clean project used in the workshop
gcloud config set project your-cool-project-id
# Enable the entire set of services in one go
gcloud services enable \
run.googleapis.com \
cloudbuild.googleapis.com \
firestore.googleapis.com \
artifactregistry.googleapis.com \
drive.googleapis.com
# Build Firestore (used to store per-user OAuth token + state anti-counterfeiting)
gcloud firestore databases create \
--location=asia-east1 \
--type=firestore-native
[!NOTE]
--type=firestore-nativeThis value will be explained in the third pitfall, why it's easy to get wrong.
Phase Three: OAuth Consent Screen + Gemini CLI Login
Because the Bot needs to represent "the user themselves" to upload files to their Google Drive, this path must go through OAuth.
- Go to OAuth Consent Screen:
- User Type: External.
- Application Name:
My LINE Bot(or whatever name you want to call it). - Support Email / Developer Contact Email: Fill in your own Gmail.
- Be sure to click "Publish App" after filling it out — if you don't publish it, only accounts in the Test Users list can use it.
- Create an OAuth client ID:
- Select Web Application for the type.
- Authorized redirect URI: Temporarily fill in
https://placeholder/oauth/callback, and come back to modify it after getting the Cloud Run URL in Phase Four. - Save the Client ID and Client Secret.
- Run locally:
gcloud auth application-default login
This will write ADC (Application Default Credentials) to the local machine, and Gemini CLI will use this credential when running gcloud, without popping up a browser to re-auth halfway.
Phase Four: Deploy to Cloud Run with Gemini CLI (The Highlight)
This part is where the participants in the workshop were most "wow".
After entering the project directory, start Gemini CLI interactive mode:
gemini
Then say a sentence:
Help me deploy to Cloud Run using gcloud, and stop to ask me if you need any data.
Refer to repo https://github.com/kkdai/bwai2026-sample,
region use asia-east1, environment variables will use
ChannelSecret, ChannelAccessToken, GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URL.
Gemini CLI will then:
-
lsandcat Dockerfileby itself to confirm the project structure. - Generate a plan: First use
PENDINGto reserve the deployment → get the URL → supplement the OAuth redirect → update env vars. - Stop and ask you for confirmation before execution (this is the CLI's confirm mode, enabled by default, and will not yolo).
- Run a command that looks like this:
gcloud run deploy linebot-backup-service \
--source . \
--region asia-east1 \
--set-env-vars "GOOGLE_CLOUD_PROJECT=your-cool-project-id,\
ChannelSecret=YOUR_LINE_SECRET_XXXX,\
ChannelAccessToken=YOUR_LINE_TOKEN_XXXX,\
GOOGLE_CLIENT_ID=PENDING,\
GOOGLE_CLIENT_SECRET=PENDING,\
GOOGLE_REDIRECT_URL=PENDING" \
--allow-unauthenticated \
--quiet
After 3 to 5 minutes, get the Service URL, such as https://linebot-backup-service-xxxxx.a.run.app.
Supplement the Real OAuth Settings
- Go back to the Console and change the
https://placeholder/oauth/callbackyou just filled in tohttps://linebot-backup-service-xxxxx.a.run.app/oauth/callback. - Paste the real Client ID / Secret to Gemini CLI and ask it to help you update:
gcloud run services update linebot-backup-service \
--region asia-east1 \
--update-env-vars \
"GOOGLE_REDIRECT_URL=https://linebot-backup-service-xxxxx.a.run.app/oauth/callback,\
GOOGLE_CLIENT_ID=real-client-id.apps.googleusercontent.com,\
GOOGLE_CLIENT_SECRET=real-secret-xxxx"
Phase Five: Point the LINE Webhook to Cloud Run
- Go back to LINE Developers Console → Messaging API tab.
- Webhook URL: Fill in
https://linebot-backup-service-xxxxx.a.run.app/callback. - Press Verify, and expect to see
Success. - Toggle Use webhook to on.
- Finally, go back to OA Manager and reconfirm that "Auto-reply messages" is off and "Webhook" is on.
Open LINE, add the Bot as a friend, throw a picture, run OAuth once, and see a folder LINE Bot Uploads/2026-05/... in Drive — the entire process is complete.
Common Maintenance Commands
| Function | Command |
|---|---|
| Redeploy | gcloud run deploy linebot-backup-service --source . --region asia-east1 |
| Change env vars | gcloud run services update linebot-backup-service --update-env-vars "KEY=VALUE" |
| Real-time log | gcloud beta run services logs tail linebot-backup-service |
| Check service status | gcloud run services describe linebot-backup-service --region asia-east1 |
The entire maintenance can actually be given to Gemini CLI: "Help me check the logs of linebot-backup-service for the last 5 minutes, and find 5xx" is enough.
Workshop On-Site Pitfall Records
Pitfall One: Billing Not Enabled, Red Error on First Deploy
The first gcloud run deploy directly spewed:
FAILED_PRECONDITION: Billing account for project [your-cool-project-id] is not found.
Please ensure that you have linked an active billing account.
Reason: Most workshop participants open new projects to do this, and new projects don't have Billing bound by default. Cloud Run, Cloud Build, and Artifact Registry all require billing to run — even within the free tier, you must have a "billing account with a linked card" attached to the project.
Solution:
# Check the current billing status of the project
gcloud beta billing projects describe your-cool-project-id
# List available billing accounts
gcloud beta billing accounts list
# Bind
gcloud beta billing projects link your-cool-project-id \
--billing-account=0X0X0X-0X0X0X-0X0X0X
If you can't or don't want to bind a card, we used the " sandbox project with billing already " as a demonstration on site.
Pitfall Two: Firestore type Parameter Name
The first version of the teaching material (even what AI guessed the first time) was written as --type=native or --type=native-mode:
ERROR: argument --type: Invalid choice: 'native-mode'.
Valid choices: ['firestore-native', 'datastore-mode']
Reason: After an update in 2024, gcloud firestore databases create changed the type parameter value to the more explicit firestore-native / datastore-mode. Old documents and old answers (including LLM training data) will give you the old values.
Solution:
gcloud firestore databases create \
--location=asia-east1 \
--type=firestore-native
This pitfall just demonstrated why you should install the Google Developer Knowledge MCP — after mounting it, Gemini will check the latest official documentation and will not give you outdated type values.
Pitfall Three: Forgot to Enable Drive API, OAuth Passed but Can't Write In
After deployment, Webhook is set up, OAuth consent screen is completed, and the token is obtained, but the first picture upload is 500. Check the log:
googleapi: Error 403: Google Drive API has not been used in project
your-cool-project-id before or it is disabled.
Reason: If you miss drive.googleapis.com in the gcloud services enable ... string in Phase Two, OAuth can pass (because the Consent Screen and Drive API are two different things), but your server will be blocked when it uses the access token to call drive.googleapis.com.
Solution (Quickest):
gcloud services enable drive.googleapis.com
Solution (Fundamental): Enable all the APIs you need at once, list them in the checklist of the teaching material, and run along with it on site so you won't miss it. I specifically wrote drive.googleapis.com into the string in Phase Two to block this pitfall.
[!TIP] A good habit for debugging: As long as the server has the correct token but is 403, first go to API Library to confirm that the corresponding API is enabled, then check the OAuth scope, and finally look at IAM. The wrong order will waste a lot of time.
Why is this combination worth learning?
After the workshop, I asked the on-site participants what moment they felt the most, and the answer was almost unanimous: "Deploying the service just by speaking Chinese to Gemini CLI" that moment.
So why does it feel that way? Breaking it down:
- Previously, DevOps was stuck on remembering which command, now it's stuck on expressing clearly what you want to do. The latter is much lower in threshold, with newcomers getting started in three days vs. three months before daring to touch
gcloud. - MCP injects official knowledge into Gemini in advance. You no longer need to RTFM yourself first, then translate it into a prompt for LLM; MCP is equivalent to letting LLM have the ability to RTFM itself.
- Error messages return to the tool itself. Previously, you had to Google + StackOverflow for errors, now you can directly paste them back to the CLI, which reads the error and then decides the next step — forming a complete plan-act-observe loop.
- The entire workflow is reproducible. The teaching materials, examples, and prompts are all in the GitHub repo, and anyone can clone it and follow along, and the results should be consistent.
Want to go deeper? Recommended Advanced Reading
- Official Materials:
kkdai/BwAI-2026 - Example Project:
kkdai/bwai2026-sample - Slides: SpeakerDeck
- Gemini CLI: github.com/google/gemini-cli
- MCP Specification: modelcontextprotocol.io
- Extension: Using Gemini CLI + Developer Knowledge MCP, Map MCP Grounding
Postscript: Come to LINE and Make Things Together
This workshop is also one of the recruitment events for our LINE Taiwan DevRel. If you read this and feel:
- Want to play with the integration of LINE Messaging API + Google Cloud + Gemini for a long time.
- Like to write production code while making the process into teaching materials that can be copied by others.
- Can invest more than three days a week and are willing to become a full-time partner after the internship.
Welcome to send me a private message or email to chat, we have a flexible internship program of three days a week, and if you do well, you have the opportunity to become a long-term partner.
Finally, thank you to all the developers who came to the site and did hands-on together — those who are willing to spend their weekends on "using new tools to get through the entire pipeline" are always the most admirable group in the community. See you next time!

Top comments (0)