tzip
A terminal UI application for browsing and managing ZIP archives, built with Bubble Tea.
Features
- Two-pane file browser with vim-style navigation
- Browse ZIP files as virtual filesystems
- Preview files with text content display and metadata
- Create, edit, and extract ZIP archives
- Multi-selection support across files and directories
- Atomic writes ensuring no data corruption
Installation
go build -o tzip .
Usage
./tzip
Key Bindings
Navigation
| Key |
Action |
j / Down |
Move cursor down |
k / Up |
Move cursor up |
h / Left |
Go to parent directory / Exit ZIP |
l / Right / Enter |
Enter directory / Open ZIP |
q / Ctrl+C |
Quit |
Selection
| Key |
Action |
Space |
Toggle selection on focused item |
v |
Start visual selection mode |
Visual Selection Mode
When in visual selection mode, use j/k to extend the selection range, then:
Space or v to confirm and apply the selection
Esc to cancel without selecting
ZIP Operations (inside ZIP)
| Key |
Action |
x |
Extract selected entries |
d |
Delete selected entries from ZIP |
File Operations (filesystem)
| Key |
Action |
a |
Add selected files to ZIP |
o |
Create new ZIP archive |
m |
Mark/unmark ZIP as target for additions |
r |
Rename ZIP file |
Delete |
Delete file/directory (with confirmation) |
Interface
tzip /home/user/documents
╭─────────────────────────╮ ╭─────────────────────────╮
│ Directory [2] >arch.zip │ │ Preview │
├─────────────────────────┤ ├─────────────────────────┤
│ / documents │ │ Name: project.zip │
│ / photos │ │ Type: ZIP Archive │
│ * file1.txt │ │ Size: 1.2 MB │
│ * file2.txt │ │ Entries: 42 │
│ > @ project.zip │ │ │
│ readme.md │ │ Contents: │
│ │ │ src/ │
│ │ │ docs/ │
│ │ │ README.md │
╰─────────────────────────╯ ╰─────────────────────────╯
j/k: move space: sel a: add o: new zip m: mark r: rename
Visual Indicators
| Symbol |
Meaning |
/ |
Directory |
@ |
ZIP archive |
* |
Selected item |
> |
Marked ZIP (target for additions) |
Workflow Examples
- Navigate to and enter a ZIP file (
l or Enter)
- Select files to extract (
Space)
- Press
x to extract to current directory
Add files to an existing ZIP
- Select files to add (
Space)
- Either:
- Focus the target ZIP and press
a, or
- Mark a ZIP with
m, then press a from anywhere
Create a new ZIP
- Select files to include (
Space)
- Press
o
- Enter ZIP name and press
Enter
Remove files from a ZIP
- Enter the ZIP file
- Select entries to remove (
Space)
- Press
d to delete
Technical Details
- Built with Go and the Charm ecosystem (Bubble Tea, Lip Gloss)
- ZIP operations use atomic writes (temp file + rename)
- Supports nested directories in ZIP archives
- Text file detection via UTF-8 validation
- Symlinks are skipped during ZIP operations for safety
Project Structure
teazip/
├── main.go # Application entry point
├── model.go # Bubble Tea model and state management
├── ui.go # UI rendering with Lip Gloss
├── filesystem.go # Filesystem operations and file info
├── zipfs.go # ZIP virtual filesystem browsing
├── zipwrite.go # ZIP mutation (add/remove entries)
├── extract.go # ZIP extraction utilities
├── go.mod
└── go.sum
License
MIT