A POSIX-compliant shell written in Rust — built from scratch as part of the CodeCrafters "Build Your Own Shell" challenge.
- Builtins:
echo,pwd,cd,type,exit,history,export,unset,set,env,test/[,alias/unalias,source,help - Pipes & redirects:
|,>,>>,<,2>,2>>,2>&1, heredocs (<<) - Scripting:
if/elif/else/fi,for/do/done,while/do/done,case/in/esac, subshells( ) - Operators:
&&,||,;,&(background),!(pipeline negation) - Expansion:
$VAR,${VAR},$?,$(cmd),`cmd`,~, globs (*?[a-z]), history expansion (!!,!$,!N) - Tab completion: builtins + PATH lookup + filesystem
- Custom theme system:
GS_PROMPT_FORMAT— segment-based prompt ({user},{host},{path},{git},{exit}, etc.)GS_OH_MY_POSH_THEME— load oh-my-posh.omp.jsonthemesGS_STYLE_<SEGMENT>— per-segment colors ("cyan bold","white on_blue", hex"#ff0000")- Legacy
PS1backslash escapes still supported (\w,\u,\h,\$,\t)
- REPL: multi-line input, history save/load,
HISTFILE,!history expansion, Ctrl+C handling - Init file:
~/.gshellrcor$GSHELLRCsourced on startup
- Rust 1.91+ (
rustup install 1.91 && rustup default 1.91)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Crazygiscool/G-shell/main/install.sh)"Downloads and runs install.sh — builds the release binary and installs to ~/.local/bin.
yay -S g-shell
# or: paru -S g-shellBuilds from source. Requires base-devel and cargo.
git clone https://github.com/Crazygiscool/G-shell
cd G-shell
chmod +x install.sh
./install.sh # installs to ~/.local/bin
./install.sh /usr/local/bin # custom pathcargo install --path ../gshell.sh # build debug + run
./gshell.sh --bin # build release + rung-shellOr customize the prompt in ~/.gshellrc:
export GS_PROMPT_FORMAT='{user}@{host}:{path}{git}{exit} {prompt} '
export GS_STYLE_PATH="cyan bold"
export GS_STYLE_GIT="yellow"Oh-my-posh themes:
export GS_OH_MY_POSH_THEME="$HOME/.poshthemes/catppuccin.omp.json"This project originated from the CodeCrafters "Build Your Own Shell" challenge.
git commit -am "pass 1st stage" # any msg
git push origin master- Ensure you have
cargo (1.91)installed locally - Run
./your_program.shto run your program - Commit your changes and run
git push origin masterto submit your solution