txtar

command module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 2 Imported by: 0

README

txtar CLI Tool

A complete command-line tool for working with txtar format archives, supporting packing, unpacking, listing, and comparing operations with Git integration.

Features

  • pack: Pack directories or Git changesets into txtar format
  • unpack: Safely unpack txtar archives to filesystem
  • list: List files in a txtar archive
  • diff: Compare two archives or directory with archive

Installation

go install github.com/phlv/txtar@latest

Or build from source:

git clone https://github.com/phlv/txtar.git
cd txtar
go build -o txtar

Usage

Pack

Pack a directory into txtar format:

txtar pack --exclude "*.log" -o archive.txtar

Pack with Git integration:

txtar pack --git --since=1 -o delta.txtar

Pack staged changes:

txtar pack --git --staged -o staged.txtar
Unpack

Unpack with backup:

txtar unpack --backup --dir /output archive.txtar

Dry-run to preview operations:

txtar unpack --dry-run archive.txtar
List

List archive contents:

txtar list archive.txtar

From stdin:

cat archive.txtar | txtar list
Diff

Compare two archives:

txtar diff left.txtar right.txtar

Compare directory with archive:

txtar diff --dir ./src archive.txtar

Configuration

Create ~/.config/txtar/config.yaml:

pack:
  default_exclude:
    - "*.log"
    - "node_modules/"
    - ".git/"
  ignore_binary: true

unpack:
  backup: false
  dir: "./out"

Examples

See .config.yaml.example and .txtarignore.example for configuration examples.

Testing

go test ./...

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL