Supa Shell is a simple shell implementation built in Rust. It supports basic shell functionality like command execution, autocompletion, and command history management. The shell is designed to be used interactively, and it runs under the supa command.
- Command Autocompletion: Press the Tab key to complete commands or filenames.
- Command History: The shell keeps a history of commands executed in the session.
- Built-in Commands:
echo: Prints the arguments passed to it.exit [code]: Exits the shell with an optional exit code.help: Lists available commands.pwd: Prints the current working directory.cd [path]: Changes the current directory.history: Shows the command history.
To build Supa Shell, you need to have Rust installed. Follow the steps below to set up the project:
-
Clone the repository:
git clone https://github.com/bisher-al-masri/supa-shell.git cd supa-shell -
Build the project:
cargo build --release
-
Run the shell:
cargo run
After running the shell, you'll see a prompt ($ ). You can type commands, and the shell will process them. Here's an example of a session:
$ echo Hello, World!
Hello, World!
$ pwd
/home/user
$ cd /path/to/directory
$ history
1 echo Hello, World!
2 pwd
3 cd /path/to/directoryPress Tab to autocomplete commands and file paths. Use Ctrl + C to exit the shell.
- Tab: Autocompletes the command or file path.
- Backspace: Deletes the last character.
- Enter: Executes the command.
- Ctrl + C: Exits the shell.
- src/main.rs: Main source file containing the implementation of the shell.
- Cargo.toml: Cargo configuration file for the Rust project.
Feel free to fork the repository and submit pull requests. Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.