Skip to main content

AI-powered developer companion for understanding, monitoring, and maintaining AI-generated codebases

Project description

Peek

AI-powered developer companion — understand, monitor, and maintain your codebase.

Python License: MIT

Peek sits beside your AI coding tools (Copilot, ChatGPT, Cursor) and builds contextual intelligence about your repository. It tracks which prompt generated which code, maps your codebase architecture, and can trace bugs back to the exact prompt that introduced them.


Installation

pip install peek-dev

Or install from source:

git clone https://github.com/pramod/peek
cd peek
pip install -e .

Requirements: Python 3.9+, git (optional but recommended)


Quick Start

# 1. Initialise Peek in your project
cd your-project/
peek init

# 2. See your codebase as a feature map
peek map

# 3. Log the prompt you just used to generate code
peek log "Create the authentication module with JWT support"

# 4. Get a health score for your repo
peek health

# 5. Trace a bug back to its originating prompt
peek debug

Commands

peek init

Initialises Peek in the current directory. Creates .peek/peek.db for prompt tracking and scaffolds missing project files (src/, tests/, docs/, README.md).

$ peek init

╭─────── ** Peek Initialized ───────╮
│  Project     my-project            │
│  Type        python                │
│  Files found 12 Python file(s)     │
│                                    │
│  Created                           │
│  + src/                            │
│  + tests/                          │
│  + docs/                           │
╰────────────────────────────────────╯

peek map

Groups your Python files by folder and displays a feature map — your codebase at a glance.

$ peek map

  Feature Map
 ┌──────────────┬─────────────────────────────┬───────┐
 │ Feature      │ Files                       │ Count │
 ├──────────────┼─────────────────────────────┼───────┤
 │ cli          │ · cli/commands.py            │     1 │
 │ core         │ · core/repo_scanner.py       │     3 │
 │              │ · core/git_history.py        │       │
 │              │ · core/dependency_graph.py   │       │
 └──────────────┴─────────────────────────────┴───────┘

peek log "<prompt>"

Logs the AI prompt you just used and links it to the files that changed. This is the data that powers peek debug.

peek log "Add checkout flow with cart integration"

Run this immediately after using an AI tool to generate code.


peek debug

Peeks signature feature. Diffs recent git commits, finds which logged prompt touched the changed files, and shows the downstream blast radius through your import graph.

$ peek debug

Recently Changed Files
└── checkout_service.py

Suspect Prompts
╭─────────────────────────────────────────╮
│  Prompt #4  abc1234                      │
│  "Add checkout flow with cart integration"│
│  Touched: checkout_service.py, cart.py   │
╰─────────────────────────────────────────╯

Downstream Affected Files
  → order_service.py
  → payment_handler.py

peek health

Scores your repository out of 100 across four dimensions: test coverage, duplicate logic, documentation, and circular dependencies.

$ peek health

╭─────── Repository Health ──────────╮
│  Score:  72 / 100   Grade: C       │
│  ████████████████░░░░░░░░░░░░░░░░  │
╰────────────────────────────────────╯

 Category         Severity   Detail
 Test Coverage    MEDIUM     8 of 14 modules have no tests
 Duplicate Logic  LOW        1 duplicate function group detected

How It Works

peek log "prompt"   →  captures git state + links changed files
peek debug          →  git diff → prompt DB lookup → graph traversal
peek health         →  AST analysis → weighted score (no ML required)
peek map            →  file tree walk → feature grouping

All analysis is local and offline. No data leaves your machine.


Design Decisions

Choice Reason
Python-only (v1) AST module is built-in, no extra deps
SQLite storage Built into Python, fast, queryable
Git diff + graph traversal Deterministic debugging without ML
Typer + Rich Beautiful terminal output, auto-generated help

Roadmap

  • Phase 2: peek security, peek graph, peek clean, PyPI publishing
  • Phase 3: peek architect (AI suggestions), peek monitor (background watcher), VS Code extension

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peek_dev-0.1.0.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

peek_dev-0.1.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file peek_dev-0.1.0.tar.gz.

File metadata

  • Download URL: peek_dev-0.1.0.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for peek_dev-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6df9fb01068476c5c9d99b633169128ae8660635a014b6edc955b097e7079a62
MD5 dd04ddbc1417ff08045f6e6b0c3aff01
BLAKE2b-256 78204d9e5b9a9c5d1158d5c4998300f85bfaf85cad8c0d1229e1a7a3ee112489

See more details on using hashes here.

File details

Details for the file peek_dev-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: peek_dev-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for peek_dev-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14d14be9caf63e374bd297fc9d84bffe51a59677b651d764fa10f78452728b5e
MD5 2dc8705568293040be9538aeb5a0ae19
BLAKE2b-256 df2d24fce6c7885ff59e6f3ebd0edb6585123daeb66dbe724853ddc7af96fcf6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page