Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.27 KB

File metadata and controls

35 lines (27 loc) · 1.27 KB

Gemini Zsh Copilot

A context-aware terminal assistant for macOS/Linux (Zsh) providing explanations, automation, and error diagnostics using Gemini 2.0 Flash.

Core Modes

  • ask: General Q&A.
  • do: Task execution with interactive confirmation.
  • explain: Diagnostic tool for piped logs or syntax errors.

Components

  • gemini_cli.py: Core logic with multi-mode operation and context awareness.
  • review_and_run.sh: Safety staging script for AI-generated commands.
  • Rich: CLI interface for structured, color-coded output.

Setup

1. Prerequisites

  • Python 3.10+
  • Gemini API Key (GOOGLE_API_KEY in environment)

2. Shell Configuration (~/.zshrc)

# Update paths to your local installation
export AGENT_VENV="$HOME/Projects/agentic-dev/cli-agent/gemini-env/bin/python3"
export AGENT_SCRIPT="$HOME/Projects/agentic-dev/cli-agent/gemini_cli.py"

alias ask="GEMINI_MODE=ask $AGENT_VENV $AGENT_SCRIPT"
alias do="GEMINI_MODE=do $AGENT_VENV $AGENT_SCRIPT"
alias explain="GEMINI_MODE=explain $AGENT_VENV $AGENT_SCRIPT"

Features

  • Context Awareness: Automatically captures CWD, OS, and Git branch.
  • Piping Support: command 2>&1 | explain "debug this error".
  • Safety: Generated commands are written to review_and_run.sh before execution.