Foldora is a Python command-line interface (CLI) tool designed to help you efficiently manage files and directories.
Foldora provides essential file and directory operations, including:
- 📝 Displaying file contents
- 🧹 Purging files and directories
- 📁 Listing files and directories
- 📂 Creating directories and files
- ✏️ Replacing spaces in file and directory names with underscores
To install Foldora, clone the repository and navigate to the project directory:
- PS: Make sure python is installed in case you're new to Python.
pip install foldora
Run Foldora using the fd
command followed by the desired operation.
Lists all files and directories in the current or specified paths.
Command:
fd la [optional_paths]
Notes:
- Hidden files and directories may also be included depending on the system settings.
- If a specified path is a file, an error will be raised.
- Multiple paths can be specified to list contents from different directories at once.
Examples:
- List files/dirs of the current directory
fd la
- List files/dirs of specific directories
fd la /path/to/dir1 /path/to/dir2
Creates one or more directories.
Command:
fd cd [paths]
Notes:
- Creates all necessary parent directories if they do not exist.
- Does not modify existing directories.
- Supports creating multiple directories in a single command.
Example:
fd cd /path/to/dir1 /path/to/dir2 ...
Creates one or more files in the current directory or a specified path.
Command:
fd cf '[-p path]' [file_paths]
Notes:
- Existing files with the same names will not be overwritten.
- If the specified directory (or path) does not exist, it will be created.
- Supports creating multiple files in a single command.
Examples:
- Create files in the current directory
fd cf file1.txt file2.txt
- Create files in a specified directory
fd cf -p /path/to/dir file1.txt file2.txt
Deletes specified files and directories with user confirmation.
Command:
fd pa [file_paths] [dir_paths]
Notes:
- Use with caution, as this action cannot be undone.
- Directories will be deleted recursively, including all their contents.
- Ensure you have the necessary permissions to delete the specified paths.
Example:
fd pa /path/to/dir1 /path/to/file1 ...
Shows the content of one or more files.
Command:
fd sc [file_paths]
Notes:
- Files must be readable, or an error will be raised.
- Supports multiple files, displaying each file's content in sequence.
Example:
fd sc /path/to/file1 /path/to/file2 ...
Replace spaces in file and folder names with underscores.
This command renames files and folders by replacing any spaces in their names with underscores. It operates on the specified directory (or the current directory if none is provided). All files and directories in that location will have their names updated to remove spaces.
Command:
fd rs [path]
Notes:
- By default, only top-level files and folders are renamed.
- When prompted, entering 'y' activates Deep Folder Traversal mode, which processes all nested directories.
- Deep Folder Traversal mode allows recursive renaming for all files and folders within the specified path.
Example:
- Current directory
fd rs
- Specific directory
fd rs /path/to/dir
Contributions are welcome! Feel free to open issues or submit pull requests to help improve Foldora.
This project is licensed under the MIT License.