A minimal, customizable command-line shell written in Rust β with features like aliases, environment management, history, prompt customization, and fun facts about Rust on startup. π§ β¨
- π‘ Random Rust fun fact on launch
- π§ Alias support (with save/load functionality)
- π
cd
,ls
and environment variable handling (setenv
,getenv
) - π§Ύ Shell history (auto-saved)
- π§° Runs system commands cross-platform (Windows/Linux/macOS)
- π§ Git branch detection in prompt (if inside a repo)
- β¨ Colored directory listing (on Unix)
- π Built-in commands like
help
,whoami-shell
,shellinfo
- π¨ Custom prompt symbol with
setprompt
- Rust (with
cargo
) - Git (optional, for branch detection)
- Build tools (for your OS)
git clone https://github.com/yourusername/rust-shell.git
cd rust-shell
cargo build --release
cargo run
Or run the compiled executable:
./target/release/rust-shell
You can run commands just like in a regular shell:
> ls
> cd my_folder
> setenv NAME Rustacean
> getenv NAME
> alias gs=git status
> gs
Command | Description |
---|---|
ls |
Lists directory contents (color-coded) |
cd <dir> |
Changes directory |
setenv VAR VAL |
Sets an environment variable |
getenv VAR |
Gets an environment variable |
alias a=b |
Creates an alias |
save-aliases |
Saves aliases to aliases.txt |
load-aliases |
Loads aliases from aliases.txt |
setprompt <sym> |
Sets custom prompt symbol |
shellinfo |
Displays system and shell info |
whoami-shell |
Prints shell identity |
help |
Lists available commands |
exit |
Exits the shell |
src/main.rs
- Main source codealiases.txt
- Saved aliaseshistory.txt
- Shell history
* Welcome to your custom Rust Shell! *
Fun fact: Rust was voted the 'most loved programming language' on Stack Overflow for 7 years in a row!
(Optional: You can add a screenshot of the terminal interface here)
This project is licensed under the MIT License.
Pull requests are welcome! Feel free to open issues or feature requests.
Built with β€οΈ and rustyline
, git2
, sysinfo
, and pure Rust magic.