glimpse

command module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 17 Imported by: 0

README ¶

Glimpse: AI-Powered Micro-Reviewer

Glimpse is a lightweight, local daemon that watches your active repository. When you stage your changes the git diff is captured and fed to an LLM, and which it will provide a concise engineering review to stdout.

It is designed for "Vibecoding"—maintaining flow state while getting instant feedback on correctness.

🚀 Installation

go install github.com/revrost/glimpse@latest

This installs glimpse to your GOPATH/bin (usually ~/go/bin/). Make sure ~/go/bin is in your PATH.

Features

  • Git diff capture for staged and unstaged changes
  • Focused reviews for bugs, performance, and security issues
  • Nice stdout interface

Quick Start

  1. Configure API Key

    export OPENAI_API_KEY="your-api-key-here"
    # or for Gemini
    export GEMINI_API_KEY="your-gemini-key-here"
    # or for Z.AI
    export ZAI_API_KEY="your-zai-key-here"
    # or for CLAUDE
    export CLAUDE_API_KEY="your-claude-key-here"
    
  2. Create Configuration (.glimpse.yaml in repo root)

    watch:
      - "./internal/**/*.go"
      - "./pkg/**/*.go"
    ignore:
      - "*_test.go"
    logs:
      file: "./tmp/server.log"
      lines: 50
    llm:
      provider: "openai"
      model: "gpt-4o"
      system_prompt: "You are a Principal Go Engineer. Review strictly for bugs, perf, and slog context."
    
  3. Start Glimpse

    glimpse
    # or if using local build:
    ./glimpse
    

Architecture

fsnotify → bounded batcher → event‑scoped diffs → async LLM
                ↓
         safe timers + shutdown

Managing Your Installation

Update to Latest Version
go install github.com/revrost/glimpse@latest
Check Version
glimpse -version
Uninstall
rm $(which glimpse)

Configuration

Glimpse uses a .glimpse.yaml file in the repository root. If not found, it uses sensible defaults.

Watch Configuration
watch:
  - "./internal/**/*.go"    # Watch Go files in internal directory
  - "./pkg/**/*.go"         # Watch Go files in pkg directory
  - "./src/**/*.rs"         # Watch Rust files
ignore:
  - "*_test.go"             # Ignore test files
  - "*.generated.go"         # Ignore generated files
  - "vendor/**"             # Ignore vendor directory
Log Configuration
logs:
  file: "./tmp/server.log"   # Log file to tail
  lines: 50                 # Number of recent lines to include
LLM Configuration
llm:
  provider: "openai"         # openai, gemini, ollama, zai
  model: "gpt-4o"          # Model to use
  api_key: "optional-key"    # Can use env vars instead
  system_prompt: "You are a Principal Go Engineer. Review for bugs, performance, and security."
API Keys

API keys can be provided via:

  1. Environment variables: OPENAI_API_KEY, GEMINI_API_KEY, ZAI_API_KEY, CLAUDE_API_KEY
  2. Configuration file: api_key field in llm section

Context Window Strategy

Glimpse sends a structured prompt to the LLM:

SYSTEM: [System Prompt]

CONTEXT:
1. File: internal/handlers/payment.go
2. Git Diff:
   [Output of git diff --unified=0 internal/handlers/payment.go]

3. Recent Runtime Logs (tail -n 50):
   [Raw content of server.log]

TASK:
Review the diff. If the logs show errors related to this logic, highlight them immediately.
Be concise.

License

MIT License - see LICENSE file for details.

Documentation ¶

The Go Gopher

There is no documentation for this package.

Directories ¶

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL