Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Txtar ViewerNew to Visual Studio Code? Get it now.
Txtar Viewer

Txtar Viewer

phlv

|
4 installs
| (0) | Free
View and create txtar archive files in VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Txtar Viewer

A powerful VS Code extension for viewing and creating txtar format text archive files.

Visual Studio Marketplace Downloads

What is Txtar?

Txtar is a simple text archive format originally created by the Go team for storing multiple files in a single text file. It's perfect for:

  • 📝 Code examples and test cases
  • 📦 Project templates and scaffolding
  • 🔄 Batch file sharing
  • 📚 Multi-file examples in documentation

Try it online: https://txtar.dev

Features

1. Export Directory/Files to Txtar

Right-click on folders or files to export them as txtar archives:

  • Git Mode (default): Automatically detects Git repositories and exports only tracked files
  • Auto-fallback: Automatically switches to normal mode when not in a Git repository
  • Multi-select Support: Select multiple files and folders simultaneously
  • Smart Filtering: Automatically ignores binary files (images, videos, archives, etc.)

How to use:

  • Right-click on file/folder → "Copy as Txtar" - Copy to clipboard
  • Right-click on file/folder → "Export as Txtar File" - Save as .txtar file

2. Txtar File Viewer

When opening .txtar files, automatically displays:

  • 📁 Directory Tree View: Clear file structure navigation
  • 🎨 Syntax Highlighting: Support for 50+ programming languages
  • 🔍 File Preview: Click on files to view content
  • 📝 Comment Support: Display archive description

Installation

Method 1: VS Code Marketplace (Recommended)

  1. Open VS Code
  2. Press Ctrl+Shift+X (macOS: Cmd+Shift+X) to open Extensions
  3. Search for "Txtar Viewer"
  4. Click "Install"

Method 2: Command Line

code --install-extension phlv.vscode-txtar

Method 3: Marketplace Page

Visit VS Code Marketplace to install directly

Usage

Creating Txtar Archives

  1. In VS Code's file explorer, right-click on files or folders
  2. Choose one of the following actions:
    • Copy as Txtar - Copy content to clipboard for sharing
    • Export as Txtar File - Save as a .txtar file

Multi-select Example:

  • Hold Ctrl (macOS: Cmd) and click multiple files
  • Right-click → "Copy as Txtar"
  • All selected files will be packaged into one txtar archive

Viewing Txtar Files

  1. Open any .txtar file in VS Code
  2. Automatically displays file tree and preview interface
  3. Click on filenames in the left tree to view content
  4. Enjoy syntax highlighting for comfortable reading

Supported Languages

The extension automatically detects file types and applies syntax highlighting for:

  • Web: JavaScript, TypeScript, HTML, CSS, SCSS, Vue, React
  • Backend: Python, Go, Rust, Java, C/C++, C#, PHP, Ruby
  • Config: JSON, YAML, TOML, XML, INI
  • Shell: Bash, PowerShell, Batch
  • Data: SQL, GraphQL, Markdown
  • And more: 50+ programming languages

How It Works

Git Mode (Default)

In Git repositories, the extension will:

  1. Automatically detect Git repository
  2. Export only tracked files (respecting .gitignore)
  3. Keep clean output, excluding node_modules, .git, etc.

Auto-fallback

When not in a Git repository:

  • Automatically switches to normal mode
  • Recursively scans directory
  • Intelligently filters binary files

Binary File Filtering

By default, ignores the following file types:

  • Images: .png, .jpg, .gif, .ico, .svg
  • Videos: .mp4, .avi, .mov
  • Audio: .mp3, .wav, .ogg
  • Archives: .zip, .tar, .gz, .7z
  • Executables: .exe, .dll, .so, .dylib
  • Other binary formats

Txtar Format

Basic txtar file format:

This is the comment area where you can describe the archive content.
Comments are separated from files by a blank line.

-- file1.txt --
Content of file 1
Can have multiple lines

-- dir/file2.js --
console.log('Hello, Txtar!');

-- dir/file3.py --
print("Supports any text file")

Format Rules:

  • File separator: -- filename --
  • Supports directory paths: -- path/to/file.txt --
  • Text at the beginning serves as comments
  • Pure text format, easy for version control

Links

  • 🌐 Online Tool: https://txtar.dev - Use Txtar in your browser
  • 📦 Marketplace: VS Code Marketplace
  • 🐛 Issue Tracker: Report bugs and request features

Tech Stack

  • TypeScript
  • VS Code Extension API
  • Custom Editor API
  • Highlight.js (Syntax highlighting)
  • simple-git (Git integration)

License

MIT License

Feedback

If you find this extension useful, please leave a ⭐ rating on the marketplace!


Enjoy using Txtar Viewer!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft