A modern, interactive terminal-based file tree viewer with file panel support
Project description
vtree-tree
A modern, interactive terminal-based file tree viewer with file panel support.
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
- 🎨 Modern terminal theme - Clean, professional dark interface
- 👁️ Hidden file toggle - Show/hide dotfiles and system files
- 📊 File details - View sizes, modification dates, and file information
- ⚡ Smart filtering - Automatically ignores common development artifacts
- 🖱️ Mouse support - Full mouse navigation and selection
- ✏️ Built-in editor - Edit files directly with vim-like interface
- 🔒 Safe editing - Read-only mode with insert mode protection
Installation
pip install vtree-tree
Usage
# View current directory
vtree
# View specific directory
vtree /path/to/directory
# 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 |
h / ? |
Toggle help panel |
↑↓←→ |
Navigate tree |
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 only directories
- Right panel shows files in the selected directory with details (size, date)
- Perfect for browsing large directories
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 parent directory path
Great for quickly navigating in terminal sessions:
vtree
# Press 'c' on desired folder
cd # Paste path here
File Editing
vtree includes a built-in text editor with vim-like workflow:
Opening Files
Press e on any file to open it in read-only mode:
- View file contents without risk of accidental changes
- Navigate through the file with arrow keys
Editing Mode
Once in the file viewer, press i to enter insert mode:
- Now you can edit the file content
- The title bar shows "Insert Mode" to indicate editing is active
- Press
Ctrl+Sto save your changes
Safety Features
- Read-only by default: Files open in view-only mode
- Unsaved changes warning: If you try to close with unsaved changes, you'll get a confirmation dialog:
Y: Save and closeN: Close without savingEsc: Cancel and return to editing
Editor Controls
| Key | Action |
|---|---|
e |
Open file in read-only mode |
i |
Enter insert/edit mode (when viewing) |
Ctrl+S |
Save file (when editing) |
Esc |
Close editor |
Requirements
- Python 3.8+
- Works on macOS, Linux, and Windows
- Terminal with color support
Dependencies
textual- Modern TUI frameworkrich- Terminal formatting and colorsclick- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vtree_tree-2.2.0.tar.gz.
File metadata
- Download URL: vtree_tree-2.2.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
312110c8083cdeda421d1b99a8c5ffbefabc30b43c4145ce50a3946608fa2a38
|
|
| MD5 |
1e7149a79e0ff598727fdd5d813f7ae9
|
|
| BLAKE2b-256 |
805b5712ea275c5b84ee6e9566e1c45e25b217b45ab39c9dccbb66b34a26a733
|
File details
Details for the file vtree_tree-2.2.0-py3-none-any.whl.
File metadata
- Download URL: vtree_tree-2.2.0-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a21b3d2ca581a170c87959ebfad9c8bc15e36b6b587ebba05d56b69f7f503e4c
|
|
| MD5 |
b0d682d1a804531b8d9f41b22b828b8c
|
|
| BLAKE2b-256 |
49bcb07ae41a76f6bc7d918a11136143ed5973f757a487bca0f70c5020b45343
|