Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Interact with Gemini CLI
/ 25
Use Gemini non-interactive mode
/ 25
Ask Who am I on github?
/ 25
Push changes to a Github repository
/ 25
Vibe coding is an emerging software development practice that uses artificial intelligence (AI) to generate functional code from natural language prompts, accelerating development, and making app building more accessible, especially for those with limited programming experience.
The term, coined by AI researcher Andrej Karpathy in early 2025, describes a workflow where the primary role shifts from writing code line-by-line to guiding an AI assistant such as Gemini CLI to generate, refine, and debug an application through a more conversational process. This frees you up to think about the big picture, or the main goal of your app, while the AI handles writing the actual code.
Gemini CLI is an open-source AI agent that brings the power of Gemini directly into your terminal. The Gemini CLI project is open source and you can view the public roadmap to learn more about functionality enhancements, upcoming features, and bug fixes.
In this lab, you learn how to perform the following tasks:
This lab can be run entirely within Google Cloud Shell, which comes pre-installed with Gemini CLI.
This lab is designed for users and developers of all levels (including beginners).
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud, in Google Cloud, refer to the gcloud CLI overview guide.
To support scoring for some of the tasks in this lab, you need to enable Cloud Logging on Gemini CLI.
The Gemini CLI's behavior is controlled by configuration files and environment variables. There are two key files:
.gemini/settings.json: This file controls the configuration of the CLI including how to connect to external tools.
GEMINI.md: This file provides natural language guidelines and context to the model. The CLI reads this file to understand your project's coding standards and conventions.
When you use Cloud Shell to run Gemini, a default theme for Gemini CLI and the authentication method is already selected and configured for you.
The file that Gemini CLI uses to "remember" your preferences is called settings.json and you can also use it to customize Gemini CLI.
In Cloud Shell, this file is located in the following directory:
~/.gemini/settings.json.
While you can configure some of Gemini CLI's behavior through the settings.json file located in the ~/.gemini/ directory, another file you can use to configure Gemini CLI's behavior is GEMINI.md.
The GEMINI.md file is the context file (defaulting to GEMINI.md but configurable via the contextFileName property in settings.json file) that is crucial for configuring the instructional context (also referred to as "memory") provided to the Gemini model.
This file allows you to give project-specific instructions, coding style guides, or any relevant background information to the AI, making its responses more tailored and accurate to your needs.
The GEMINI.md file is in Markdown format.
What does a GEMINI.md file contain? Here is the content from an example produced based on the official Gemini CLI documentation.
Sample GEMINI.md file:
You may notice that the sample GEMINI.md file provides some general instructions plus specific instructions for coding style, dependency management and more. In a similar manner, you could write your own guidelines based on your programming language, framework, coding style, and other project-specific preferences.
The GEMINI.md file is the key to making Gemini CLI follow your preferences. For more information, you can refer to the Practical Gemini CLI series, which dives deeper into how you can auto-generate such a file for your project, customize the System Prompt, and more.
Before you get started in Gemini CLI, you need to create a folder to use as your home folder for all the projects that you may create inside of it. This is a starting point for the Gemini CLI to work with, although it may reference some other folders on your system, as needed.
gemini-cli-projects, and navigate to it:.gemini subdirectory that contains a settings.json configuration file:In Cloud Shell, Gemini CLI is pre-installed.
In this task, you interact with Gemini CLI.
Run the following command to launch Gemini CLI and start a new session:
Copy and paste the following and then press ENTER to prompt Gemini CLI with your first query:
The expected response is as follows.
Output:
You may notice that your query resulted in a GoogleSearch tool (a built-in tool in Gemini CLI) that gets invoked. You learn more about built-in tools later in this lab.
Click Check my progress to verify the objective.
/help (forward slash) to receive a variety of commands and keyboard shortcuts as follows:The /help command is one example of a so-called slash command. To learn more about these built-in Gemini CLI commands, refer to the Slash Commands (/) documentation.
Gemini CLI comes with a set of built-in tools, which the Gemini model uses to interact with your local environment, access information, and perform actions. These tools enhance the CLI's capabilities, enabling it to go beyond text generation and assist with a wide range of tasks.
For more detail, refer to the tools documentation.
/tools command:
Sample output:
Can Gemini CLI simply call these tools, when it wants to? The simple answer is no. By default, the model always asks for permission when it comes to sensitive operations that might involve writing to the local system, reading from an external system, going to the external network, and so on.
While there is a --yolomode available when you start the CLI (not typically recommended), you may find that Gemini CLI prompts you for permission to run the tool that it has chosen. You can refuse permission, let it run once, or give it blanket permission to always run. You are and should be in full control of things.
In this section, you give Gemini CLI a prompt to make Gemini choose and execute one of its built-in tools for you to gain a better understanding of how it all works.
Say you want to get information on the latest financial news across the world and save that into a file in the local working directory from where you launched Gemini CLI.
The first thing Gemini does is to invoke the GoogleSearch tool to search the web.
Once the search is complete, Gemini retrieves the data and Gemini CLI returns the following:
Once that is done, Gemini is ready to write this to the file and it uses the WriteFile tool, but since that is a sensitive operation (write), it asks for your permission. You can decide the permission type i.e. allow once, allow always, etc.
This then writes the information to the file and a success message is shown as follows.
Expected output:
To check if a file is written or not, you can use the @file to ask it to read the content. As you type @, it displays a list of files in the current folder, including the file it has just created.
/model command in the Gemini CLI.While Gemini is running, you can verify the model that's running at the bottom right of the Gemini CLI terminal as in the following screenshot:
An interesting option is to run Gemini CLI in a non-interactive mode. This means that you directly provide it the prompt and it goes ahead and responds to it, without the Gemini CLI interactive terminal opening up. This is useful if you use Gemini CLI in an automated fashion as part of a script or any other automation process.
Quit the session (press CTRL+D or CTRL+C twice, or issue the /quit prompt).
In Cloud Shell, run the following command with the -p parameter:
Do keep in mind that in non-interactive mode, there is no scope to continue the conversation with follow-up questions. This mode also does not allow you to authorize tools (including WriteFile) or to run shell commands.
Click Check my progress to verify the objective.
It's also possible to work directly with the shell from within Gemini CLI.
! in the prompt box. This toggles to shell mode.When in shell mode, you see the ! at the start of the prompt as shown in the following:
When in shell mode, you can use standard commands like pwd, cat, and ls, for example.
Now try printing the contents of a file via the cat command.
Example output:
! again or press the ESC key to exit shell mode.An MCP server is an application that exposes tools and resources to the Gemini CLI through MCP, allowing it to interact with external systems and data sources. MCP servers act as a bridge between the Gemini model and your local environment or other services like APIs.
An MCP server enables the Gemini CLI to discover and execute tools thereby extending Gemini CLI's capabilities to perform actions beyond its built-in features, such as interacting with databases, APIs, custom scripts, or specialized workflows.
Gemini CLI supports configuring MCP servers for discovering and using custom tools.
/mcp command as follows:If you have not configured any MCP servers, it launches Gemini CLI's MCP server documentation.
You can configure MCP servers at the global level in the ~/.gemini/settings.json file or in your project's root directory.
If you have Gemini CLI running, you can quit the session by pressing CTRL+D or CTRL+C twice.
.gemini subdirectory is hidden by default, select View > Toggle hidden files to show hidden files and directories..gemini/settings.json file within your project-specific folder, gemini-cli-projects.Within the ~/.gemini/settings.json file, you need to configure the mcpServers configuration block. It takes the following syntax:
You configure this file to support an MCP server in the next task.
Each server configuration supports the following properties, as per the Reference documentation:
The GitHub official MCP server provides sufficient documentation on the tools that it exposes and how to configure those tools. Since Gemini CLI supports remote MCP servers, you can run local or remote MCP servers.
In this section, you set up a Remote MCP server in GitHub. For this, you must first have a Personal Access Token (PAT) from GitHub.
Then, you need to add the MCP server object in the settings.json file to point to the GitHub MCP server configuration.
In this section, you create your classic GitHub PAT, set the token lifetime to never expire, and allow it all available permissions.
For more detail, refer to the Creating a personal access token (classic) GitHub documentation to create your own PAT.
Run the following command in Cloud Shell to open the settings.json file in the Cloud Shell Editor:
Edit the settings.json file (yours should currently resemble the following example):
Now insert your PAT to replace the [placeholder] after "Bearer " and insert this JSON after the first brace at the top of the file:
You might have additional settings in settings.json, but the final result should be formatted similar to the following:
settings.json file loaded at startup, which activates the configured GitHub MCP server:/mcp prompt.The screenshot below highlights the GitHub MCP server that is configured on a machine and the various tools that are now available to the Gemini CLI to work with MCP.
Sample output:
Next, you issue a prompt to invoke one of the tools from the GitHub MCP server.
Expected output:
Notice that it picks the correct tool from the GitHub MCP server but as with other built-in tools, this also requires that you provide explicit permission to invoke the tool.
Click Check my progress to verify the objective.
Now that you configured the GitHub MCP server, you could give your queries in natural language to work with one of your GitHub projects. For example:
Here is an additional list of MCP servers that you might be interested in:
Set up instructions for these MCP servers are published in this blog post.
In this task, you use Gemini CLI to vibe code a website. You ask Gemini CLI to generate the structure of the website and set it up.
Gemini CLI proceeds to go through a series of actions at this point.
The next few prompts and responses are a sample flow that was observed. You might get a completely different response.
You need to interact back-and-forth with Gemini CLI, as needed.
At times, Gemini CLI may suggest a command that it would like to execute. For the purposes of this lab, you should exert control over the task.
If the model offers to run a command, you can simply press ESC to escape out and redirect its approach with a message such as the following:
On following the instructions to start the server and navigate to the home page, you get a sample site as shown (you should see a variant of a similar site if you used the same prompt):
Feel free to make more changes with the help of Gemini CLI.
Now that you are satisfied with the website, in this section you use the remote GitHub MCP server to push your changes to a GitHub repository that you create.
First up, you create a .gitignore file with the help of Gemini CLI.
Next, you give instructions to Gemini CLI to push this repository under the GitHub account (this should exercise the GitHub MCP server tools in the background).
This causes Gemini CLI to run a number of commands to perform the following:
If all goes well, you should have a GitHub repository in place. A sample screenshot is as follows:
Well done! You have created a website with the help of Gemini CLI and pushed changes to a GitHub repository that you created.
README.md file for the project in this lab, but doing so would be recommended in a real-life production environment. If you'd like, you can ask Gemini CLI to do so for you.Click Check my progress to verify the objective.
Congratulations, you've successfully explored Gemini CLI, its capabilities, and applied it to a use case.
Manual Last Updated February 18, 2026
Lab Last Tested December 22, 2025
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one