A lightweight and interactive command-line file explorer built in Rust. This tool allows users to navigate directories, view files, and perform basic file operations with an intuitive interface inspired by modern CLI tools.
- Directory Navigation: Change directories using the
cdcommand. - File Listing: View the contents of the current directory with color-coded output (directories in blue, files in yellow).
- File Operations:
- Create new files with
create. - Delete files or directories with
delete. - Open files with the default application using
open.
- Create new files with
- Interactive Interface:
- Command prompt shows the current directory.
- User-friendly error and success messages.
- Color-coded output for better readability.
- Help Menu: Type
helpto see all available commands.
-
Clone the repository:
git clone https://github.com/axpico/rust-file-explorer.git cd rust-file-explorer -
Install dependencies: Ensure you have Rust installed. Then, add the required crates:
cargo build -
Run the program:
cargo run
Once the program is running, you can use the following commands:
| Command | Description |
|---|---|
cd |
Change to the specified directory. |
ls |
List all files and directories in the current directory. |
open |
Open a file with the default application. |
delete |
Delete a specified file or directory. |
create |
Create a new file in the current directory. |
help |
Show a list of available commands. |
exit |
Exit the program. |
> ls
📂 Contents of /home/user/projects:
- src/
- README.md
- Cargo.toml
> cd src
✓ Changed directory to /home/user/projects/src
> create example.txt
✓ Created example.txt
> ls
📂 Contents of /home/user/projects/src:
- main.rs
- example.txt
> open example.txt
✓ Opened example.txt
> delete example.txt
✓ Deleted example.txt
> exit
This project uses the following crates:
anyhow: Simplified error handling with context.rustyline: Interactive command-line editor.colored: Terminal text styling and coloring.open: Cross-platform file opener.
Add them to your Cargo.toml:
[dependencies]
anyhow = "1.0"
rustyline = "15.0.0"
open = "5.3.2"
colored = "3.0.0"
This project is licensed under the MIT License.
Happy exploring! 🚀