This is my implementation of the "Build Your Own Shell" Challenge provided by CodeCrafters, written in Rust.
It is a POSIX-compliant shell capable of interpreting shell commands, running built-in commands, and executing external programs.
- Interactive REPL: Built with
rustylineto support command history and auto-completion. - Built-in Commands: Supports standard built-ins including
cd,pwd,echo,exit,type, andhistory. - Program Execution: Resolves and executes external programs found in the system's
$PATH. - Output Redirection: Supports standard output and standard error redirection (e.g.,
>,>>,1>,2>). - Pipelining: Can chain multiple commands together using pipes (
|), allowing concurrent execution of external commands. - Path Auto-completion: Tab-completion for file and directory arguments, supporting partial matches.
You can build and run the shell locally using the provided script:
# Clone the repository
git clone <your-repo-url>
cd codecrafters-shell-rust
# Run the shell
./your_program.shAlternatively, you can use Cargo directly:
cargo run --release