GEMINI CLI • DEVELOPER GUIDE

How to Change Gemini CLI Directory + Complete Setup & Commands

Gemini CLI is Google’s powerful terminal AI agent for US & Europe developers. Learn how to change gemini cli directory, full installation, 50+ commands with copy-paste blocks, VS Code integration, project workflows & enterprise config. Node.js 18+ required. Works on macOS, Linux & Windows.

60 requests/min (free)
1K requests/day
Gemini 2.5 powered model

🔧 Complete Gemini CLI Installation Guide

Gemini CLI requires Node.js 18+. Check with node --version. US/Europe developers love it for VS Code integration, GitHub Actions & CI/CD.

Step 1: Install Node.js (if needed)

node --version
npm --version

Step 2: Quick Test (No Install)

npx https://github.com/google-gemini/gemini-cli

Step 3: Global Install (Recommended)

npm install -g @google/gemini-cli
gemini --version

Windows (PowerShell/Admin)

# PowerShell as Admin
$env:NPM_CONFIG_PREFIX="$env:USERPROFILE\npm"
npm install -g @google/gemini-cli
gemini --help
✅ First Run: Type gemini → Google login → Select color theme → Ready!

📁 How to Change Gemini CLI Directory (3 Methods)

Default config: ~/.gemini/ (Linux/macOS) or %USERPROFILE%\.gemini (Windows). Change for projects, teams, or enterprise setups.

Method 1: Environment Variable (Easiest)

# Linux/macOS (bash/zsh)
export GEMINI_CONFIG_DIR="$HOME/custom_gemini_dir"
gemini

# Windows PowerShell
$env:GEMINI_CONFIG_DIR = "$env:USERPROFILE\CustomGemini"
gemini

# Permanent: Add to ~/.bashrc or ~/.zshrc

Method 2: Project-Local .gemini Folder

Create .gemini/ in project root. CLI auto-detects (searches parent directories).

mkdir -p .gemini
echo '{"model":"gemini-2.5-pro"}' > .gemini/settings.json
echo '# Project context' > .gemini/GEMINI.md
gemini  # Uses local config

Method 3: Symlink/Junction (Advanced)

# Linux/macOS
ln -s /path/to/new/dir ~/.gemini

# Windows (Admin PowerShell)
New-Item -ItemType Junction -Path "$env:USERPROFILE\.gemini" -Target "C:\CentralGeminiConfig"
⚠️ Windows Note: Junctions require admin. Environment vars more reliable.

⚡ Complete Gemini CLI Commands List

50+ commands. Click any block to copy.

gemini
Interactive mode (main entry)
gemini -p “prompt”
One-shot prompt execution
gemini –sandbox
Secure sandbox execution
gemini –checkpointing
Auto-save session state
gemini -y
Auto-confirm (YOLO mode)
!ls
Shell command (! toggles)
gemini –model gemini-2.5-pro
Switch models
gemini ide status
VS Code/Cursor integration

Full Commands Table

Command What It Does Example Use Case
gemini Interactive AI terminal Daily coding assistant
gemini -p "..." Single prompt execution Quick code review
gemini --sandbox Secure execution mode Enterprise/production
gemini -y Skip confirmations CI/CD pipelines
!git status Shell commands Git workflow integration
GEMINI_CONFIG_DIR=... Change config directory Multi-project setups

🚀 Advanced Features & What You Can Build

1. VS Code / Cursor Integration

# Auto-detects open file in VS Code/Cursor
gemini ide status
# Highlights selected code → AI suggestions

2. .geminiignore & GEMINI.md

# .geminiignore (exclude files)
echo ".git
node_modules" > .geminiignore

# GEMINI.md (project context)
echo "Use Node.js 18+, React 19, TypeScript" > GEMINI.md

3. GitHub Actions & CI/CD

# .github/workflows/gemini.yml
- name: AI Code Review
  run: gemini -y --sandbox "Review PR"
  env:
    GEMINI_CONFIG_DIR: /github/workspace/.gemini

4. What You Can Build

  • AI-powered code reviewer (GitHub Actions)
  • Automated documentation generator
  • Multi-project workspace manager
  • Enterprise code compliance checker
  • React/Next.js component generator
  • TypeScript migration assistant

Ready to Master Gemini CLI?

How to change gemini cli directory अब आप जान गए। US/Europe developers के लिए perfect tool। 60 req/min free limit के साथ production-ready।

🚀 Install Gemini CLI Now
Gemini CLI Installation Guide

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart