Skip to main content
Version: Summer 2025 SheCodes Program

Practical Project: Managing Development Environment with Gemini CLI

Project Goals

Through this chapter's practical project, you will:

  • 🧹 Clean up redundant dependencies and free up disk space
  • 🔧 Optimize system PATH configuration
  • 🚀 Establish an efficient AI-assisted workflow
  • 📊 Learn to manage multiple development project environments

📹 Course Video

Watch the complete teaching video for Lessons 1 and 2:

🎯 Project 1: Intelligent Environment Cleanup

Many developers' computers have accumulated a large number of unused dependencies and tools. Let's use Gemini CLI for a thorough cleanup.

Project Background

💭 Real Case Study

A developer successfully cleaned up 50GB of redundant files after using Gemini CLI! Including:

  • Outdated node_modules folders
  • Duplicate global npm packages
  • Abandoned development tools
  • Temporary build files

Practice Steps

Comprehensive Local Environment Scan

gemini chat

You: Please help me scan all local development environments, dependencies, and libraries, list detailed inventory

Gemini: Starting to scan your development environment...

📊 Scan Results:

1. Node.js Environment:
- Versions: v18.17.0, v16.20.0, v14.21.0
- Global packages: 87 (using 2.3GB)

2. Python Environment:
- Versions: 3.9.7, 3.8.10, 2.7.18
- pip packages: 156 (using 4.1GB)

3. Project Folders:
- Detected 23 projects
- node_modules total: 18.7GB
- Unused for over 6 months: 12 projects

4. Development Tools:
- Docker images: 34 (using 12.3GB)
- VS Code extensions: 48

Which part would you like me to analyze in detail?

Project Results

💾 Space Freed

32.4GB / 50GB

Successfully cleaned redundant files

⚡ Performance Improvement

  • npm command response speed improved by 40%
  • System boot time reduced by 15 seconds
  • Development tools run more smoothly

🛤️ Project 2: PATH Environment Optimization

Messy PATH configuration can lead to command conflicts and performance issues. Let's use AI to optimize it.

Common PATH Problems

🔄 Duplicate Paths

The same path is added multiple times, affecting lookup efficiency

❌ Invalid Paths

Pointing to non-existent directories, causing command lookup failures

🎭 Order Confusion

Improper priority settings may use wrong tool versions

Optimization Practice

You: Help me analyze the system PATH and find all problems

Gemini: Analyzing your PATH configuration...

🔍 PATH Analysis Report:

Current PATH entries (in order):
1. /usr/local/bin ⚠️
2. /opt/homebrew/bin ✅
3. /usr/local/bin ⚠️ [Duplicate]
4. ~/.npm-global/bin ✅
5. /usr/bin ✅
6. /opt/old-tools/bin ❌ [Does not exist]
7. ~/.npm-global/bin ⚠️ [Duplicate]
8. /usr/local/go/bin ✅
9. /Applications/Docker.app/Contents/Resources/bin ❌ [Docker not installed]
10. /usr/local/bin ⚠️ [3rd duplicate]

📊 Problem Summary:
- 3 duplicate entries
- 2 invalid paths
- Recommended to adjust priority order

🎯 Optimization Recommendations:
1. User-level tools should take priority over system-level
2. Commonly used tool paths should be at the front
3. Remove all duplicate and invalid entries

🚀 Project 3: Git Workflow Automation

Say goodbye to tedious Git commands and let AI handle all version control operations.

Scenario Practice

Scenario: Starting Work in the Morning

You: Good morning, I want to continue yesterday's feature development

Gemini: Good morning! Let me help you prepare the development environment.

🔍 Checking project status...

📊 Project: awesome-web-app
📍 Current branch: feature/user-auth
📝 Uncommitted changes: 3 files

Yesterday's work summary:
- Completed login form UI
- Added form validation logic
- TODO: Connect backend API

Today's recommendations:
1. First commit yesterday's changes
2. Pull latest code from main branch
3. Continue API integration work

Would you like me to execute these operations for you?

You: Okay, first commit yesterday's changes

Gemini: Committing your changes...

Viewing change content:
- src/components/LoginForm.jsx (new)
- src/utils/validation.js (new)
- src/styles/auth.css (new)

Generated commit message:
"feat: Implement user login form UI and validation logic

- Create responsive login form component
- Add email and password validation rules
- Apply custom style theme"

✓ Changes committed
✓ Pushed to remote repository

Now pulling latest code...
✓ Main branch updated, no conflicts

You can start today's development!

🏆 Project 4: Building Personal Workflow

Every developer has unique work habits. Let's use Gemini CLI to create a customized automated workflow.

Custom Command Set

Example 1: Project Initialization Assistant

You: Create a new React project using TypeScript with my commonly used configurations

Gemini: Understood! I'll create a React TypeScript project that matches your preferences.

🚀 Initializing project...

Execution steps:
1. Create React TypeScript application
2. Install your commonly used dependency packages
3. Configure code standards tools
4. Set up Git repository

npx create-react-app my-app --template typescript
cd my-app

📦 Installing additional dependencies...
- axios (HTTP requests)
- react-router-dom (routing)
- @mui/material (UI components)
- react-hook-form (form handling)

⚙️ Configuring development tools...
✓ Added .prettierrc
✓ Configured ESLint rules
✓ Created .vscode/settings.json
✓ Set up Git hooks (husky)

📁 Creating project structure...
src/
├── components/
├── pages/
├── services/
├── hooks/
├── utils/
├── types/
└── styles/

✓ Project creation complete!

All your common settings have been configured.
Run 'npm start' to begin development!

Example 2: Deployment Assistant

You: Deploy this project to Vercel

Gemini: I'll help you deploy to Vercel!

🔍 Checking project configuration...
✓ Detected React application
✓ build command: npm run build
✓ output directory: build/

📝 Creating Vercel configuration...
Generated vercel.json:
{
"buildCommand": "npm run build",
"outputDirectory": "build",
"framework": "create-react-app"
}

🚀 Starting deployment...

1. Connecting Git repository
2. Triggering Vercel build
3. Assigning domain name

Build log:
[10:23:15] Cloning repository...
[10:23:18] Installing dependencies...
[10:23:45] Building project...
[10:24:12] Optimizing assets...
[10:24:20] Deployment complete!

✅ Deployment successful!

🌐 Access URLs:
- Production: https://my-app.vercel.app
- Preview: https://my-app-git-main.vercel.app

📊 Deployment Info:
- Build time: 65 seconds
- Deployment region: Global CDN
- SSL certificate: Automatically configured

Would you like to configure a custom domain?

Efficiency Improvement Data

75%
Reduced command input
90%
Reduced configuration errors
3x
Faster deployment speed
50%
Saved debugging time

💡 Advanced Tips

Batch Operations

You: Check dependency update status for all my projects

Gemini: Scanning all your projects...

Found 12 projects, starting dependency update check:

📦 project-1: awesome-web-app
⚠️ 3 major updates available
- react: 18.2.0 → 18.3.0
- typescript: 5.0.4 → 5.3.3
- vite: 4.4.9 → 5.0.11

📦 project-2: api-server
✅ All dependencies are up to date

📦 project-3: mobile-app
⚠️ 5 updates available
[Detailed list...]

Summary:
- 8 projects have available updates
- 4 projects have up-to-date dependencies
- Estimated update time: approximately 15 minutes

Should I batch update all projects? (Will run tests first to ensure compatibility)

Intelligent Debugging

You: My application failed to start, help me diagnose

Gemini: I'll help you diagnose the problem.

🔍 Collecting error information...

Found error:
Error: Cannot find module '@/components/Header'

🔧 Diagnosis Result:

Problem: Module path alias configuration error
Cause: TypeScript and Webpack path aliases are inconsistent

Solution:
1. Update tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}

2. Ensure webpack.config.js has synchronized configuration:
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
}

Would you like me to automatically fix this problem?

🎓 Course Summary

Skills You've Mastered

Environment Management

Intelligently clean and optimize development environment

Git Automation

Complete version control with natural language

Workflow Optimization

Create personalized efficient workflows

Problem Diagnosis

Quickly locate and resolve development issues

Next Step Recommendations

  1. Continuous Optimization: Constantly adjust AI assistant behavior based on daily use
  2. Share Experience: Share your best practices with the community
  3. Explore More: Try applying Gemini CLI to more scenarios

🚀 Congratulations on Completing the Course!

You have successfully mastered all core skills for managing local development environments using Gemini CLI. Now you can:

  • Efficiently manage and optimize development environments
  • Automate daily development tasks with AI
  • Build workflows that suit you
  • Quickly resolve development problems

🎉 Course Complete!

Thank you for attending Chan Meng's AI Programming Public Course

Looking forward to seeing you create excellent works using these skills!