Skip to main content

A modern, interactive terminal-based file tree viewer with file panel support

Project description

vtree-tree

A modern Python CLI application that provides a full-screen, interactive file tree viewer for the terminal. Built with Textual TUI framework and Rich for terminal formatting.

PyPI version Python

Features

  • 🌳 Interactive file tree - Navigate with mouse and keyboard
  • 📁 Dual view modes - Toggle between inline files and separate file panel
  • 📋 Clipboard integration - Copy paths with a single keystroke
  • 🎨 Clean interface - Modern terminal-style dark theme without file type icons for better readability
  • 👁️ Hidden file toggle - Show/hide dotfiles and system files
  • 📊 File details - Human-readable file sizes and modification dates
  • Smart filtering - Automatically ignores common development artifacts (.git, pycache, node_modules, etc.)
  • 🖱️ Mouse support - Full mouse navigation and selection
  • 🔄 Real-time browsing - Refresh capability for dynamic file system viewing
  • ✏️ Built-in file editor - Edit text files directly within vtree with syntax highlighting
  • 🗑️ Safe file operations - Delete files and folders with confirmation prompts
  • ↩️ Undo system - Undo deletions and edits with full file recovery
  • 🎯 Multi-selection - Select multiple files/folders using Cmd+Click or Ctrl+Click

Installation

pip install vtree-tree

Usage

# View current directory
vtree

# View specific directory
vtree /path/to/directory

# Development - run from source
python3 -m vtree.main [path]

# Get help
vtree --help

Keyboard Shortcuts

Key Action
q / Ctrl+C Quit
r Refresh tree
f Toggle hidden files
p Toggle file panel mode
c Copy current path to clipboard
d Delete selected files/folders
e Edit selected file in built-in editor
Ctrl+Z / Cmd+Z Undo last action (delete/edit)
h / ? Toggle help panel
↑↓←→ Navigate tree
Cmd+Click / Ctrl+Click Multi-select files/folders
y Confirm deletion
n Cancel deletion

View Modes

Inline Mode (Default)

Files and directories are shown together in a traditional tree structure.

Panel Mode

Press p to toggle panel mode where:

  • Left panel shows the directory tree
  • Right panel shows files in the selected directory with details (size, date)
  • Perfect for browsing large directories with detailed file information

Copy to Clipboard

Press c to copy the current path to your clipboard:

  • On a folder: Copies the folder path
  • On a file: Copies the complete file path

Great for quickly navigating in terminal sessions:

vtree
# Press 'c' on desired folder/file
cd # Paste path here (for folders) or use file path directly

File Operations

Editing Files

Press e on any text file to open it in the built-in editor:

  • Ctrl+S: Save changes
  • Esc: Cancel and close editor
  • Supports syntax highlighting and handles various encodings
  • Automatically creates undo points for edited files

Deleting Files & Folders

Press d to delete selected items:

  • Shows confirmation dialog with file count for folders
  • Press y to confirm deletion or n to cancel
  • Supports multi-selection - delete multiple items at once
  • All deletions can be undone with Ctrl+Z / Cmd+Z

Undo System

Press Ctrl+Z / Cmd+Z to undo the last action:

  • Restores deleted files and folders completely
  • Reverts file edits to their previous content
  • Maintains up to 50 undo actions in history
  • Automatic cleanup of temporary backup files

Requirements

  • Python 3.8+
  • Works on macOS, Linux, and Windows
  • Terminal with color support

Architecture

Built with a clean, modular architecture:

  • VTreeApp: Main Textual application class that orchestrates the UI
  • FileTree: Custom Tree widget that handles file system navigation and display
  • FileListPanel: DataTable showing files with size and date information
  • InfoPanel: Shows details about selected files/directories
  • HelpPanel: Displays keyboard shortcuts
  • FileNode: Data class for representing file system entries

Dependencies

  • textual - Modern TUI framework
  • rich - Terminal formatting and colors
  • click - Command-line interface

License

MIT License - see LICENSE file for details.

Contributing

Contributions welcome! Please feel free to submit a Pull Request.

Project details


Download files

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

Source Distribution

vtree_tree-2.4.0.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

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

vtree_tree-2.4.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file vtree_tree-2.4.0.tar.gz.

File metadata

  • Download URL: vtree_tree-2.4.0.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for vtree_tree-2.4.0.tar.gz
Algorithm Hash digest
SHA256 86b6074b075bb9041714b6b5610b5f6c3aa09e0392e8e8a66a7cfe01dbaa418e
MD5 1ff52a41923fcc94bf55cd5e6c7e13bd
BLAKE2b-256 de53017bf3feea16f42693a8ab0e159dd41bb1c5fb99281cd346353d7f63a0b4

See more details on using hashes here.

File details

Details for the file vtree_tree-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: vtree_tree-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for vtree_tree-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 854bdaec54d27aa76bb45796ff4d3832c169bcda08a5bf6e6c3183419f2b40a1
MD5 91848f4c027311aa13b1334b34e6a88c
BLAKE2b-256 45b3aac6fcbebc61441f0796a38e8973c7197845a1b1a6ec0e6ae278e6ad25af

See more details on using hashes here.

Supported by

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