Skip to main content

xtrshow

Code Extraction & Patching Made Easy

PyPI Version Python Versions License

CI Status Downloads

xtrshow is a CLI suite that closes the loop between your local codebase and AI coding assistants (ChatGPT, Claude, Gemini, etc.). It removes the two biggest points of friction in AI-assisted development:

  1. Getting code INTO the LLM — interactively select files and format them with line numbers so the model can anchor edits to exact locations.
  2. Getting code OUT of the LLM — apply the model's changes safely, atomically, and reversibly, without copy-pasting dozens of snippets.

No API keys, no agents, no daemons. It works with any chat interface — including free tiers — because the "protocol" is just text.

Installation

pip install xtrshow

Installs two commands: xtrshow (the extractor) and xtrpatch (the patcher).

Quickstart: Extract → Prompt → Apply

1. Extract context. Select files in the TUI; the formatted output goes to stdout:

xtrshow | pbcopy        # macOS
xtrshow | xclip -sel c  # Linux
xtrshow | clip          # Windows

2. Prompt. Paste the context into your LLM along with the patch-format instructions:

xtrshow -p   # prints a copy-pasteable instruction block

3. Apply. Save the LLM's reply to a file and apply it:

xtrpatch changes.txt

Made a mistake? xtrpatch --revert changes.txt unwinds every file the patch touched.

Tip: Iterating on the same files? xtrshow --update re-exports your last selection without opening the TUI.

👉 Read the Full Getting Started Guide

Why not just use git diffs?

LLMs are unreliable at producing valid unified diffs — line numbers drift, context lines get hallucinated, and one bad hunk poisons the file. xtrpatch uses a Search & Replace block format designed around how models actually fail:

  • Fuzzy whitespace matching absorbs the indentation errors models constantly make.
  • Wildcard anchors (~~~~) let the model match on stable signatures and skip volatile interior lines.
  • Tail context disambiguates near-duplicate blocks with a lookahead check.
  • Per-hunk annotations (@ why this change) surface in the apply report, so failures are self-describing and feed straight back into the LLM for self-correction.

Features

xtrshow (The Extractor)

  • Interactive TUI: fast, keyboard-driven file selection with directory expand/collapse and live size stats.
  • LLM-optimized output: line-numbered content with --- a/path headers the patcher can target.
  • Smart filtering: ignores node_modules, .git, build artifacts, and friends by default (--no-ignore to disable).
  • Re-export: --update replays your last selection from the saved manifest.
  • Multi-file export: --multi writes one file per selection — useful for RAG pipelines.
  • Prompt printer: -p emits the LLM instruction block for the patch format.

xtrpatch (The Patcher)

  • Safety first: automatic, versioned backups in .xtrpatch/ before every modification.
  • Checksum verification: warns when a file was edited outside the patch loop since the last apply.
  • Conflict detection: overlapping hunks are caught pre-flight and skipped, never blindly stacked.
  • Full lifecycle: modify, insert, create files, delete sections, delete whole files (! DELETE FILE).
  • Idempotent: re-applying a patch detects already-applied hunks and skips them.
  • Error reports: failed applies generate a .rpterr bundle (original + patch + log) you can paste straight back to the LLM.
  • Undo button: --revert restores the most recent backup — per file, or for every file in a patch.

License

Apache 2.0

Download files

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

Source Distribution

xtrshow-1.0.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

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

xtrshow-1.0.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xtrshow-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0e509ffef72e7d769fc382d2ec2ae6ce5f3ff27d707c6c7cf3b5e13b9abf445e
MD5 2e4b346213e6c10f17a372837580d9b2
BLAKE2b-256 1ef947fbdafc7e9b670e7e80cf2d2f9d063b884ce0751b11e6cd20fbdccd7c64

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xtrshow-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a374c8c0c32976ae643bb6e6d5a23c9be8c4dcf6e278db106c4926fcefc4f444
MD5 d862b28cb70ff6ce4902dfc19ced2d39
BLAKE2b-256 65afb7ff67377204d1efd0733bb7bf83548e8b5e666790b8fba124788559779a

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

1.0.1

2 files

This release

1.0.0 This release

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.0

2 files

Supported by

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