1. Introduction to Google Gemini CLI [0]

thumbnail Google Gemini CLI is a powerful, free, open-source AI agent for your terminal that can assist with coding tasks.

1.1. What is Gemini CLI? [5]

  1. Gemini CLI is a command-line interface (CLI) tool, meaning it's used within the terminal. [6]
  2. It can be used in two main ways:
    1. Interactive mode: Chatting with AI agents directly in the terminal. [7]
    2. Single-shot requests: Making quick, specific queries to the AI. [10]
  3. Gemini CLI is Google's competitor to tools like Cursor, offering AI assistance directly within the developer's workflow. [12]

1.2. Pricing and Free Access [23]

  1. Gemini CLI is completely free for individual developers. [23]
  2. This includes access to Google's most advanced model, Gemini 2.5 Pro, at no cost. [24]
  3. Generous free usage limits are provided:
    1. Up to 60 model requests per minute (equivalent to one request per second). [25]
    2. Up to 1,000 requests per day. [28]
  4. This free access offers significant value, as a single request using Gemini 2.5 Pro's 1 million token context window would normally cost around $3. [29]
  5. Google is making a substantial investment to allow developers to try out this new tool. [33]

1.3. Key Features [37]

  1. Google Search Integration: Gemini CLI can perform Google searches directly from the terminal. [39]
  2. MCP Server Integration: It can connect to and utilize various tools and services through MCP servers. [40]
    1. This includes capabilities like image and video creation using tools like MCP and VO. [41]
    2. It allows for controlling services like Notion or Gmail from the terminal. [71]
  3. Customizable Prompts: Users can update prompts using a Gemini.mmarkdown file to tailor the CLI's behavior. [46]
  4. Task Automation and Workflow Integration: Gemini CLI can be called through scripts to automate tasks and integrate with existing workflows. [50]

2. Setting Up Gemini CLI [83]

thumbnail

2.1. Installation Process [85]

  1. The setup is straightforward and requires Node.js to be installed. [88]
  2. Install Gemini CLI globally by running the following command in the terminal: npm install -g @google/gemini-cli. [89]
  3. After installation, running the gemini command will open an interactive shell. [93]

2.2. Authentication [95]

  1. To access the free credits, log in using your Google account. [96]
  2. Select your personal account (not a workspace account) for authentication. [97]
  3. Upon successful sign-in, you will be authorized to start using the tool. [100]

2.3. Handling Usage Limits [103]

  1. If you exceed the free usage limits, you can switch to using your own Gemini API key. [105]
  2. This involves creating a .env file with your Gemini API_key. [107]
  3. Using your own API key will incur charges to your account but removes the usage limits. [108]

2.4. Exploring Gemini CLI Options [112]

  1. Use the forward slash (/) command to access various options within the CLI. [114]
  2. Available options include:
    1. Checking the current version. [115]
    2. Changing the theme (e.g., GitHub light). [116]
    3. Configuring the external editor (e.g., Cursor) for code modifications. [121]
    4. Listing available tools that Gemini provides access to. [128]
  3. The default tools include searching the web, reading folders, searching files, and performing Google searches. [130]
  4. Additional MCP servers can be added later. [132]

3. Real-World Coding Tests [135]

thumbnail

3.1. Test 1: Simple Code Fix [141]

  1. Problem: A scrolling issue where the bottom of a profile page was cut off. [144]
  2. Action: The user described the problem to Gemini CLI, stating, "Hey my profile page... it looks like something is wrong with scrolling and it won't let me see the bottom of the page." [146]
  3. Gemini's Response:
    1. The CLI investigated the issue and identified a potential solution. [151]
    2. It proposed incorporating the change, offering options like "allow once," "allow always," or "modify with an external editor." [153]
  4. Solution: Gemini CLI suggested a simple CSS change to allow for vertical overflow, enabling scrolling. [159]
  5. Implementation: The user chose to modify with an external editor, reviewed the proposed code change, and accepted it. [155]
  6. Outcome: After applying the change, the scrolling issue was resolved, and the page could be scrolled correctly. [190]
  7. Memory Training: The user trained Gemini CLI to only run npm lint for future checks by updating its memory, demonstrating the ability to customize its behavior. [168]

3.2. Test 2: Medium-Sized Feature Implementation [193]

  1. Project Context: The test was conducted on a project called "Shipkit," a template for creating AI projects, specifically a chat application that allows users to swap between different AI models. [197]
  2. Goal: To add a new "Memory" tab to the chat application. This tab should allow users to create, edit, and delete text memories that would be automatically included as context in all AI chats. [206]
  3. Process:
    1. A screenshot of the existing UI was taken and saved. [212]
    2. The user provided a detailed prompt to Gemini CLI, outlining the desired functionality, including CRUD operations for memories, updating the API to include memories in context, and modifying the sidebar and creating a new memory page. [233]
    3. Gemini CLI proposed a multi-stage plan, including creating a memories table, a memories page, and updating the chat API. [255]
    4. The user provided feedback, noting that a "phase zero" to update the database schema was missing. [262]
    5. Gemini CLI incorporated this feedback and generated a detailed task document outlining the implementation steps. [269]
    6. The user instructed Gemini CLI to implement the plan phase by phase. [308]
  4. Implementation and Results:
    1. Gemini CLI made extensive code changes, including database migrations, API updates, and front-end component creation. [319]
    2. It ensured code quality by running lint checks and fixing errors. [321]
    3. The new "Memory" tab was successfully added to the sidebar. [342]
    4. A new "Add Memory" button allowed users to input text memories. [344]
    5. A test memory was added: "Make sure every response starts with Gemini CLI reporting for duty." [348]
    6. When a new chat query was made ("Exclamation mark, please tell me in one sentence who is Elon Musk"), the AI's response included the added memory. [353]
  5. Conclusion: This medium-to-large feature implementation, which would normally take hours, was completed in minutes, demonstrating Gemini CLI's power with existing code and context. [358]

3.3. Test 3: Creating a New Project from Scratch [363]

  1. Goal: To test Gemini CLI's ability to create a brand new project from scratch. [364]
  2. Setup: An empty folder was prepared with environment variables for Gemini API keys, as free credits had been exhausted during testing. The cost for continued use was noted as very affordable (three pennies). [366]
  3. Initial Prompt: The user requested a "beautiful and modern" landing page using Next.js, instructing Gemini CLI to research the YouTube creator "AI with Brandon" (the video's creator) and build the landing page based on that research. [375]
  4. Gemini's Initial Actions:
    1. The CLI began by clarifying the approach and researching "AI with Brandon." [383]
    2. It then started planning content and identifying the target audience. [389]
    3. It proposed a plan including a hero section, about section, "what you'll learn," and feature videos. [397]
  5. Challenges Encountered:
    1. Gemini CLI struggled with interactive wizards, such as the Next.js project creation prompt that required multiple questions. [404]
    2. The user had to manually run the create-next-app command to bypass this issue. [409]
    3. After the project was created, Gemini CLI was instructed to update the project based on the plan. [430]
  6. Underwhelming Results: The initial output for the new project was described as "pretty underwhelming." Despite instructions to make the website "beautiful and modern," the results were not visually appealing, although some animations were present. [440]
  7. Second Attempt with Feedback:
    1. A screenshot of the current landing page was provided to Gemini CLI. [445]
    2. The user gave more specific instructions: "You need to be a professional UI and UX developer and completely redo the landing page... Do not stop until the website is absolutely beautiful." [448]
    3. Gemini CLI acknowledged the feedback and planned to update the global CSS for better colors, typography, and animations. [455]
  8. Final Outcome and Conclusion:
    1. Even after the second attempt, the results were still disappointing. The website had animations but lacked the expected visual appeal and UI polish. [461]
    2. The speaker concluded that Gemini CLI struggles with creating entirely new projects from scratch without significant context or example UIs. [468]
    3. Recommendation: Gemini CLI is highly recommended for adding features and making changes to existing projects where it has context, but not for generating new projects from scratch at this time. [474]