![Bild[1]-So erstellen und implementieren Sie einen KI-Agenten mit Gemini CLI und Google ADK: A For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
Step-by-step guide to Vibe coding
A simplified, practical guide through Google’s Codelab Agentverse: The Shadowblade’s Codex, focusing on the build itself.
đ All commands from this tutorial in one quick reference file: github.com/estherirawati/agentverse
Google’s Agentverse Codelab wraps everything up in a fun fantasy theme. You are a âShadowbladeâ, your terminal is your âprimary weaponâ and you are fighting an entropy monster called âShadowbladeâ. The statics. The story is a great hook, and this tutorial keeps a light touch of it while focusing on it what you build and howso you can follow along step by step.
On topic, this is a really good tour of the modern AI agent workflow in Google Cloud: bringing code into existence using the Gemini CLI, connecting the CLI to external tools, building a true autonomous agent using the Agent Development Kit (ADK), testing it, and sending it to Cloud Run.
This is what the journey actually looks like.
What you really build
In the end you have:
- A working command-line AI assistant (Gemini-CLI), who can read your intention and act accordingly
- A personal website built almost entirely from a single command prompt
- The CLI to connect to external tools via MCP server (a self-hosted Git server and an image generator)
- A real one autonomous agent Developed with ADK, which selects the right âweaponâ tool for each task
- A automated test suite for this agent
- The agent used to Cloud Run as a live service
The fantasy theme maps neatly onto real-world technical ideas, and Codelab makes this clear in its âfor non-gamersâ sidebars. I will translate over time.
Schritt 0: Aufstellen (the necessary part)
You need one personal Gmail account â Corporate or school accounts will not work due to the credit being granted.
- Claim your free Google Cloud credit via the workshop link, log in and accept the terms.
- Open Cloud Shellat console.cloud.google.comand then click Open Notepad.
- Clone the starter code and run the setup script:
git clone https://github.com/weimeilin79/agentverse-developer.git
chmod +x ~/agentverse-developer/*.sh
cd ~/agentverse-developer
./init.sh # press Enter to accept the default Project ID
- Point your configuration at the new project and enable the APIs you need:
gcloud config set project $(cat ~/project_id.txt) --ruhig
gcloud services enable compute.googleapis.com artifactregistry.googleapis.com \
run.googleapis.com cloudbuild.googleapis.com aiplatform.googleapis.com \
iam.googleapis.com cloudresourcemanager.googleapis.com
npm update -g @google/gemini-cli
That’s the whole basis. Now the interesting part.
Schritt 1: Get to know your âweaponâ â Gemini CLI
Gemini CLI is an open source AI agent that runs in your terminal. It’s running a Reason and Act loop (ReAct).: It reads your high-level request, breaks it down into steps, selects the right tool, runs it, and checks the result.
Launch it from a new folder:
cd ~/agentverse-developer
mkdir playground
cd playground
gemini # choose "No" when it asks to connect the Cloud Shell editor
Execute a few commands that are worth knowing inside the CLI â /help lists commands, /tools shows built-in capabilities (ReadFile, WriteFile, GoogleSearchâŠ), Die ! Prefix executes a normal shell command and /memorystores context:
/help
/tools
!ls -l
/memory add "My name is [your name]. I'm learning about AI agents."
/memory show
This /memory function is your first taste Context engineering â consciously feed the AI ââbackground so that its output remains relevant.
Now the headline trick â generate code from a sentence:
Write a Python script called hello.py that prints "I built my first
AI-generated file" and the current date.
Then check if it actually worked:
!ls
!cat hello.py
!python3 hello.py
Terminate at any time Ctrl+C twice. Thatâs it â you just âvibe codedâ.
What âVibe Codingâ really means:Instead of writing each line by hand, you describe your intent in plain text and let the wizard generate the code and configuration. The industry term is Intention-driven development.
Schritt 2: Create a real website and then connect external tools
Same idea, greater demand. Within the CLI:
Create a personal profile website in the current folder. Dark theme,
electric blue accents. Two files: index.html and styles.css. Use flexbox
for a two-column layout. Include a placeholder spot for a profile picture.
Make the code clean and commented. Don't start any server.
Exit the CLI and preview:
python -m http.server
# Cloud Shell â Web Preview â port 8000, then Ctrl+C to stop
Give hands to the CLI: MCP Server
So far only Gemini CLI speak and edit local files. To make it perform real actions in other systems – Git, Datenbanken, APIs – connect a Model Context Protocol (MCP) server . Think of it as a power cable between the âbrainâ of the AI ââand the âbodyâ of a tool.
The code lab is running Gitea a self-hosted Git server, as the first tool:
cd ~/agentverse-developer
./gitea.sh
# Web Preview â port 3005 â log in with dev / dev
Then register it in Gemini’s configuration so the CLI can see it:
Wenn [ ! -f ~/.gemini/settings.json ]; then
echo '{"mcpServers":{"gitea":{"url":"http://localhost:8085/sse"}}}' > ~/.gemini/settings.json
else
jq '. * {"mcpServers":{"gitea":{"url":"http://localhost:8085/sse"}}}' ~/.gemini/settings.json > ~/.gemini/settings.json.tmp && mv ~/.gemini/settings.json.tmp ~/.gemini/settings.json
fi
Restart the CLI from your project folder and confirm Gitea is wired:
cd ~/agentverse-developer/playground
gemini
/mcp With Gitea visible, you can now do version control in plain English:
Create a new Gitea repository named 'my-profile' with description
'My first AI-built website'. Don't add any content yet.
Using the Gitea tool, push index.html and styles.css to the
'my-profile' repository.
File an issue in the my-profile repo titled "Profile image is missing".
Use the Gitea tool and the 'dev' user account.
Close issue #1 in the my-profile repo. Use the 'dev' user account.
This is the leap that Codelab really demonstrates: AI stops being a chatbot and becomes one active participant in your workflowâ Creating repos, pushing commits, submitting and closing issues.
Extensions vs. raw MCP: Manually editing Settings.json is that "raw" Way â useful for understanding plumbing. In real life you would normally install one extension (gemini extensions install …), which bundles the MCP server, custom slash commands and context into one installable package. Codelab later uses this approach for an image generation extension called Nano Banana.
Schritt 3: Create the actual agent using ADK
This is the heart of the laboratory. You go from âAI helps me write codeâ to âIâm building an AI thing that runs on its own.â The framework comes from Google Agent Development Kit (ADK) .
Erste, set the rules
Before you generate agent code, write a GEMINI.md file. The CLI loads it automatically and treats it as persistent project-level instructions – coding standards, naming conventions, a persona, hard constraints:
cd ~/agentverse-developer/shadowblade
. ~/agentverse-developer/set_env.sh
cat << 'EOF' > GEMINI.md
### Coding Rules for This Project
- Use Python 3 with type hints on every function.
- Every function needs a docstring explaining what it does.
- Use snake_case for variables and functions, PascalCase for classes.
- Keep code clean and readable.
EOF
That is Context engineering Layer two. It’s worth remembering the hierarchy:
- ~/.gemini/settings.jsonâ global user settings
- GEMINI.md â Project rules, always loaded
- Agent skills(.gemini/skills/) â Expertise loaded only if relevant
This third layer (progressive disclosure) keeps the agent fast: a repo can contain dozens of niche skills, but the AI ââwill only retrieve the one that matches the task at hand.
The agent himself
The Codelab lets you generate agent.py from a design document and then – since LLM output is unpredictable – swap out the known good version:
cp ~/agentverse-developer/working_code/agent.py ~/agentverse-developer/shadowblade/
cp ~/agentverse-developer/working_code/mcp_server.py ~/agentverse-developer/shadowblade/
At its core, the agent is a LlmAgent with a model, a clear instruction block and a list of tools linked via an MCPToolset. The "Weapons" It can only execute Python functions in mcp_server.py decorated with @mcp.tool() – each of which is a small, focused tool with a descriptive document string that the model reads to decide when to use it.
Run it
cd ~/agentverse-developer
python -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -r shadowblade/requirements.txt
adk run shadowblade
Then give him a command. The agent reads the âweakness of the monster,â selects the appropriate tool, and reports the result:
We're stuck against 'Perfectionism'. Its weakness is 'Elegant
Sufficiency'. Break us out!
'Dogma' blocks our path. Its weakness is 'Revolutionary Rewrite'. Take it down.
Remove the topic and that’s exactly how a real support or operations agent works: read the situation, select the right internal tool, run it and summarize.
Schritt 4: Test it (because an untested agent is a risk)
Agents are more difficult to test than scripts because of their behavior arises from the multi-stage argumentation of an LLM. They care about two things: Did it produce the correct final answer? UndDid it take the right path (use the right tools)?
ADK offers you two complementary methods:
adk evalruns the agent for a set of predefined cases in a JSON "evalset." Each case defines the input, the expected response and â crucially â the expected tool uses. A neat trick the lab teaches here is synthetic test data: You hand the AI ââa template case and ask it to generate dozens of different templates, cost-effectively scaling your test coverage.
pytestwraps the same AgentEvaluator in code, making it CI-ready:
cp ~/agentverse-developer/working_code/test_agent_initiative.py ~/agentverse-developer/shadowblade/
source ~/agentverse-developer/env/bin/activate
cd ~/agentverse-developer
. ~/agentverse-developer/set_env.sh
pytest test_agent_initiative.py
A pass run (1 pass) means the agent is following its protocol and is ready to enter an automated pipeline. The evaluation criteria were neatly divided into âtool_trajectory_avg_scoreâ (I did it). Do the right thing) and Response_match_score (did it say the right thing).
The laboratory also presents Hookâ Scripts that fire at specific points in the agent loop (BeforeTool, AfterTool, usw.), allowing you to validate, check, or block actions during a run without touching the agent’s code. Ideal for security and compliance gates.
Schritt 5: Deploy to Cloud Run and then clean up
Create a container image and deliver it as a live autoscaling service:
. ~/agentverse-developer/set_env.sh # create the artifact repo (ignore error if it already exists)
gcloud artifacts repositories create $REPO_NAME \
--repository-format=docker \
--location=$REGION \
--description="Agent repo" 2>/dev/null || echo "Already exists, moving on"
# grant the service account the roles it needs
for ROLE in artifactregistry.admin cloudbuild.builds.editor run.admin \
iam.serviceAccountUser aiplatform.user logging.logWriter logging.viewer; Tun
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:$SERVICE_ACCOUNT_NAME" \
--role="roles/$ROLE" --ruhig
Erledigt
# prep the Dockerfile, then build and deploy
sed -i 's|COPY ./shadowblade|COPY .|g' ~/agentverse-developer/shadowblade/Dockerfile
sed -i 's|COPY shadowblade|COPY .|g' ~/agentverse-developer/shadowblade/Dockerfile
cd ~/agentverse-developer
gcloud builds submit ./shadowblade \
--tag ${REGION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/my-agent:letzte
gcloud run deploy my-agent \
--image=${REGION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/my-agent:letzte \
--region=${REGION} \
--erlauben-nicht authentifiziert \
--set-env-vars="A2A_HOST=0.0.0.0,A2A_PORT=8080,GOOGLE_GENAI_USE_VERTEXAI=TRUE" \
--min-instances=1 \
--project=${PROJECT_ID}
Visit your service URL with /.well-known/agent-card.json appended to confirm that the agent is active and describes itself:
https://my-agent-xxxxx-uc.a.run.app/.well-known/agent-card.json Don’t skip cleaning upâ This is what stops a free credit project from silently billing you:
. ~/agentverse-developer/set_env.sh
gcloud run services delete my-agent --region=${REGION} --ruhig
gcloud artifacts repositories delete ${REPO_NAME} --location=${REGION} --ruhig
rm -rf ~/agentverse-developer ~/.gemini
rm -f ~/project_id.txt
The five ideas worth keeping
Off topic, here’s what this codelab actually teaches:
- Intention-driven developmentâ Describe the result and then let the AI ââgenerate the code verify Es. Verification habit is as important as generation.
- MCP servers transform a chatbot into a doerâ Once the CLI can touch Git, a database or an API, it becomes part of your real workflow.
- Context engineering is multi-layeredâ global settings, persistent project rules (GEMINI.md) and on-demand capabilities. Good context is better than clever one-off prompts.
- Agents need real testingâ Both of you evaluate the final answer Und the chosen path. Synthetic data allows you to cost-effectively scale these tests.
- Ship it like softwareâ Containerize, set IAM roles, deploy to Cloud Run, and shut it down when you’re done.
The story makes it unforgettable; The workflow makes it useful. Both are worth keeping.
Do you want to go through it yourself? The full codelab is Agentverse: The Shadowblade’s Codex on Google Codelabs, and the starter code is at github.com/weimeilin79/agentverse-developer. I’ve also collected every command from this tutorial into a quick reference file on my own GitHub: github.com/estherirawati/agentverse.
![]()
So erstellen und implementieren Sie einen KI-Agenten mit Gemini CLI und Google ADK: A was originally published in Google Developer Experts on Medium, wo die Leute das GesprÀch fortsetzen, indem sie diese Geschichte hervorheben und darauf reagieren.
