Scenarios & Prompt Examples
Case Slides This slide is created based on the following content by Gemini CLI.
What is Gemini CLI?
Gemini CLI is an open-source command-line AI tool that integrates Google's Gemini model directly into your terminal.
- Powerful code processing capabilities: Supports context of over 1 million tokens.
- Seamless shell integration: Can directly execute and understand shell commands.
- File system awareness: Capable of reading and analyzing local files and directories.
Case 1: Code Development & Project Analysis
Scenario: Understanding complex code, automatic code generation, and large-scale refactoring.
Prompt Examples:
- Code explanation:
bash
> Explain the core functionality of @/path/to/complex-module.js - Generate unit tests:
bash
> Write unit tests for the calculateTotal function in @/path/to/logic.ts - Project refactoring:
bash
> Refactor the entire project to support a new database abstraction layer: > 1. Identify all database-related code > 2. Create a unified data access interface > 3. Generate migration plan and timeline
Case 2: Automated Operations & DevOps
Scenario: Simplifying Git operations, generating release notes, optimizing CI/CD workflows.
Prompt Examples:
- Generate commit messages:
bash
> Summarize the current git diff changes and write a concise commit message - Analyze Git history:
bash
> Analyze recent git commit history, summarize main changes and generate concise release notes - CI/CD optimization:
bash
> Optimize our CI/CD workflow: analyze build time bottlenecks, suggest parallelization strategies, create intelligent test selection
Case 3: File Management & Data Organization
Scenario: Intelligently organizing messy folders, automatically categorizing files based on content.
Prompt Examples:
- PARA method organization:
bash
> I want to organize my folders using the PARA system. Please first scan the current directory structure, then propose a reorganization plan. - Smart image categorization:
bash
> Analyze all image files in the current directory and automatically categorize them into different folders based on content, capture time, and scenes. - Invoice organization:
bash
> Organize my PDF invoices by expense month.
Case 4: Content Creation & Document Management
Scenario: Quickly generating project documentation, API references, and meeting minutes.
Prompt Examples:
- Generate README:
bash
> Generate a README.md file for this project, including project introduction, installation instructions, usage methods, and contribution guidelines - Generate API documentation:
bash
> Generate complete API documentation based on @api-spec.json, including interface descriptions, parameter definitions, and example code - Knowledge base Q&A:
bash
> Based on all documents in the @knowledge-base/ directory, answer questions about project architecture
Case 5: Multimodal Application Development
Scenario: Converting design mockups, PDF documents, or even sketches directly into functional code.
Prompt Examples:
- UI design to code:
bash
> Based on this UI design mockup (@design.png), create a React application with pixel-perfect UI components and responsive design - PDF to code:
bash
> Analyze this API specification document (@api_spec.pdf) and generate: > 1. Complete TypeScript interface definitions > 2. API client wrapper class > 3. Unit test cases
Gemini CLI is Your Terminal AI Swiss Army Knife
Start exploring the power of AI in your terminal!