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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xtrshow-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bab9668b6e294a2ee9253966797655258c597b3d6b1f38275ca377c1c1ace2be
MD5 d50ffc715b1ffeb7d2c39ddf835ea5af
BLAKE2b-256 d4e73b0bf895872c90fd1a533ad1242aa0e2823c434fcca8ba7916c39aa1785c

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for xtrshow-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60c85f418d58f273d56848aaa6303761f8da495fed06fabc498ef04089493cf5
MD5 766f7ffdb4b1a05be1fa40b0d65d1ed3
BLAKE2b-256 cad5ade53b95aa0af9977c3d862182ae2bdcfa807995d3631d8bb1615d052e9a

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

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