How to Use the Gemini CLI VPS Template

Updated 2 weeks ago

Google Gemini CLI is an open-source command-line interface that allows you to interact with Google’s Gemini language model directly from your terminal. With it, you can run prompts, manage conversations, execute shell commands, and integrate AI into development workflows using natural language. The “Ubuntu 24.04 with Gemini CLI” VPS template comes with Gemini CLI pre-installed, so you can start using it right away.

Accessing Your VPS

After deploying the template, you can access Gemini CLI in two ways:

  • Via SSH: Use a terminal on your computer to connect with: ssh root@[your-vps-ip]
  • Via Browser Terminal: Open your VPS dashboard in hPanel and launch the browser terminal directly from there.

Using Gemini CLI

Once connected, you can start using Gemini CLI immediately. To begin, authenticate your Google account by running:

gemini

On first launch, you’ll be prompted to:

  1. Choose a login method (recommended: “Login with Google”)
  2. Complete authentication in your browser

If you’re using Browser terminal and select the authentication method “Login with Google”, you will need to restart the Gemini to copy the URL. Just close the terminal entirely and re-open it again, enter gemini one more time, and you will be able to paste your verification code.

With a personal Google account, you get 60 requests per minute and 1,000 requests per day at no charge.

Basic Commands

Here are some useful commands to get started.

Start an interactive session:

gemini

Run a one-line prompt:

gemini -p "Explain the difference between HTTP and HTTPS"

View available commands and keyboard shortcuts:

Type / within the interactive session or run:

gemini --help

Toggle shell mode (to run direct shell commands):

Press ! in the message box to switch between Gemini and shell mode.

Advanced Features

Gemini CLI supports powerful built-in tools and customization:

Built-in Tools:

  • Google Search grounding for real-time information
  • File operations for reading and manipulating files
  • Shell command execution
  • Web page fetching

MCP Server Integration:

Extend Gemini CLI with custom tools by configuring MCP servers in ~/.gemini/settings.json:

> @github List my open pull requests
> @slack Send a summary to #dev channel

Custom Commands:

Create reusable commands with /command for repetitive tasks.

Context Files:

Add a GEMINI.md file to your project for persistent context.

Output Formats:

Use --output-format json for structured output in scripts:

gemini -p "Analyze this codebase" --output-format json

Getting Started

The “Ubuntu 24.04 with Gemini CLI” template gives you everything needed to begin working with Gemini from the command line. With the CLI already installed and ready, you can immediately start creating prompts, building automations, or integrating Gemini into your development environment. For advanced features and documentation, visit the official Gemini CLI documentation or the GitHub repository.