Skip to main content
Version: Summer 2025 Forward with Her Program

Basic Tutorial: Environment Setup and Tool Installation

Learning Objectives

After completing this chapter, you will be able to:

  • Successfully register required development accounts
  • Install and configure Gemini CLI locally
  • Use AI to manage your development environment
  • Master basic AI-assisted development workflows
Watch the video walkthrough

The complete teaching video for Lessons 1 and 2 has moved to the centralized Video Tutorials page so you can find every video for this programme in one place.

Required Account Registration​

Before we start using Gemini CLI, we need to prepare three important accounts. These accounts will be used throughout the entire development process.

Why Do You Need GitHub?​

GitHub is the world's largest code hosting platform. We'll use it to:

  • Store and manage code
  • Collaborate with others on development
  • Showcase personal project portfolio

Registration Steps​

  1. Visit GitHub.com
  2. Click "Sign up" in the top right corner
  3. Fill in registration information:
    • Username: Choose a professional username (recommended to use real name or nickname)
    • Email: Use your regular email address
    • Password: Set a strong password
Professional Advice

Choose your username carefully, as it will appear in all your project URLs. Recommended:

  • Real name: john-smith
  • Professional nickname: webdev-pro
  • Avoid ending with numbers: coder123

Initial Configuration​

After registration, it's recommended to complete the following configuration:

# Configure Git global user information
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

Gemini CLI Installation and Configuration​

System Requirements​

Minimum Requirements

  • Windows 10 version 1903 or higher
  • Node.js 16.0 or higher
  • 4GB RAM (8GB recommended)

Recommended Configuration

  • Windows 11
  • Node.js 18.x LTS
  • Use Windows Terminal

Installation Steps​

Step 1: Check Node.js Version​

# Check if Node.js is installed
node --version

# If not installed or version is too low, visit nodejs.org to download and install

Step 2: Install Gemini CLI Globally​

# Install using npm (recommended)
npm install -g @google/gemini-cli

# Or use yarn
yarn global add @google/gemini-cli

# Or use pnpm
pnpm add -g @google/gemini-cli
Installation Tips

If you encounter permission issues:

  • Windows: Run command prompt as administrator
  • macOS/Linux: Use sudo npm install -g @google/gemini-cli

Step 3: Verify Installation​

# Check if installation was successful
gemini --version

# View available commands
gemini --help

Initial Configuration​

After installation, you need to perform initial configuration:

# 1. Log in to your Google account
gemini auth login

# 2. The system will open a browser, please log in to your Google account
# 3. Authorize Gemini CLI to access necessary permissions
# 4. Return to the terminal, you should see "Successfully authenticated!" message

Configuration Options​

# Set default project path
gemini config set default-path ~/projects

# Set language preference
gemini config set language en-US

# View current configuration
gemini config list

Basic Usage Examples​

Your First Conversation​

Now let's start using Gemini CLI!

# Start interactive conversation
gemini chat

# Gemini will respond:
# "Hello! I'm Gemini, your AI programming assistant. How can I help you?"

Practical Conversation Examples​

Environment Configuration​

You: Hello, I want to develop a web application. What development environment do I need to install?

Gemini: I'll help you configure a web development environment. I recommend installing the following tools:

1. Node.js and npm - JavaScript runtime environment
2. VS Code - Code editor
3. Git - Version control
4. Chrome DevTools - Debugging tools

Would you like me to help you automatically install these tools?

Dependency Management​

You: Please help me check what Node.js global packages I have locally, and suggest which ones can be removed

Gemini: Scanning your global npm packages...

Found the following packages:
- create-react-app (v4.0.3) - Recommend removal, use npx instead
- nodemon (v2.0.15) - Keep, commonly used for development
- typescript (v4.5.2) - Recommend removal, better to install at project level
- pm2 (v5.1.0) - Keep, process management tool

Would you like me to help clean up these packages?

PATH Management​

You: Help me view and organize the system PATH

Gemini: Detected the following entries in your PATH:

Duplicates:
- /usr/local/bin (appears 3 times)
- ~/.npm-global/bin (appears 2 times)

Invalid paths:
- /opt/old-software/bin (does not exist)

Recommended optimized PATH order:
1. ~/.local/bin
2. /usr/local/bin
3. ~/.npm-global/bin
4. /usr/bin

Would you like to apply these changes?

Say Goodbye to Traditional Cumbersome Methods​

Tools No Longer Needed​

Traditional ToolWhy Replaced by Gemini CLI
Cursor• Blocked in mainland China
• Low cost-effectiveness of Pro quota
• Gemini CLI is completely free to use
GitHub Desktop• No need for GUI tools
• Gemini can execute all Git operations
• More flexible command-line interaction
Git Commands• No need to memorize any Git commands
• Natural language description is enough
• AI automatically handles complex operations

Old vs New Comparison​

You: Commit my changes, description is "added new feature"
Gemini: Sure, I'll commit your changes...
[Executing git add, commit, push]
✓ Successfully committed to main branch

You: There's a conflict, help me resolve it
Gemini: Merge conflict detected, I'll help you:
1. Analyzing conflict files...
2. Suggesting resolution based on code logic...
3. Would you like to accept my suggestion?

You: View recent commit history
Gemini: Last 5 commits:
• 2 minutes ago: Added new feature (You)
• 1 hour ago: Fixed login issue (Zhang San)
• 3 hours ago: Updated documentation (Li Si)
...

Best Practice Recommendations​

Daily Workflow​

  1. Start of Day

    You: Good morning, help me check the project status
    Gemini: Checking your project status...
  2. Development Process

    You: I want to start developing user authentication feature
    Gemini: I'll help you prepare...
  3. Problem Solving

    You: npm install is showing an error, help me check it
    Gemini: I'll analyze the error...

Efficiency Improvement Tips​

  • Clear Expression: Clearly describe your needs, AI will help you more accurately
  • Continuous Conversation: Maintain context, letting AI better understand your project
  • Use History Well: Use gemini history to view previous conversations

Next Steps​

Congratulations on completing the basic environment configuration! Now you have:

  • Three necessary development accounts
  • Locally installed Gemini CLI
  • Basic knowledge of AI-assisted development

Continue to Practical Projects