A Shell Client built in C++
This repository contains Fish, a POSIX-compliant shell client built in C++ as part of the Codecrafters "Build Your Own Shell" Challenge. The shell is capable of interpreting shell commands, running external programs, and handling built-in commands like cd
, pwd
, echo
, and more.
Fish is designed to be a lightweight and simple shell client built in C++ that complies with POSIX standards. It is capable of interpreting a variety of shell commands and managing both external programs and built-in shell functionalities.
Key features include:
- Running external programs.
- Built-in commands like
cd
,pwd
,echo
, and more. - Learning about shell command parsing and REPL loops.
The project uses the following tools and libraries:
- C++
- POSIX standard for shell compliance
To get started with Fish locally, follow the steps below.
Ensure you have the following installed on your system:
- GCC (or any C++ compiler)
- Make (optional, for easier build management)
- Clone the repository:
git clone https://github.com/Ashfinn/fish.git
- Navigate to the project directory:
cd fish
- Compile the source code:
g++ -o fish_shell main.cpp
- Run the shell:
./fish
Once the shell is running, you can execute common shell commands such as:
pwd
- Print the current directory.cd
- Change directory.echo
- Output text to the terminal.- Run external programs like
ls
,cat
, etc.
You can type commands directly into the Fish shell, just as you would in a standard Unix shell.
For more usage examples, please refer to the Documentation
- Add basic command parsing and execution
- Add built-in commands (
cd
,pwd
,echo
) - Improve error handling and edge case support
- Support piping and redirection
- Add support for multi-command execution (using
&&
,||
) - Add additional features like scripting support
Contributions are welcome! If you have ideas to improve Fish, feel free to fork the repo and create a pull request. Here’s how:
- Fork the repository
- Create a new feature branch (
git checkout -b feature/newFeature
) - Commit your changes (
git commit -m 'Add some newFeature'
) - Push to the branch (
git push origin feature/newFeature
) - Open a pull request
Distributed under the MIT License. See LICENSE.txt
for more information.