AI Coding Workflow with Gemini Cli and VS Code

Recently Google released its Gemini CLI" (Github), offering a generous free tier for developers. With the Gemini CLI we can:

1. Query and edit large codebases in and beyond Gemini’s 1 M token context window, so we can feed in entire codebases or lengthy documentation for deep analysis and understanding
2. Generate new apps from PDFs or sketches, using Gemini’s multimodal capabilities.
3. Automate operational tasks, like querying pull requests or handling complex rebases.
4. Use tools and MCP servers to connect new capabilities, including media generation with Imagen, Veo or Lyria.
5. Ground queries with the Google Search tool, built in to Gemini.
6. Up to 60 requests per minute and 1,000 requests per day

[Image Placeholder 01: Introduction Graphic]

I think Claude Code is still the best AI coding assistant, but at its $200 USD price point, Google’s “free to start, sky-high cap, professional upgrade” strategy will dramatically lower the barrier to cutting-edge AI—and shows their determination to build a massive developer community quickly.


Google also mentioned its Agent-centric design—complete with built-in tools and extensibility. Here’s what I can explore:

Real-time web search. The native Google Search tool lets the CLI fetch live information from the internet.
Local file-system interaction. Work with local files (even WSL) just like in VS Code, and run system commands right inside Gemini CLI.
Extensible tool ecosystem (MCP). Hook up external “tool servers” via the Model Context Protocol to connect in-house APIs, databases, or project-management tools.
Customizable layered memory (GEMINI.md). Drop a GEMINI.md file anywhere in your home or project, and it becomes the model’s long-term memory or system prompt—inspect or refresh via /memory commands.


Getting Started: Installing Gemini CLI in local dev env

Step 1: Prerequisites
Let's update the dev container to create a portable dev environment, this time we need to ensure Node.js v18 or higher and Google Gemini CLI globally installed:


root@zack:/mnt/f/python/aws-terraform-python# vim Dockerfile

# Use the latest Python image as base
FROM python:latest

### ===
existing dockerfile
###===

# Install curl, Node.js & npm (v20.x)
RUN apt-get update \
 && apt-get install -y curl ca-certificates \
 && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
 && apt-get install -y nodejs \
 && rm -rf /var/lib/apt/lists/*

# --- Install Google Gemini CLI globally (non-interactive) ---
RUN npm install -g @google/gemini-cli


  

Step 2: Update Docker Compose to Launch the container, attach to local Dev folder for VS Code


root@zack:/mnt/f/python/aws-terraform-python# docker compose up --build -d
[+] Running 2/2
 ✔ dev-container            Built            0.0s
 ✔ Container dev-container  Started          12.0s

  
[Image Placeholder 01: Introduction Graphic]

Step 3: Authenticate to Google account
Run gemini in VS Code terminal and follow the OAuth flow to log in with personal Google account to unlock free Gemini 2.5 Pro access instantly.

[Image Placeholder 01: Introduction Graphic] [Image Placeholder 01: Introduction Graphic]

Step 4: Start Chatting!

[Image Placeholder 01: Introduction Graphic]

Gemini CLI Command Cheat Sheet

List a “quick-reference” of commands straight from the official docs. .

1. Slash (/) Commands: Session & Meta Control
/help or /? — Show help and list all available commands.
/chat save — Save the current conversation history with a tag for easy restoration.
/chat resume — Resume a conversation from a previously saved tag.
/chat list — List all saved conversation tags.
/compress — Replace the entire chat context with a summary. Great for long sessions to save tokens while retaining core info.
/memory show — Display all layered memory loaded from GEMINI.md files.
/memory refresh — Reload memory from GEMINI.md files after you’ve updated them.
/restore [tool_call_id] — Undo the last tool-driven file change (requires --checkpointing when running gemini).
/stats — Show detailed session stats, including token usage and duration.
/theme — Open the theme selector.
/clear (or Ctrl+L) — Clear the terminal screen.
/quit or /exit — Exit Gemini CLI.

2. At (@) Commands: Inject Files & Directory Context
@<file_path> — Inject the contents of a specific file into your prompt. @README.md → “What is this file about?”
@<directory_path> — Inject all (non-gitignored) text files in a directory and its subdirectories. @src/my_project/ → “Summarize the code in this directory.”
(Use backslashes \ to escape spaces in paths.)

3. Exclamation (!) Commands: Seamless Shell Integration
!<shell_command> — Run a single shell command and return to Gemini CLI. !ls -la or !git status
! (alone) — Toggle “Shell mode.” In this mode, everything you type is run as shell commands, and the prompt color changes. Enter ! again to exit back to the AI chat.


Wrapping Up: The Perfect Duo for Every Workflow

Overall, this is a great move by Google for AI coding. The identical “Agent mode” engine behind VS Code’s Gemini Code Assist, combined with its large context window and generous free quota, can be a game-changer for many developers. With VS Code’s rich interface and extensions, you get your favorite IDE and your leanest shell side by side—both synced by the same AI powerhouse to supercharge your workflow.

Give it a try—haha!

Welcome to Zack's Blog

Join me for fun journey about ##AWS ##DevOps ##Kubenetes ##MLOps

  • Latest Posts