Gemini CLI Tutorial #10 - Using the Nanobanana Extension

The Net Ninja · Beginner ·🧠 Large Language Models ·6mo ago

Key Takeaways

This video tutorial covers the installation and use of the Nanobanana extension in the Gemini CLI, including setting up an API key and generating images using the extension's custom commands.

Full Transcript

Okay then gang. In this lesson we're going to be adding another extension to the Gemini CLI and that is the Google Nano Banana one which allows us to essentially use the Nano Banana models to generate images using some added commands. So I've already searched for the Nano Banana um extension on this page and it's this one that we want to install right here. If we click on that we can see the install command which I'm going to copy and then we can head back to VS Code to install it. So then I've got a terminal open here to install the extension from because we don't need to do it from within only our project in VS Code. The extension gets added globally to Gemini on the computer inside this dogeemini folder that I've already got open. And in fact, I'm just going to head into the extensions folder as well. So we can see over here when it does get added. All right. So now let me come to the terminal, paste in the command, and then hit enter. And then after a moment we should see the new nano banana extension folder added over here. Okay then. So now we can start using that extension and the commands it provides to generate images for this project. Now before we go any further I want to mention that you will need an API key to use this nano banana extension and it does cost money to use it. I think it works out that every image generated costs somewhere between about 15 and0 cents depending on the quality of the image. Now the process of creating an API key is exactly the same as before when we created one in the Google AI studio for authenticating in the Gemini CLI. And in fact, if you want, you can use the same API key for this, which is what I'm going to do. Now, if you've not watched that earlier lesson where we made an API key, then definitely go and check that out. First of all, I think it was lesson six in this series. Then we need to take that API key and add it to thev file so that nano banana can use it. So let's open thev file and make a new variable called nano banana all in uppercase gemini_appi_key and nanoanana will automatically use this environment variable when we send a request to generate an image. Anyway, I'm going to paste in my API key now and also save the file. And although I'm showing you my key, I would advise you not to make your own key public in any way because then other people can use it. So I'll be deleting mine after recording this course. So now we've installed the Nano Banana extension which includes a global MCP server setup and some custom commands that we can use in the CLI and we've also set up the API key as well for it to use. Now let's spin up a new instance of Gemini in the terminal and start using it. So then if we type a forward slash into the chat import then we can key up to see all the new nanobanana commands which have been added like the diagram one to generate a diagram the edit one to edit images uh the generate one to generate images the icon one to make icons and so forth and we can use any of these now to make an image and we can also manually add context to the commands as well. So, let's give this a whirl. I want Nano Banana to generate some images for the combo cards on the homepage. And if we open that homepage up and scroll down, we'll eventually reach those combo cards, which I'm going to select to add them to the context automatically. Then, in the chat, I'm going to use the generate command to generate some images. And after that, I'm going to paste in the following prompt. I need three images for the food combinations on the homepage. One for cheese and marmite, one for crisps and chocolate, and one for strawberries and pepper. So then I'm going to hit enter and see what happens. Okay. And like always, it's asking us for permission before it uses this MCP tool called generate image. I'm going to go to option two and say always allow this. All right. So now it's finished and it said it's put all the images inside this nano banana output directory. So let's take a look at that. I'm going to close this off and open up the file explorer and we can see this folder with three images. So this first one is mama and cheese. Looks pretty good. The second one is chocolate and crisps. That also looks good. By the way, if you've never had this combo, chocolate with salt and vinegar crisps, uh definitely try it. Love it. Third one is the strawberries with pepper. All right, so it's generated all those images for us. Awesome. So, I'm actually now going to ask it to use those images in this file right here for these combo cards. So, let me open up the um chat again. And by the way, we get this error. MCP error context 7. This is something I've been experiencing over the last week or so with the uh context 7 MCP server. If you restart your chat, it does go away. Anyway, I'm not going to do that. Instead, I'm going to say, "Can you add the three new images to the combo cards on the homepage?" All right, then. Let's see what it does. Let's press enter. All right. And it looks like it's added all those. So, I'm not going to browse the code. I can see that right here we've got an image URL. It also created some images inside one of these folders over here. I think it's in the public one. So, it moved them into the public directory. So, now I'm just going to jump straight to the browser so we can preview this. All right. So, moment of truth. Let's scroll down. All right. There we go. Cool. Looks pretty good. All right then, my friends. So, that's pretty much the end of this series. I hope you have learned a fair amount about the Gemini CLI and I would strongly recommend trying it out if you're open to using coding agents in your workflow. But again, like I say in a lot of my videos, be very careful about relying on AI too much when it comes to coding or anything else for that matter. I think if you rely on it too much, it's going to hamper your skill development in every single area of life. Coding, writing, design, or whatever else. Also, in the case of coding, AI is not a silver bullet. It can't solve every problem and it can make mistakes. So, it is important to stay in the loop at all stages of development in my experience and guide the AI correctly, dive it into the weeds when you need to. Anyway, if you want to see more of this tool on my channel, please let me know in the comments. And if you enjoy the videos, don't forget to share, subscribe, and like. That really helps out a lot. And I'm going to see you all in the very next series. And just one more thing before I leave, I wanted to let you know you can access my entire library of nearly 200 courses at netinja.dev. And included in that library are a load of longer masterclass courses and other pro exclusive tutorials not found anywhere else. And I'm frequently adding to them as well. So you can access them all by signing up for a Net Ninja Pro membership which is just $9 a month. And you'll get your first month half price using this promo code right here. Also by signing up to the site, you'll get access to the community boards which has support for all the Net Ninja courses, too. So I'll leave a link to the signup page down below the video and hopefully I'll see you all there. Heat. Heat. N. Hey, hey,

Original Description

In this Gemini CLI Crash Course series, I'll show you how to get up an running wth the CLI in a project, use extensions & MCP servers, add an API key to access Gemini 3 models and more. 🍿👇 Get early access to the course on NetNinja.dev: https://netninja.dev/p/gemini-cli-tutorial 🔥👇 Get access to premium courses with Net Ninja Pro: https://netninja.dev/p/net-ninja-pro/#prosignup 🔥👇 Git & GitHub Masterclass: https://netninja.dev/p/git-github-masterclass 🔗👇 Starter Project on GitHub: https://github.com/iamshaunjp/gemini-cli-course 🔗👇 Gemini CLI docs: https://geminicli.com/docs/ 🔗👇 Gemini CLI Extensions: https://geminicli.com/extensions/ 🔗👇 Context7 https://context7.com/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Net Ninja · Net Ninja · 0 of 60

← Previous Next →
1 Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
2 Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
3 Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
4 GraphQL Tutorial #1 - Introduction to GraphQL
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
5 GraphQL Tutorial #2 - A Birdseye View of GraphQL
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
6 GraphQL Tutorial #3 - Project (stack) Overview
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
7 GraphQL Tutorial #4 - Making Queries (front-end preview)
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
8 GraphQL Tutorial #5 - Express App Setup
GraphQL Tutorial #5 - Express App Setup
Net Ninja
9 GraphQL Tutorial #6 - Setting up GraphQL
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
10 GraphQL Tutorial #7 - GraphQL Schema
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
11 GraphQL Tutorial #8 - Root Query
GraphQL Tutorial #8 - Root Query
Net Ninja
12 GraphQL Tutorial #9 - The Resolve Function
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
13 GraphQL Tutorial #10 - Testing Queries in Graphiql
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
14 GraphQL Tutorial #11 - GraphQL ID Type
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
15 GraphQL Tutorial #12 - Author Type
GraphQL Tutorial #12 - Author Type
Net Ninja
16 GraphQL Tutorial #13 - Type Relations
GraphQL Tutorial #13 - Type Relations
Net Ninja
17 GraphQL Tutorial #14 - GraphQL Lists
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
18 GraphQL Tutorial #15 - More on Root Queries
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
19 GraphQL Tutorial #16 - Connecting to mLab
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
20 GraphQL Tutorial #17 - Mongoose Models
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
21 GraphQL Tutorial #18 - Mutations
GraphQL Tutorial #18 - Mutations
Net Ninja
22 GraphQL Tutorial #19 - More on Mutations
GraphQL Tutorial #19 - More on Mutations
Net Ninja
23 GraphQL Tutorial #20 - Updating the Resolve Functions
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
24 GraphQL Tutorial #21 - GraphQL NonNull
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
25 GraphQL Tutorial #22 - Adding a Front-end
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
26 GraphQL Tutorial #23 - Create React App
GraphQL Tutorial #23 - Create React App
Net Ninja
27 GraphQL Tutorial #24 - Book List Component
GraphQL Tutorial #24 - Book List Component
Net Ninja
28 GraphQL Tutorial #25 - Apollo Client Setup
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
29 GraphQL Tutorial #26 - Making Queries from React
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
30 GraphQL Tutorial #27 - Rendering Data in a Component
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
31 GraphQL Tutorial #28 - Add Book Component
GraphQL Tutorial #28 - Add Book Component
Net Ninja
32 GraphQL Tutorial #29 - External Query File
GraphQL Tutorial #29 - External Query File
Net Ninja
33 GraphQL Tutorial #30 - Updating Component State
GraphQL Tutorial #30 - Updating Component State
Net Ninja
34 GraphQL Tutorial #31 - Composing Queries
GraphQL Tutorial #31 - Composing Queries
Net Ninja
35 GraphQL Tutorial #32 - query variables
GraphQL Tutorial #32 - query variables
Net Ninja
36 GraphQL Tutorial #33 - Re-fetching Queries
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
37 GraphQL Tutorial #34 - Book Details Component
GraphQL Tutorial #34 - Book Details Component
Net Ninja
38 GraphQL Tutorial #36 - Styling the App
GraphQL Tutorial #36 - Styling the App
Net Ninja
39 GraphQL Tutorial #35 - Making a Single Query
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
40 Build Apps with Vue & Firebase - Udemy Course
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
41 Updated Vue & Firebase Course (Udemy)
Updated Vue & Firebase Course (Udemy)
Net Ninja
42 Vue & Firebase Real-time Chat (Preview) #1 - Intro
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
43 Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
44 Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
45 Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
46 Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
47 Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
48 Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
49 Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
50 Object Oriented JavaScript Tutorial #1 - Introduction
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
51 Object Oriented JavaScript Tutorial #2 - Object Literals
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
52 Object Oriented JavaScript Tutorial #3 - Updating Properties
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
53 Object Oriented JavaScript Tutorial #4 - Classes
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
54 Object Oriented JavaScript Tutorial #5  - Class Constructors
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
55 Object Oriented JavaScript Tutorial #6 - Class Methods
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
56 Object Oriented JavaScript Tutorial #7 - Method Chaining
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
57 Object Oriented JavaScript Tutorial #8 - Class Inheritance
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
58 Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
59 Object Oriented JavaScript Tutorial #10 - Prototype
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
60 Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja

This tutorial shows how to install and use the Nanobanana extension in the Gemini CLI to generate images using AI models. It covers setting up an API key, using custom commands, and troubleshooting common issues.

Key Takeaways
  1. Install the Nanobanana extension using the provided command
  2. Set up an API key in the Google AI studio
  3. Add the API key to the Gemini CLI configuration file
  4. Use the custom commands provided by the Nanobanana extension to generate images
  5. Troubleshoot common issues such as MCP server errors
💡 The Nanobanana extension provides a powerful tool for generating images using AI models, but requires careful setup and configuration to use effectively.

Related Reads

📰
I Taught an AI to Recognize the Shadows of Four-Dimensional Objects
Learn how a neural network was trained to recognize the shadows of four-dimensional objects, expanding our understanding of higher-dimensional geometry
Medium · Data Science
📰
Changes to LLM pricing: Novita, OpenInference and StreamLake
Learn about recent changes to LLM pricing for Novita, OpenInference, and StreamLake, and how to apply this knowledge to inform your AI strategy
Dev.to AI
📰
ChatGPT in 2026: Why It’s Still the Most Searched AI Tool on Google (And How to Master It)
Master ChatGPT in 2026 by understanding its top use cases, pro tips, and SEO impact to stay ahead in AI search trends
Medium · ChatGPT
📰
A Tiny LLM Request Recorder I Use to Reproduce Production Failures
Learn to build a tiny LLM request recorder to reproduce production failures and improve model reliability
Dev.to AI
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →