Google’s New CLI Is The Missing Piece (Gemini CLI + gws) for Real Terminal Workflows

basanta sapkota

Last week I caught myself doing my least-favorite developer dance. You know the one. Copy a stack trace into a chat box, wait, copy the suggestion back into the editor, run a command the model can’t see, then repeat until your coffee goes cold.

Sure, it works… kind of. But it’s clunky. Google’s new CLI feels like the missing piece because it drags the model out of the “separate chat window” world and drops it right where work actually happens: your terminal, your repo, and now even Google Workspace APIs.

Under this “new CLI” umbrella, two tools matter in real life:

  • Gemini CLI is an open-source AI agent for your terminal. It comes with tools baked in: file ops, shell commands, web fetching, the whole deal.
  • Google Workspace CLI is one CLI that exposes Google Workspace APIs on the fly and returns structured JSON by default, which is basically catnip for agent workflows.

Key takeaways

Here’s the stuff you’ll actually care about once you install it:

  • Gemini CLI runs via npx or you can install it globally. Google documents a free tier for personal accounts: 60 requests/min and 1,000 requests/day.
  • It supports Gemini 3 models, advertises a 1M token context window, and includes built-in tools like Search grounding, shell, file ops, and web fetch.
  • Extension setup got way less painful. Extension settings are now first-class, extensions can prompt you for config during install, and secrets can go into your system keychain instead of sitting around in plaintext.
  • gws builds its commands dynamically using Google’s Discovery Service at runtime. So new endpoints can show up without you waiting for a CLI update.
  • One real-world caveat: session resume can miss shell command output sometimes, and that can make “resumable sessions” feel a bit… wobbly.

Why Google’s new CLI feels like the missing piece for developers

The “missing piece” isn’t another model. We already have plenty of those.

It’s tooling that makes model + environment + automation feel like one continuous loop. No more copy/paste theater.

Gemini CLI is terminal-first on purpose. Google lists Google Search grounding, file operations, shell commands, and web fetching right in the project description and the npm page. With your permission, it can read files, run commands, and keep context close to the code, where it belongs.

And then gws shows up and fixes a different kind of headache. If you’ve ever scripted Workspace automation, you’ve probably paid the “tax” already: OAuth setup, discovery docs, raw REST calls, pagination, then you still end up reshaping output so it’s usable.

gws flips the vibe:

  • It reads Google’s Discovery Service at runtime, so the command surface is dynamic.
  • It returns structured JSON by default, which works for humans and for agents.

That’s why a YouTube creator framed Google’s new CLI as the missing piece for Claude Code and questioned whether it changes the MCP-server story. Even if you don’t buy the “replaces MCP forever” angle, the underlying point still lands. Once your CLI speaks JSON and discovers APIs automatically, agent workflows break less often and duct-tape scripts feel less cursed.

Install Gemini CLI and authenticate

You can run Gemini CLI without installing it:

npx @google/gemini-cli

Or install globally:

npm install -g @google/gemini-cli

Google also documents a Homebrew install:

brew install gemini-cli

Authentication options

The official npm page basically funnels you into two common routes.

1) Login with Google
Great for individuals. No API key wrangling. Google documents the free tier at 60 req/min and 1,000 req/day.

2) Use a Gemini API key

export GEMINI_API_KEY="YOUR_API_KEY"
gemini

My two cents from day-to-day use: OAuth feels nicer on a laptop. API keys are nicer in scripts and CI because they’re predictable and don’t surprise you later.

Using Gemini CLI without fighting it

A few commands I keep reaching for, over and over.

Start inside a repo so it can “see” the project

cd my-project
gemini

Want it to include extra directories too?

gemini --include-directories ../lib,../docs

Non-interactive mode

gemini -p "Summarize the failing tests and propose a minimal fix"

Need structured output for automation?

gemini -p "Explain the architecture of this codebase" --output-format json

And if you’re doing something longer and want streaming events:

gemini -p "Run tests and draft a PR description" --output-format stream-json

Gemini CLI extensions and why “extension settings” is a big deal

If you’ve ever installed a CLI extension and immediately hit a vague “missing env var” error… yep. You already get it.

Google’s Developers Blog announced extension settings for Gemini CLI extensions, and it’s the kind of improvement you only notice after you’ve suffered.

What changed:

  • Extensions can define required settings in their manifest.
  • You get prompted during install, so you’re not hunting through a README trying to guess what it wants.
  • Sensitive values like API keys can go into the system keychain.
  • You can manage settings using gemini extensions config ...
  • Settings can be scoped globally or per workspace using --scope workspace

Example from Google’s post:

gemini extensions config <extension-name>
gemini extensions config <extension-name> <env-var-name>
gemini extensions config alloydb ALLOYDB_POSTGRES_CLUSTER --scope workspace

That workspace scope detail looks small on the page. In practice, it’s huge. It’s the difference between “works on my machine” and “works per repo without me babysitting it.”

External reference: Google’s write-up on [extension settings for Gemini CLI].

Google Workspace CLI, the other half of the puzzle for agents

If Gemini CLI is “AI in your terminal,” gws is “Workspace APIs in your terminal.” And it’s surprisingly clean.

Install it:

npm install -g @googleworkspace/cli

Key behavior straight from the npm docs, and these bits matter:

  • gws doesn’t ship a static command list
  • It reads Google’s Discovery Service at runtime
  • It returns structured JSON
  • npm bundles pre-built native binaries, so you don’t need a Rust toolchain

Auth flow:

gws auth setup   

# one-time
gws auth login

Then you can run things like:

gws drive files list --params '{"pageSize": 5}'

Need schema introspection?

gws schema drive.files.list

Want pagination you can pipe into tools, NDJSON-ish style?

gws drive files list --params '{"pageSize": 100}' --page-all | jq -r '.files[].name'

One caveat worth not ignoring: the npm page warns about OAuth apps in testing mode. Google may limit consent to ~25 scopes, and the recommended preset can exceed it. The suggested workaround is choosing individual services:

gws auth login -s drive,gmail,sheets

External reference: the official @googleworkspace/cli documentation on npm.

Known pain points (because yep, it’s still a CLI)

Two honest gotchas from real users.

1) Resume may miss shell command context

There’s a GitHub issue reporting when you resume a Gemini CLI session, the resumed session can be missing shell commands and their output, even if those commands were how you loaded context earlier. The reporter’s point is fair: the scrollback makes it look like the model has context it no longer has.

If your workflow is “run a bunch of commands, then ask questions,” keep this in the back of your mind.

Source: Resumed session is missing shell commands and their output (Issue #21066)

2) Community feedback on persistence and behavior differences vs AI Studio

A Reddit thread, opinionated but still useful as signal, notes that Gemini CLI may require manual memory saving via a save_memory tool. It also claims the CLI can feel more constrained or “boring” than AI Studio due to system prompt choices, and mentions reports of looping behavior.

Source: r/Bard thread on configuring Gemini CLI after AI Studio changes

A practical workflow: Gemini CLI + gws together

Here’s a pattern I genuinely like: use gws to pull structured Workspace data, then let Gemini CLI summarize it or act on it.

Example: list your latest Drive files and generate a short changelog-style summary.

gws drive files list --params '{"pageSize": 10}' --page-all \
  | jq -c '.files[] | {name, id, modifiedTime}' \
  | gemini -p "Summarize these files for a weekly update. Group by recency." --output-format json

Now you’ve got a summary you can paste into an email, a doc, or a ticket. No custom integration.Yet little “one-off” script you’ll forget about in a month and fear touching again.

Wrap-up: try one small automation this week

Google’s new CLI feels like the missing piece because it turns AI work into a tighter feedback loop. Run commands. Read files. Fetch docs. Call APIs. Produce JSON. Repeat. It feels less like a magic trick and more like an actual workflow.

If you want the lowest-risk starting point, install Gemini CLI and use --output-format json in one small script. Add gws when you’re ready to pull Workspace data into the loop.

And if you run into weird session persistence issues, I’d honestly love to hear how it broke. Drop a comment with your workflow and what went sideways.

Internal reads you might like next.


Sources

  1. Gemini CLI npm package. @google/gemini-cli . Installation, free tier (60 req/min, 1,000 req/day), models, built-in tools, output formats
    https.//www.npmjs.com/package/@google/gemini-cli
  2. Gemini CLI GitHub repository . Project description and usage examples
    https.//github.com/google-gemini/gemini-cli
  3. Google Developers Blog . “Making Gemini CLI extensions easier to use” (extension settings, keychain storage, gemini extensions config, workspace scope)
    https.//developers.googleblog.com/making-gemini-cli-extensions-easier-to-use/
  4. GitHub Issue #21066 . Resumed session missing shell commands/output context
    https.//github.com/google-gemini/gemini-cli/issues/21066
  5. Reddit discussion — user-reported differences/limitations vs AI Studio, config-file tweaking claims
    https.//www.reddit.com/r/Bard/comments/1qsvbgq/for_those_trying_gemini_cli_after_ai_studio/
  6. Google Workspace CLI npm package. @googleworkspace/cli — dynamic Discovery Service command surface, JSON output, auth commands, scope warning
    https.//www.npmjs.com/package/@googleworkspace/cli
  7. Medium article — overview framing of gws (Rust, npm, dynamic discovery, structured JSON)
    https.//medium.com/coding-nexus/google-just-shipped-a-cli-for-all-of-google-workspace-and-it-works-with-ai-agents-too-204fe2bbd2f6
  8. YouTube — “Does Google’s New CLI Replacing MCP Servers Forever?” (community framing: “missing piece for Claude Code”)
    https://www.youtube.com/watch?v=EKG9kX86u0s

Post a Comment