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. Print a copy-pasteable instruction block with:
xtrshow -p
  1. 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.

Run xtrshow -p to print a copy-pasteable instruction block for this purpose.

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.1.tar.gz (39.8 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.1-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xtrshow-0.3.1.tar.gz
  • Upload date:
  • Size: 39.8 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.1.tar.gz
Algorithm Hash digest
SHA256 fdb447efe8744202eb48b84eae9f801c32521f2035426746232672a998a56c1e
MD5 5575e3b5824f1a5e10fc337deb8042f8
BLAKE2b-256 8bf3cf86364b93fc856f295b1eb675dcedf547701ca7a8e637db2833af00fe9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtrshow-0.3.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: xtrshow-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 25.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8be6a41032c6f73d8199c90bc7be64fd9aff661fb3b1776046c6ff97ab06003
MD5 932411d7561fd58b5a5ee80ae4325226
BLAKE2b-256 f8ed69561e27ac40412d9634ac2b2e65e436649be1f97e2b6b34f14479eb67a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtrshow-0.3.1-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