Skip to content

Gemini Code

Gemini CLI is Google’s high-performance terminal interface for interacting with Gemini models. It provides a robust platform for agentic coding, specialized subagents, and advanced tool use, making it a powerful companion to Claude Code.

Gemini CLI (often referred to as gemini) allows you to interact with Google’s most capable models directly from your shell. Its primary strengths lie in:

  • Massive Context Window: Native support for Gemini 1.5 Pro’s 2M+ token context window.
  • Multimodal Native: Better at handling image and video inputs for UI/UX analysis.
  • Agentic Infrastructure: Built-in support for specialized “Subagents” that can execute tasks in parallel or in isolation.
  • System Integration: Seamless access to your local filesystem and terminal environment.

Subagents are specialized “specialists” with their own system prompts, personas, and toolsets. They are designed to handle complex tasks without polluting the main conversation’s context.

In our community workflow, we use specific subagents to maintain brand consistency and quality standards. These are defined in .gemini/agents/:

AgentPurposePrimary Workflow
@ui-builderComponent implementationBuilds UI components adhering to brand rules and design tokens.
@a11y-reviewerAccessibility auditsPerforms audits using a WCAG checklist to ensure compliance.
@visual-qaViewport testingUses Playwright to test components across 375px, 768px, and 1024px viewports.

From the Gemini CLI, you can delegate specific tasks to these agents:

Terminal window
# Example commands:
@ui-builder Build the StoreStatusBadge component per FRICTIONLESS_PLAN.md section 3.1
@a11y-reviewer Review src/components/homepage/StoreStatusBadge.tsx for accessibility
@visual-qa Test the homepage across mobile, tablet, and desktop viewports

The Jules extension is a game-changer for long-running tasks. Unlike standard agents that wait for your input, Jules operates asynchronously in a dedicated environment.

  • Asynchronous Execution: Delegate a task (like “Fix all linting errors in the lib folder”) and continue working on other things.
  • Sandboxed VM: Jules clones your code, installs dependencies, and runs tests inside its own virtual machine.
  • GitHub Integration: Automatically pulls GitHub issues and submits PRs upon completion.
  • Parallel Processing: Can handle multiple issues or tasks simultaneously.
Terminal window
gemini extensions install https://github.com/gemini-cli-extensions/jules --auto-update

Note: Requires a Jules account at jules.google.com and repository connection via the Jules console.

For complex full-stack projects, we recommend a “Divide and Conquer” strategy between Claude and Gemini. This is detailed in our FRICTIONLESS_PLAN.md (Section 8).

Task TypeRecommended ModelWhy?
Logical RefactoringClaude (Sonnet 3.5)Superior reasoning for complex code logic and architectural changes.
Massive Context TasksGemini (1.5 Pro)Best for “Search and Destroy” missions across millions of tokens or multi-file analysis.
UI/UX & Visual QAGemini (1.5 Pro/Flash)Better native multimodal understanding of screenshots and design files.
Background MaintenanceJules (Gemini-powered)Perfect for dependency updates, linting, and unit test expansion while you code.
  • File Ownership: Avoid having two models write to the same file in the same session.
  • Commit Cadence: Commit after every successful agentic loop to provide a “checkpoint” for the next model.
  • Parallel Workflows: Use tmux to run Claude in one pane for feature development and Gemini in another for documentation and QA.

To unlock the full potential of subagents, you must enable experimental features in your settings.

Edit your ~/.gemini/settings.json file to include:

{
"experimental": {
"enableAgents": true
}
}

Community Tips for Government/Military Users

Section titled “Community Tips for Government/Military Users”
  • Data Residency: Be aware that Gemini CLI transmits data to Google Cloud. Check your organization’s sensitivity level for proprietary or CUI code.
  • Tool Safety: Use the /safe or /ask modes if you are uncomfortable with the “YOLO” execution of shell commands.
  • Context Injection: Use llms.txt and .gemini-rules files to provide mission-specific context without manually pasting it every time.