Skip to main content

Your pithy python pair programmer CLI tool

Project description

Pithy

Your pithy python pair programmer

Dependencies

  • uv
  • Python version >=3.12
  • pipx

Build steps

  • uv build
  • pipx install .

Features

Code Summarization

Generate structured markdown summaries of your source code files and directories using AI.

Quick Start

# Summarize a single file
pithy summarize path/to/file.py

# Summarize an entire directory
pithy summarize src/

# Summarize current directory
pithy summarize .

Output Structure

Summaries are written to the .pithy/ directory at your git repository root, mirroring your source tree structure:

  • File summaries: .pithy/<relative_path>.<ext>.md

    • Example: src/app.py.pithy/src/app.py.md
    • Contains AI-generated summary with key points, purpose, dependencies, and notes
  • Directory meta: .pithy/<relative_path>/_meta.md

    • Aggregates immediate files with one-line synopses
    • References subdirectories via links to their _meta.md files
    • Generated programmatically (no LLM calls)

Options

Option Default Description
path . File or directory to summarize
--exclude, -x (none) Glob patterns to exclude (repeatable)
--depth -1 Maximum recursion depth (-1 = unlimited)
--force False Regenerate even if outputs are up-to-date
--dry-run False Show planned actions without writing files
--max-file-bytes 120000 Read limit per file (caps token usage)
--quiet False Reduce console output
--include-ignored False Process gitignored files

Default Exclusions

Gitignored files are automatically excluded by default. The summarize command respects your .gitignore file(s) and skips any files or directories that git would ignore. Use --include-ignored to override this behavior.

Additionally, the following patterns are always excluded:

  • .git/, .pithy/
  • node_modules/, dist/, build/, .venv/
  • *.lock, *.min.*

Examples

Exclude specific files or patterns:

pithy summarize . --exclude "tests/*" --exclude "*.tmp"

Limit recursion depth:

pithy summarize src/ --depth 2

Force regeneration of all summaries:

pithy summarize . --force

Preview actions without writing:

pithy summarize src/ --dry-run

Quiet mode for scripting:

pithy summarize . --quiet

Include gitignored files:

pithy summarize . --include-ignored
# Processes everything, including files matched by .gitignore

Gitignore Integration

By default, pithy summarize respects your .gitignore files:

  • Files and directories matched by .gitignore patterns are automatically skipped
  • Nested .gitignore files are respected (follows git's hierarchy)
  • Works seamlessly with your existing git workflow
  • Use --include-ignored to process ignored files when needed (e.g., for documentation of build artifacts)

Example:

# .gitignore contains:
# build/
# *.pyc
# .env

# Default behavior - skips build/, *.pyc, .env
pithy summarize .

# Process everything, including gitignored files
pithy summarize . --include-ignored

Incremental Updates

By default, summaries are only regenerated when the source file is newer than the existing summary. This saves API calls and time on repeated runs. Use --force to override this behavior.

Cost Control

  • Only file-level summaries invoke the LLM
  • Directory _meta.md files are generated programmatically (deterministic, free)
  • --max-file-bytes caps the amount of content sent per file (default: 120KB)
  • Binary files are detected and skipped automatically

API Key Setup

Before using summarization, configure your LLM provider API key:

# For Anthropic Claude
pithy keys set anthropic

# For OpenAI GPT
pithy keys set openai

# Check provider status
pithy keys providers

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

pithy_cli-0.1.0.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

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

pithy_cli-0.1.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pithy_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.31

File hashes

Hashes for pithy_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8774a782621b40c86b43d1e3cbfffe7f8fd637ac2bd4cb1987f1c28269f5504f
MD5 7f70b1185c6f285e3fb3b3dfe8fc9b25
BLAKE2b-256 63686b05955eaed90b5f7dc7ba8e6755456633294def53ba1ab5dd5770158781

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pithy_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.31

File hashes

Hashes for pithy_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb3ecae52c3b2c055227fd9e11972c193602faa28aab0778ca938fc135a9ef11
MD5 907824544d5e466580e6dc480813b632
BLAKE2b-256 11f072486e2e72c575cdaf7bd7e8de98d382044e363ceae427b0a981835b1f9e

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