A Python file manager that supports:
- Standard command mode (
file-explorer <command> ...) - Interactive shell mode (
file-explorer --interactive) - Terminal GUI mode (
file-explorer gui)
Designed for the Open Source Week contest and extended with safety-focused features (trash, undo, critical-path protection, graceful error handling).
- Overview
- Features
- Project Structure
- Requirements
- Installation
- Usage
- Safety Model
- Testing
- Build & Release
- Contributing
- Security
- License
file-explorer is a cross-mode file management tool written in Python 3.10+.
It focuses on:
- Safe file operations with undo support
- Clear and consistent error handling
- Interactive and GUI usability for quick navigation
- Minimal external dependencies
| Command | Description |
|---|---|
file-explorer folders <name1> <name2> ... |
Create one or more folders |
file-explorer folders <parent>,<child> |
Create nested folder |
file-explorer files <name1> <name2> ... |
Create one or more files |
file-explorer list |
List directories and files |
file-explorer pwd |
Show current app working directory |
file-explorer cd <folder> |
Change app working directory |
file-explorer back |
Go back to previous working directory |
file-explorer delete <name> |
Delete file/folder (folder requires confirmation) |
file-explorer rename <old> <new> |
Rename file/folder |
file-explorer copy <source> <destination> |
Copy file |
file-explorer move <source> <destination> |
Move file/folder |
file-explorer info <file> |
Show file metadata |
| Command | Description |
|---|---|
file-explorer search <pattern> |
Search recursively by partial name |
file-explorer tree [target] [--depth N] |
Render folder tree |
file-explorer trash <name> |
Move target to trash |
file-explorer trash-list |
List trash items |
file-explorer restore <token> [destination] |
Restore trashed item |
file-explorer trash-clear |
Clear trash and orphan trash artifacts |
file-explorer undo |
Undo latest destructive action |
file-explorer undo --show |
Preview pending undo action |
file-explorer path <name> |
Print absolute path |
file-explorer copypath <name> |
Copy path to clipboard (with manual fallback) |
- Command mode: one command per invocation
- Interactive shell mode: history, aliases, persistent state
- GUI mode: arrow-key menu navigation, status bar, bulk operations, progress output
.
├── src/file_manager_cli/
│ ├── cli.py # parser + command dispatch
│ ├── fs_ops.py # filesystem operations and safety checks
│ ├── shell.py # interactive shell mode
│ ├── tui.py # terminal GUI mode
│ ├── state.py # persisted app state (cwd)
│ ├── output.py # color/output helpers
│ ├── main.py # entrypoint
│ └── __main__.py
├── tests/
│ ├── test_cli_required_commands.py
│ └── test_extras.py
├── pyproject.toml
├── README.md
├── CONTRIBUTING.md
├── SECURITY.md
├── CHANGELOG.md
└── LICENSE
- Python
>=3.10 - Linux/macOS/WSL recommended
- Optional clipboard tools for
copypath:wl-copy(Wayland)xcliporxsel(X11)
python3 -m venv .venv
source .venv/bin/activate
pip install -e .file-explorer --helpfile-explorer folders docs src
file-explorer folders docs,images
file-explorer files notes.txt docs/readme.md
file-explorer list
file-explorer cd docs
file-explorer back
file-explorer cd -
file-explorer info notes.txt
file-explorer tree . --depth 2file-explorer --interactiveIn shell mode:
- Use
helpfor command overview - Use
backorcd -to return to previous directory - Use
historyfor recent commands - Use
alias ll listto define aliases - Use
clearto clear terminal - Use
exitto quit
file-explorer guiIn GUI mode:
- Navigate with
↑/↓andEnter - Number keys are supported as fallback
- Includes status bar (
cwd, item count, free space) - Includes bulk operations with progress output
The application is designed to fail safely:
- Destructive operations are undo-aware (
delete,move,rename,trash) - Critical paths are protected from destructive commands:
/- home directory
- Metadata writes are atomic where applicable
- Parsing and runtime errors are converted to user-friendly errors
- Unexpected exceptions are caught and returned as safe failures
Run full test suite:
source .venv/bin/activate
python -m pytest -qCurrent suite includes:
- Required command lifecycle tests
- Undo/trash/tree behavior
- GUI and shell edge cases
- Argument parsing error paths
- Fail-safe/safe-fail regression tests
Build source and wheel distributions:
source .venv/bin/activate
python -m pip install build
python -m buildArtifacts are generated in dist/.
Please read CONTRIBUTING.md before opening pull requests.
Please read SECURITY.md for vulnerability reporting guidance.
This project is licensed under the MIT License. See LICENSE.
The recoding of the demo video results in a blnk screen in the recording. i couldnt fix the issue in time in my pc. I have provided a detailed documentation of all features please refer to it.