CoolShell is a custom command-line shell program written in C++. It provides various utility commands and features beyond a typical terminal shell.
The coolshell.cpp file contains the main implementation of the CoolShell program. It utilizes various C++ standard libraries and Windows APIs to create an interactive shell with custom commands.
The functions.cpp file contains definitions for utility and helper functions used by the main coolshell.cpp program. This separation of concerns keeps the main file clean.
-
Custom commands: In addition to executing system commands, CoolShell has various custom commands:
help: Print available commandsgit: Enter Git shellpurple: Enter Purple shellcd: Change directoryrm: Remove filels: List directory contentsclear: Clear screengit: Enter Git shellpwd: Print working directorydate: Print datetime: Print timehostname: Print computer nameecho: Print input textdownload: Download packagewsl: Toggle WSL modehash: Print file hashesinfo: Print system info
-
WSL mode: Toggle between Windows and WSL mode for executing system commands.
-
File utilities: Remove, list, read files with custom commands.
-
System info: Print info like computer name, date, time, etc.
-
Input parsing: Split input into tokens for processing.
-
Directory navigation: Change current working directory.
-
Package management: Download packages using
wingetorapt-get. -
Git shell: Enter dedicated Git shell.
coolshell.cpp
-
main(): Program entry point. Implements shell REPL loop. -
splitString(): Split input into tokens. -
runCommand(): Execute system command. -
initWslShell(): Toggle WSL mode on/off. -
Calls out to
functions.cppfor other utilities.
functions.cpp
-
changeDirectory(): Change current working directory. -
removeFile(): Delete a file. -
listFilesInDirectory(): Print formatted directory listing. -
printCurrentPath(): Print current working directory path. -
printCurrentDate(),printCurrentTime(): Print current date and time strings. -
printComputerName(): Print computer name. -
echoText(): Print input text. -
downloadPackage(): Download package via package manager. -
printSystemInfo(): Print system info like OS version, computer name, etc. -
clearScreen(): Clear console screen. -
And more... s
To build and run CoolShell, ensure you have a C++ compiler and the necessary build tools installed. This program uses the Windows.h and filesystem libraries, which may require a C++17 compatible compiler.
- Clone the repository or download the source code files.
git clone https://github.com/your-username/coolshell.git
cd coolshell
- Compile the source code using your preferred C++ compiler. For example, using GCC:
g++ -std=c++17 -o coolshell coolshell.cpp functions.cpp
- Run the compiled executable:
./coolshell
Contributions are welcome! If you have ideas for improvements or bug fixes, please feel free to make a pull request or open an issue.
- Do a roadmap
- Implement purple support
- Make it cross-platform
- Add docker-shell
- Add ssh, ftp... support (added by redirecting unknown commands to the regular console)
- Add
scannetwork utility (in progress) - Complete the
dcso that it works for all files
This tool is provided as-is, and while it has been tested, the developers are not responsible for any damage or data loss that may occur due to its use.