pfzf

command module
v0.0.0-...-e9ff050 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 12 Imported by: 0

README

pfzf

Interactively generate structured context files from your codebase, designed for LLM pair programming workflows.

Kind of inspired by fzf. I put 0 effort in, not responsible for anything.

⚠️ Alpha Status: This project is in early development, written mostly with Claude because I was lazy and needed this quickly. APIs and features may change significantly.

Features (if you want to even call them that)

  • Interactive file preview and selection with fuzzy search
  • Fast and memory-efficient processing
  • Multiple output formats (XML, JSON, YAML)
  • Terminal UI with customizable themes (sort of works lol)

Installation

go install github.com/lc/pfzf@latest

Quick Start

# Basic usage (outputs to pfzf_*.xml by default)
pfzf

# Specify output format
pfzf -format json

# Use custom config file
pfzf -config ~/.config/pfzf/config.json

Configuration

pfzf can be configured via a JSON configuration file located at $HOME/.pfzf/config.json

You can specify a custom config location using the -config flag:

Note: a lot of the keys are not implemented yet, but they are there for future use.

pfzf -config /path/to/config.json
{
  "scanner": {
    "ignorePatterns": [".git", "node_modules"],
    "maxFileSize": 1048576,
    "maxFiles": 1000
  },
  "processor": {
    "maxChunkSize": 4096,
    "chunkOverlap": 200,
    "maxTokens": 2000,
    "stripComments": false,
    "detectLanguage": true
  },
  "writer": {
    "outputPath": "",
    "format": "xml",
    "prettyPrint": true
  },
  "ui": {
    "previewWidth": 50,
    "theme": "default",
    "keyBindings": {
      "quit": "q",
      "select": "space",
      "toggle_preview": "p",
      "help": "?",
      "focus_search": "/",
      "clear_search": "esc"
    }
  }
}

Key Bindings

  • Space: Select/deselect file
  • ↑/↓: Navigate files
  • /: Focus search
  • ESC: Clear search
  • p: Toggle preview
  • q: Quit
  • ?: Show help

Output Formats

pfzf supports three output formats:

  • XML (default)
  • JSON
  • YAML

Each format includes:

  • Directory context (current working directory and tree structure)
  • Selected file contents with metadata
  • Language-specific processing results (when enabled)

Development Status

This is an alpha release. While the core functionality is working, you may encounter:

  • API changes
  • Feature additions/removals
  • Performance optimizations
  • Bug fixes

Please report issues and feature requests via GitHub issues.

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

License

MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
app
config
Package config provides configuration management for pfzf.
Package config provides configuration management for pfzf.
fs
Package fs provides a utility responsible for generating a string representation of the directory tree.
Package fs provides a utility responsible for generating a string representation of the directory tree.
processor
Package processor provides content processing capabilities for pfzf.
Package processor provides content processing capabilities for pfzf.
scanner
Package scanner provides efficient file scanning functionality for pfzf.
Package scanner provides efficient file scanning functionality for pfzf.
writer
Package writer handles output file generation in various formats.
Package writer handles output file generation in various formats.
pkg
types
Package types provides the core types used throughout the pfzf utility.
Package types provides the core types used throughout the pfzf utility.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳