1 Install and configure#


1 Install#

1.1 Mac OS#

brew install gemini-cli

If using VSCode, enable IDE integration#

  1. Install Gemini CLI Companion extension from marketplace
/ide enable

1.2 Steps to Install Gemini CLI via Homebrew on Ubuntu#

This guide will set up Homebrew (Linuxbrew) on your Ubuntu server so you can manage the Gemini CLI exactly like you do on your Mac Studio.

###4 Step 1: Install System Dependencies Ubuntu requires a few build tools to support Homebrew’s background processes.

sudo apt update && sudo apt install build-essential procps curl file git -y

Step 2: Run the Homebrew Installer#

This script downloads and sets up the Homebrew directory structure in /home/linuxbrew/.

## Can't be installed as roo
su - marc
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 3: Configure Your Shell Path#

You must tell your Ubuntu system where to find the brew command. Run these three lines to update your profile:

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Step 4: Install Gemini CLI#

Now that brew is active, you can install the CLI without needing sudo or managing npm permissions.

brew install gemini-cli

2 Run Gemini CLI#

> [!WARNING]
> **Warning:** On Ubuntu, run Gemini CLI as marc - NEVER ROOT
#### From the project folder 
gemini
#### Resume session
gemini -r
#### Initiate the projet
/init

Gemini CLI Core Configuration Reference#

This table covers the files created during the global installation and the project-specific initialization (/init) performed at /Users/marc/Obsidian.

Data Type Storage Location Stays in Vault?
Global Settings ~/.gemini/settings.json No
Global Context ~/.gemini/GEMINI.md No
Project Settings /Users/marc/Obsidian/.gemini/settings.json Yes
Project Context /Users/marc/Obsidian/GEMINI.md Yes
Project Commands /Users/marc/Obsidian/.gemini/commands/ Yes
Project Shell History ~/.gemini/tmp/<project_hash>/shell_history No
Conversation States ~/.gemini/tmp/<project_hash>/ No
#### Trust the folder
/permissions trust .
#### Refresh project’s memory
/memory refresh
# Shell mode while within Gemini CLI to run local commands
!

3 Open Session#

# View Sessions
gemini --list-sessions
# Resume by Index
gemini --resume 1
# Delete Session by #
gemini --delete-session 6
# Resume by name (bug in the UI, can't use name directly)
gemini -i "/chat load CHAT_NAME"
# Rename the session
/chat save NAME

3.1 Once the session is started - Chats#

# List saved sessions
/chat list
# Open session
/chat resume NAME
# Delete the session
/chat delete NAME

Model#

# Choose model when Starting
gemini -m gemini-3-flash --resume SESSION_NAME
# Change model
/model

4 Extensions#

# List installed extensions
gemini extensions list

4.1 gemini-obsidian#

# Install
gemini extensions install https://github.com/thoreinstein/gemini-obsidian
## Install Native Dependencies
cd ~/.gemini/extensions/gemini-obsidian && npm install
## Set Your Vault Path
echo 'export OBSIDIAN_VAULT_PATH="/Users/marc/Obsidian"' >> ~/.zshrc
source ~/.zshrc
## Perform Initial Indexing
cd ~/.gemini/extensions/gemini-obsidian
node dist/index.js obsidian_rag_index
## Test
cd /Users/marc/Obsidian && gemini
## Then try a search command
/obsidian:ask "What is my UniFi password variable name?"

Gemini CLI Extension Storage Reference#

Data Type Storage Location Stays in Vault?
Settings ~/.gemini-obsidian.config.json No
Vector Index ~/.gemini-obsidian-lancedb No
Source Code ~/.gemini/extensions/gemini-obsidian No