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
- Step 1: Environment Scan
- Step 2: Identify Redundancy
- Step 3: Execute Cleanup
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?
Intelligently Identify Items to Clean
You: Analyze what redundant content can be safely deleted
Gemini: Based on analysis, the following content can be safely deleted:
🗑️ Cleanable Items (estimated to free up 32.4GB):
1. Outdated Node.js Versions:
❌ v14.21.0 - Maintenance ended
✅ Keep v18.17.0 (LTS)
2. Duplicate Global npm Packages:
❌ create-react-app@4.0.3 - Use npx instead
❌ webpack@4.46.0 - Better to install at project level
❌ gulp-cli@2.3.0 - Unused for a long time
3. Abandoned Project node_modules:
❌ ~/projects/old-todo-app (1.2GB)
❌ ~/projects/test-project-2022 (2.1GB)
❌ ~/experiments/abandoned-blog (1.8GB)
4. Docker Cleanup:
❌ 12 dangling images (4.2GB)
❌ 8 stopped containers (1.1GB)
⚠️ Recommended to Keep:
✅ Projects used in the last 3 months
✅ Production environment related tools
✅ Personal configuration files
Shall I start the cleanup?
Safely Execute Cleanup Operations
You: Okay, please help me execute the cleanup, but backup important configurations first
Gemini: Wise choice! I'll backup important configurations before cleaning.
📦 Backup Phase:
✓ Created backup directory ~/gemini-backup-2025-01-20
✓ Backed up .npmrc, .gitconfig
✓ Backed up VS Code settings
✓ Exported installed package list
🧹 Starting Cleanup:
[1/5] Uninstalling outdated Node.js versions...
✓ Removed v14.21.0
[2/5] Cleaning global npm packages...
✓ Uninstalled create-react-app
✓ Uninstalled webpack@4.46.0
✓ Uninstalled gulp-cli
Freed: 856MB
[3/5] Deleting abandoned projects...
✓ Deleted old-todo-app/node_modules
✓ Deleted test-project-2022/node_modules
✓ Deleted abandoned-blog/node_modules
Freed: 5.1GB
[4/5] Docker cleanup...
✓ Deleted dangling images
✓ Deleted stopped containers
Freed: 5.3GB
[5/5] Cleaning system cache...
✓ npm cache cleaned
✓ pip cache cleaned
Freed: 1.2GB
🎉 Cleanup Complete!
Total space freed: 32.4GB
Backup location: ~/gemini-backup-2025-01-20
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