Skip to main content

The bridge between your local codebase and LLMs.

Project description

xtrshow

Code Extraction & Patching Made Easy

PyPI Version Python Versions License

CI Status Downloads

xtrshow is a CLI suite designed to optimize the "Context Injection" and "Code Application" loop when working with AI coding assistants (ChatGPT, Claude, Gemini, etc.).

It solves the two biggest points of friction in AI-assisted development:

  1. Getting code INTO the LLM: Quickly selecting relevant files and formatting them so the model can reference exact lines.
  2. Getting code OUT of the LLM: Applying changes safely without manually copy-pasting dozens of snippets.

Installation

pip install xtrshow

xtrshow and xtrpatch Commands: Quickstart

The workflow consists of three steps: Extract, Prompt, Apply.

  1. Extract Context: Run xtrshow to interactively select files and copy them to your clipboard.
xtrshow | pbcopy  # (MacOS/Linux)
  1. Prompt: Paste the context into your LLM, then ask it to reply using the Search & Replace Block format. A copy-pasteable instruction block lives in the Prompting Guide.
  2. Apply: Save the LLM's response to a file (e.g., changes.txt) and apply it.
xtrpatch changes.txt

Tip: Iterating on the same set of files? Skip reselection and re-export the last selection with xtrshow --update.

👉 Read the Full Getting Started Guide

Features

xtrshow (The Extractor)

  • Interactive TUI: Browse and select files with a fast, keyboard-driven interface.
  • LLM-Optimized Output: Formats code with line numbers and file headers so the model can anchor edits to exact locations.
  • Smart Filtering: Automatically ignores noise directories like node_modules, .git, and build artifacts.
  • Re-Export: Re-run the last selection without touching the TUI via --update.
  • Multi-File Export: Dump separate files for RAG pipelines via --multi.

xtrpatch (The Patcher)

  • Safety First: Automatic, versioned atomic backups for every modified file.
  • Checksum Verification: Detects when a file has changed since its last backup, guarding against silent overwrites.
  • Robust Matching: "Fuzzy" whitespace matching handles common LLM indentation errors.
  • Wildcard Anchors: ~~~~ lets the model skip volatile interior lines and anchor only on stable signatures — dramatically reducing failed patches.
  • Conflict Detection: Catches overlapping edit blocks before they corrupt a file.
  • Full Lifecycle: Create files, delete sections, delete whole files (! DELETE FILE), and modify existing code.
  • Undo Button: Built-in --revert command to instantly unwind changes.

👉 See Detailed Feature List

Prompting the LLM

To use xtrpatch effectively, instruct the LLM to output code as Search and Replace Blocks. Standard git diffs are often too fragile for LLM generation.

We provide a copy-pasteable instruction block for this purpose.

👉 Read the Prompting Guide

Advanced Workflows

For power users of Google Gemini, we have developed a comprehensive "Developer Protocol" that turns the LLM into a more reliable pair programmer with persistent state management and standardized output formats.

👉 See the Gemini Protocol

License

Apache 2.0

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

xtrshow-0.3.0.tar.gz (34.2 kB view details)

Uploaded Source

Built Distribution

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

xtrshow-0.3.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file xtrshow-0.3.0.tar.gz.

File metadata

  • Download URL: xtrshow-0.3.0.tar.gz
  • Upload date:
  • Size: 34.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xtrshow-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0379eaa91bfb802a50b48eda7a39ba3363673fa4b2a1fe6ad3b058f229e256b4
MD5 9068b21097ca61859b89fd2d05b3b225
BLAKE2b-256 4ee5d4bc57807bc32dbda50834adb442e41f1a1d220de8bbd3b6cbde762df153

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtrshow-0.3.0.tar.gz:

Publisher: publish.yml on Aloecraft-org/xtrshow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xtrshow-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: xtrshow-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xtrshow-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbf62d479e54908e6edb456519cba987d74a8bee59f404dc47f148653433cc98
MD5 50b7af168a57b58be0a1b0bed9927745
BLAKE2b-256 07ee3d7e347322ac4ab981c88fbfd88f7a495f5cc94eae6df9f15204927e0a7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtrshow-0.3.0-py3-none-any.whl:

Publisher: publish.yml on Aloecraft-org/xtrshow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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