Skip to content

gemini Google Gemini CLI

Google Gemini CLI is used as an AI agent that can be used directly in a terminal.

I use the Gemini CLI to help generate bash script files and markdown documents for mkdocs-material. It is my preferred coding agent at the moment since I already pay for Google One.

🛠 Installation

Config path: ~/.gemini/

npx https://github.com/google-gemini/gemini-cli
sudo npm install -g @google/gemini-cli
gemini

⚙ Config

  1. Generate a key from Google AI Studio.
  2. Set it as an environment variable in your terminal. Replace YOUR_API_KEY with your generated key.
export GEMINI_API_KEY="YOUR_API_KEY"
export GEMINI_API_KEY="YOUR_API_KEY"

✍ Syntax Files

Syntax files are used to customize the iutput from Gemini.

docs/GEMINI.md
# New PVE Application Guidelines for Gemini

**Context:** This directory contains all Proxmox LXC applications.
- The `.template` folder is to be used as a template folder for new applications.

## Creating a New PVE Application

To create a new Proxmox LXC application, follow these steps:

1. **Copy the template:** Copy the `.template` directory to a new directory named after your application (e.g., `my-app/`).

2. **Update the files:** The following files need to be updated with the new application's information:

    - The app is a typical Debian based application.
    - `README.md`: This is the documentation for the application.
      - Update the `APP_NAME` to the new application's name.
    - `Taskfile.yml`: This file contains tasks for managing the application.
      - Update the service name from `{{ APP_NAME | lower }}` to your application's name.
      - Read environmental variables from the application and add them to the `Taskfile.yml` if needed.
      - Get the following values from the application properties:
        - `CONFIG_DIR` is the location of the app config dir, usually in the `/etc` folder.
        - `INSTALL_DIR` is the location of the app folder, usually in the `/opt/` folder.
        - `SERVICE_NAME` is the name of the `systemctl` service of the app.
    - `task-list.txt`: This file contains a list of tasks for the application.
    - `update.sh`: This script updates the application. Use standard Debian application practices to update the app.
      - Can model the update script from https://community-scripts.github.io/ProxmoxVE/scripts for `amd64` apps or https://pimox-scripts.com/scripts for `arm64` apps.

3.  **Finalize:** Once you have updated these files, you can remove any placeholder values.

AGENTS.md files can also be used to enable the use of other AI agents.

Enable gemini-cli to use AGENTS.md files.

~/.gemini/settings.json

{ "contextFileName": "AGENTS.md" }

📝 Usage

Once installed and authenticated, start interacting with Gemini from the shell.

Example

git clone https://github.com/google-gemini/gemini-cli
cd gemini-cli
gemini
> Give me a summary of all of the changes that went in yesterday

Start a chat

gemini

Pipe content to the CLI from stdin

echo "Explain the content of this file docs/README.md" | gemini -p

🔗 References