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
✦ This Azure VM is a Standard_D2s_v3 instance located in the East US region.
Hardware & System Summary
- Operating System: Debian 12 (bookworm)
- CPU: 2 vCPUs (Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz)
- Memory: 8 GiB RAM
- Storage: 32 GB OS disk (/dev/sda1), with approximately 22 GB free space.
- Architecture: x86_64
and Azure operations can be performed directly from Gemini CLI:
> list azure vms using the az command
✦ The Azure CLI (v2.84.0) is configured with the following account details:
Azure Account Information
- User: xbill@glitnir.com
- Environment: AzureCloud
- State: Enabled
Regional Context
- Location: The VM itself is located in eastus.
- Top Available Regions: eastus, westus2, australiaeast, southeastasia, northeurope, swedencentral, westeurope, uksouth.
Technical Profile
- VM Size: Standard_D2s_v3 (2 vCPU, 8 GB RAM)
- OS Platform: Debian 12 (bookworm) on a 6.1.x cloud kernel.
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:
azureuser@azure-new:~$gcloud auth list
Credentialed Accounts
ACTIVE ACCOUNT
* xbill@glitnir.com
To set the active account, run:
$gcloud config set account `ACCOUNT`
azureuser@azure-new:~$gcloud config list
[compute]
region = us-west2
zone = us-west2-a
[core]
account = xbill@glitnir.com
disable_usage_reporting = True
project = comglitn
Your active configuration is: [default]
azureuser@azure-new:~$
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 VM has all the tools to have visibility into both clouds. Gemini CLI can be used directly with the gcloud utility running on Azure:
azureuser@azure-new:~/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
✦ I will begin by checking your current Google Cloud configuration and project details using the gcloud CLI.
✦ Based on the gcloud tools, here is a summary of your Google Cloud project:
Project Overview
* Project Name: glitnir
* Project ID: comglitn
* Project Number: 1056842563084
* Account: xbill@glitnir.com
* Status: Active (Created Aug 2014)
* Labels: firebase: enabled, generative-language: enabled
Summary
Gemini CLI was downloaded and tested from an Azure Linux VM. 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 downoaded and installed. This is a first step to enabling cross platform projects with both Google Cloud and Azure.