Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Setting Up Your Command Line Assistant with Google Services (The Complete Guide)

Hey there! Welcome back. It's been a minute since my last blog on 7 Productivity Hacks That Changed My Life. Remember hack number 3? The wild command line assistant that manages your entire Google workspace from the terminal? Yeah, that…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hey there! Welcome back. It's been a minute since my last blog on 7 Productivity Hacks That Changed My Life. Remember hack number 3? The wild command line assistant that manages your entire Google workspace from the terminal?



Yeah, that one blew up in the comments. Everyone wanted the full breakdown. So here it is, the complete no-BS guide to setting up your own command line assistant with access to Gmail, Google Drive, Calendar, and basically your entire Google ecosystem.






Why This Setup is Absolutely Insane



Before we dive in, let me paint you a picture of what your life looks like once this is running:





  • Send emails without ever opening a browser


  • Schedule meetings with a single command


  • Upload files to Drive from your terminal


  • Search your Gmail like you're querying a database


  • Manage calendar events faster than you can say "productivity"



And the best part? It's all happening in your terminal. No clicking. No switching windows. Just pure, efficient command-line magic.






What You'll Need (The Boring But Necessary Stuff)



Look, I'm not gonna sugarcoat it. You need:




  • A computer (obviously)

  • Stable internet connection (wild requirement in 2024, I know)

  • Basic familiarity with terminal/command line

  • A Google account

  • About 30-45 minutes to set this up properly



One-time setup, lifetime benefits. Let's go.






Step 1: Install Gemini CLI (And Why Version Matters)



Here's where most people mess up. You can't just install the latest version and call it a day.



Why Gemini CLI?



Simple. It integrates seamlessly with Google Apps Script, giving us a robust MCP (Model Context Protocol) server for our command line agent. The integration is chef's kiss level smooth.



The Version Trap:



I spent hours debugging before I figured this out. You MUST use version 0.1.12. The latest versions? Broken. Buggy. Frustrating.



Save yourself the headache and install the specific version:




npm install -g @google/[email protected]






Verify it installed correctly:




gemini --version






You should see 0.1.12. If not, uninstall and try again.






Step 2: Set Up Google Cloud Console (The Foundation)



This is crucial. Don't skip this step or you'll run into permission issues later.






Create Your Project:




  1. Head over to Google Cloud Console

  2. Click "New Project" in the top dropdown

  3. Name it something memorable (I called mine "CLI-Assistant")

  4. Click Create






Enable the APIs:



You need to enable these APIs for your project:




  1. Go to "APIs & Services" > "Library"

  2. Search and enable each of these:


    • Gmail API

    • Google Drive API

    • Google Calendar API


    • Google Docs API (optional but recommended)


    • Google Sheets API (optional but recommended)








Generate Your Gemini API Key:




  1. In the Cloud Console, go to "APIs & Services" > "Credentials"

  2. Click "Create Credentials" > "API Key"

  3. Copy this key somewhere safe (you'll need it multiple times)

  4. (Optional but recommended) Click "Restrict Key" and limit it to only the APIs you enabled



Pro tip: Keep this key private. Like, seriously private.






Step 3: Create Your Google Apps Script



Time to build the brain of the operation.






Set Up the Project:




  1. Go to script.google.com

  2. Click "New Project"

  3. Name it something like "MCP Server for CLI"






Write the Code.gs File:



Delete the default code and paste this:




const apiKey = "YOUR_GEMINI_API_KEY_HERE";

const doPost = (e) => main(e);

function main(eventObject) {
const m = ToolsForMCPServer;
m.apiKey = apiKey;

// Enable the tools you want to use
// Play around with these flags
m.enableBaseTools = true;
m.enableClassroomTools = false;
m.enablePeopleTools = false;
m.enableAnalyticsTools = false;
m.enableMapsTools = false;

const object = { eventObject, items: m.getServer() };
return new MCPApp.mcpApp({ accessKey: "sample" })
.setServices({ lock: LockService.getScriptLock() })
.server(object);
}






Replace YOUR_GEMINI_API_KEY_HERE with the API key you generated earlier.



About those flags:





  • enableBaseTools: This is the core. Gmail, Drive, Calendar. Keep this true.

  • The others are specialized. Enable them if you need Classroom, Analytics, or Maps integration.






Create the appsscript.json File:



This is where permissions live. It's critical.




  1. In your Apps Script project, click "Project Settings" (gear icon)

  2. Check "Show 'appsscript.json' manifest file in editor"

  3. Go back to the editor, you'll see appsscript.json appear

  4. Replace its contents with this:




{
"timeZone": "YOUR_TIMEZONE_HERE", // e.g., America/Los_Angeles
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"dependencies": {
"enabledAdvancedServices": [
{
"userSymbol": "Drive",
"serviceId": "drive",
"version": "v3"
},
{
"userSymbol": "Gmail",
"version": "v1",
"serviceId": "gmail"
},
{
"userSymbol": "Calendar",
"version": "v3",
"serviceId": "calendar"
}
],
"libraries": [
{
"userSymbol": "MCPApp",
"libraryId": "1TlX_L9COAriBlAYvrMLiRFQ5WVf1n0jChB6zHamq2TNwuSbVlI5sBUzh",
"version": "18"
},
{
"userSymbol": "ToolsForMCPServer",
"libraryId": "1lnE7UL1jQgPDbTB9yjhiwZM0SaS9MObhzvWUWb_t8FisO6A3bLepvM2j",
"version": "39"
}
]
},
"webapp": {
"executeAs": "USER_DEPLOYING",
"access": "ANYONE_ANONYMOUS"
},
"oauthScopes": [
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.send",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.events",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/documents",
"https://www.googleapis.com/auth/presentations",
"https://www.googleapis.com/auth/forms",
"https://www.googleapis.com/auth/script.external_request"
]
}






Important notes:




  • Change timeZone to your timezone

  • The oauthScopes are the permissions. This setup requests access to Gmail, Drive, Calendar, Docs, Sheets, etc.

  • The libraries (MCPApp and ToolsForMCPServer) are essential. Don't change these IDs.



Save everything (Ctrl+S or Cmd+S).






Step 4: Deploy Your Script



This is where your code becomes accessible.




  1. In Apps Script, click "Deploy" > "New deployment"

  2. Click the gear icon next to "Select type"

  3. Choose "Web app"

  4. Fill in the details:



    • Description: "MCP Server v1" (or whatever you want)


    • Execute as: "Me"


    • Who has access: "Anyone"



  5. Click "Deploy"


  6. Authorize the app (Google will ask you to review permissions)


    • Click "Review Permissions"

    • Choose your Google account

    • Click "Advanced" (if it says the app is unverified)

    • Click "Go to your project name"

    • Click "Allow"



  7. Copy the Web App URL that appears. It looks like: https://script.google.com/macros/s/SOME_LONG_ID/exec



Keep this URL handy. You're almost there.






Step 5: Configure Gemini CLI to Use Your MCP Server



Now we connect everything together.






Initialize Gemini CLI:



Open your terminal and run:




gemini config






Follow the prompts to set up your Gemini API key if you haven't already.






Add the MCP Server:



Run:




gemini






Once Gemini CLI starts, type:




/mcp






This opens the MCP configuration menu. Follow the interactive prompts:




  1. Choose "Add new MCP server"

  2. Enter a name: google-services (or whatever you prefer)

  3. Paste your Web App URL from Step 4

  4. Confirm the configuration






Test the Connection:



Try a simple command:




Check my latest emails






Or:




What's on my calendar today?






If it works, you'll see Gemini accessing your Google services and returning results. If not, double-check:




  • Your API key is correct in Code.gs

  • The Web App URL is correct

  • You authorized the script properly






Step 6: Start Living in the Future



You're done. Seriously. Now you can:






Send Emails:






Send an email to [email protected] with subject "Meeting Tomorrow" and body "Hey John, are we still on for 3pm?"









Schedule Meetings:






Create a calendar event for tomorrow at 2pm titled "Team Standup"









Search Gmail:






Find all emails from [email protected] from last week









Upload to Drive:






Upload document.pdf to my Google Drive









And So Much More



The possibilities are endless. The more you use it, the more you'll discover what's possible.






Pro Tips and Troubleshooting






Common Issues:



"Permission denied" errors:




  • Go back to your Apps Script and re-deploy with fresh permissions

  • Make sure all APIs are enabled in Google Cloud Console



"Version mismatch" errors:




  • Confirm you're using gemini-cli version 0.1.12

  • Uninstall and reinstall if needed: npm uninstall -g @google/generative-ai-cli && npm install -g @google/[email protected]



MCP server not responding:




  • Check your Web App URL is correct

  • Make sure the deployment is set to "Anyone" access

  • Verify your API key is valid






Make It Better:





  1. Customize the flags in Code.gs based on what you actually use


  2. Add more oauth scopes if you need access to other Google services


  3. Create aliases in your shell for common commands


  4. Experiment with different prompts to see what works best






The Real Impact



Here's what changed for me after setting this up:




  • I send emails 5x faster

  • Scheduling meetings takes seconds instead of minutes

  • I never lose track of files because I can search Drive from anywhere

  • My workflow is completely keyboard-driven (no more mouse clicking through UIs)



It's not just about speed. It's about staying in flow. When you can do everything from the terminal, you're not context-switching. Your brain stays focused. That's the real productivity boost.






What's Next?



Want me to dive deeper into:





  • Custom automation workflows with this setup?


  • Advanced MCP server configurations?


  • Integrating other services beyond Google?



Drop a comment and let me know what you want to see next.






Let's Connect



I'm Prayush Adhikari, computer engineering student and productivity nerd. I'm documenting my journey of building systems that actually work.



If this guide helped you (or if you got stuck somewhere), let's connect:





Drop a comment below with:




  • Which part of the setup you found most useful

  • What you're automating first

  • What guide you want next



Thanks for reading! Now go build something that makes your life easier.






P.S. If you're stuck on any step, drop a comment. I read and respond to everything.

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Setting Up Your Command Line Assistant with Google Services (The Complete Guide)
id: f175fd41-4c0b-46f4-a0a0-c316d0bc209b
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-26
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-26"
        description = "YARA Signature for "
    strings:
        $str = "Setting Up Your Command Line A" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Setting Up Your Command Line Assistant w")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Setting Up Your Command Line Assistant w*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Setting Up Your Command Line Assistant w"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Setting Up Your Command Line Assistant w.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Setting Up Your Command Line Assistant with Google Services (The Complete Guide)

Thematisch verwandte Begriffe: Setting, Your, Command, Line · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100661 | Netty's HTTP/3 codec (io.netty:netty-codec-http3) versions 4.2.0.Final …
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag