Copied to Clipboard
Testing the Gemini CLI Environment
Once you have all the tools and the correct Node.js version in place- you can test the startup of Gemini CLI. You will need to authenticate with a Key or your Google Account:
gemini
Authentication
Several authentication options are available. To use an existing Code Assist licence — authenticate with a Google Account:
> /auth
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ ? Get started │
│ │
│ How would you like to authenticate for this project? │
│ │
│ ●くろまる 1. Login with Google │
│ 2. Use Gemini API Key │
│ 3. Vertex AI │
│ │
│ (Use Enter to select) │
│ │
│ Terms of Services and Privacy Notice for Gemini CLI │
│ │
│ https://geminicli.com/docs/resources/tos-privacy/ │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Then set the GOOGLE_CLOUD_PROJECT to a valid project setup on the Google Cloud console:
~ $ export GOOGLE_CLOUD_PROJECT=comglitn
~ $
Other options include Google Cloud API Key that can be generated directly from the Google Cloud Console.
Using Gemini CLI on Azure Cloud Shell
Once installed- Gemini CLI has direct access to the Cloud Shell environment:
Logged in with Google: xbill@glitnir.com /auth
Plan: Gemini Code Assist Standard
✦ Your Azure project information is as follows:
- Subscription Name: Azure subscription 1
- Subscription ID: 3db3ce66-50b6-4d11-91ef-5950cf4039ed
- Tenant ID: 40482c55-d00d-4c6d-8903-643d76a74b9c
- Environment: AzureCloud
- User: live.com#xbill@glitnir.com
Active Resource Groups:
- cloud-shell-storage-eastus (eastus)
- NetworkWatcherRG (eastus)
- vm (eastus)
Project Metadata:
- Repository: github.com/xbill9/gemini-cli-azure (https://github.com/xbill9/gemini-cli-azure)
- Google Cloud Project ID: comglitn (from project_id.txt)
and Azure operations can be performed directly from Gemini CLI:
> list azure vms using the az command
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
✦ I'll list your Azure Virtual Machines using the az command.
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell az vm list -d -o table [current working directory /home/william] (List all Azure Virtual Machines in the current subscription with detailed in... │
│ │
│ Name ResourceGroup PowerState PublicIps Fqdns Location │
│ --------- --------------- -------------- ------------- ------- ---------- │
│ azure-new VM VM deallocated 20.124.121.35 eastus │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ You have one Azure Virtual Machine:
- Name: azure-new
- Resource Group: VM
- Power State: VM deallocated
- Public IP: 20.124.121.35
- Location: eastus
Installing Google Cloud Tools
To simplify working with Google Cloud — install the Google Cloud Tools:
https://docs.cloud.google.com/sdk/docs/install-sdk
Once the installation is completed — you can verify the setup:
william@Azure:~$gcloud auth list
Credentialed Accounts
ACTIVE ACCOUNT
* xbill@glitnir.com
To set the active account, run:
$gcloud config set account `ACCOUNT`
william@Azure:~$gcloud config list
[compute]
region = us-west2
zone = us-west2-a
[core]
account = xbill@glitnir.com
disable_usage_reporting = False
project = comglitn
Your active configuration is: [default]
[environment: Development]
william@Azure:~$
Installing Azure Customized GEMINI.md
A sample GitHub repo contains tools for working with Gemini CLI on Azure. This repo is available here:
git clone https://gitHub.com/xbill9/gemini-cli-azure
A sample GEMINI.md customized for the Azure environment is provided in the repo:
This is a multi linux git repo hosted at:
github.com/xbill9/gemini-cli-azure
You are a cross platform developer working with
Microsoft Azure and Google Cloud
You can use the Azure CLI :
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
https://learn.microsoft.com/en-us/cli/azure/
https://learn.microsoft.com/en-us/cli/azure/reference
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?view=azure-cli-latest&pivots=apt
## Azure CLI Tools
You can use the Azure CLI to manage resources across Azure Storage, Virtual Machines, and other services.
- **List Resource Groups** : `az group list -o table`
- **List Storage Accounts** : `az storage account list -o table`
- **List Virtual Machines** : `az vm list -d -o table`
### Azure Update Script
- `azure-update`: This script is specifically for Azure Linux environments. It updates all packages and ensures necessary libraries are installed.
## Automation Scripts
This repository contains scripts for updating various Linux environments and tools:
- `linux-update`: Detects OS (Debian/Ubuntu/Azure Linux) and runs the corresponding update scripts.
- `azure-update`: Updates Azure Linux packages and installs necessary dependencies.
- `debian-update`: Updates Debian/Ubuntu packages and installs `git`.
- `gemini-update`: Updates the `@google/gemini-cli` via npm and checks versions of Node.js and Gemini.
- `nvm-update`: Installs NVM (Node Version Manager) and Node.js version 25.
Perform Cross Cloud Operations
Now that all the building blocks are in place- the Azure Cloud Shell has all the tools to have visibility into both clouds. Gemini CLI can be used directly with the gcloud utility running on Azure:
william@Azure:~/gemini-cli-azure$ gemini
▝▜▄ Gemini CLI v0.33.0
▝▜▄
▗▟▀ Logged in with Google /auth
▝▀ Gemini Code Assist Standard /upgrade
Tips for getting started:
1. /help for more information
2. Ask coding questions, edit code or run commands
3. Be specific for the best results
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
> summarize my google cloud project with the gcloud tools
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
✦ Based on the gcloud tools, here is a summary of your active Google Cloud project:
Project Overview
- Project Name: glitnir
- Project ID: comglitn
- Project Number: 1056842563084
- Status: ACTIVE (Created: Aug 31, 2014)
- Key Labels: firebase: enabled, generative-language: enabled.
Using the ADK on Azure Cloud Shell
Now that the base environment has been enabled- a sample ADK project is cloned and initial setup is done:
git clone https://github.com/adk-hello-world
source set_env.sh
gcloud auth application-default login
Once the environment is set- call the Agent1_cli.sh script:
william@Azure:~/adk-hello-world$ source Agent1_cli.sh
--- Setting Google Cloud Environment Variables ---
Checking gcloud authentication status...
gcloud is authenticated.
Are you using a Gemini API Key? (y/N):
Configuring for Vertex AI...
Exported PROJECT_ID=comglitn
Exported PROJECT_NUMBER=1056842563084
Exported SERVICE_ACCOUNT_NAME=1056842563084-compute@developer.gserviceaccount.com
Exported GOOGLE_CLOUD_PROJECT=comglitn
Exported GOOGLE_GENAI_USE_VERTEXAI=TRUE
Exported GOOGLE_CLOUD_LOCATION=us-central1
Exported REPO_NAME=
Exported REGION=us-central1
Exported AGENT_PATH=/home/william/adk-hello-world/src/agents/adk_hello_world
--- Environment setup complete ---
/home/william/adk-hello-world/src/agents/Agent1
adk run .
Log setup complete: /tmp/agents_log/agent.20260311_221653.log
To access latest log: tail -F /tmp/agents_log/agent.latest.log
/home/william/.local/lib/python3.12/site-packages/google/adk/cli/utils/agent_loader.py:248: UserWarning: [EXPERIMENTAL] _load_from_yaml_config: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
if root_agent := self._load_from_yaml_config(actual_agent_name, agents_dir):
/home/william/.local/lib/python3.12/site-packages/google/adk/features/_feature_decorator.py:81: UserWarning: [EXPERIMENTAL] feature FeatureName.AGENT_CONFIG is enabled.
check_feature_enabled()
/home/william/.local/lib/python3.12/site-packages/google/adk/cli/cli.py:204: UserWarning: [EXPERIMENTAL] InMemoryCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
credential_service = InMemoryCredentialService()
/home/william/.local/lib/python3.12/site-packages/google/adk/auth/credential_service/in_memory_credential_service.py:33: UserWarning: [EXPERIMENTAL] BaseCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
super(). __init__ ()
Running agent Agent1, type exit to exit.
[user]: what is the weather in Trenton NJ?
[Agent1]: The weather in Trenton, NJ is currently mostly cloudy, with temperatures around 73°F (23°C), feeling like 77°F (25°C). The humidity is approximately 67%, and there is a low chance of precipitation at 3%.
South winds are blowing at 10 to 15 mph, with gusts up to 25 mph.
[user]:
Running the ADK Web Interface
The web preview involves a bit of setup because of the Azure Cloud Shell proxy. First click the web preview and open port 8000:
Once the port has been opened- grab the proxy address:
https://ccon-prod-eastus-aci-02.servicebus.windows.net/cc-3VRS-F0BD8323/proxy/8000/
then start the ADK Web Interface on host 0.0.0.0 with the proxy prefix:
cd ~/adk-hello-world/src/agents
adk web --host 0.0.0.0 --url_prefix /cc-3VRS-F0BD8323/proxy/8000
Verify the ADK Web interface
Navigate to the external IP address of the Azure Cloud Shell proxy-safe URL:
https://ccon-prod-eastus-aci-02.servicebus.windows.net/cc-3VRS-F0BD8323/proxy/8000/dev-ui/
Then start the web UI:
Summary
Gemini CLI was downloaded and tested from the Azure Cloud Shell. This is a complete fully working version of Gemini CLI with all the standard features like extensions, agent skills, and a familiar interface. Then, Gemini CLI was used to perform Azure native operations using the built-in tooling. Finally the Google Cloud Tools were downloaded and installed. These tools were used to install configure the ADK. This is a first step to enabling cross platform projects with both Google Cloud and Azure.