A lightweight shell written in C, as a hobby-project
Note The shell only runs on POSIX compliant operating systems.
- Interactive cmd prompt; reads user input and parses commands
- Support for lightweight configuration via
config.c - Built-in autocomplete using tabs and UP/DOWN arrow keys via
autocomplete.c - Simple parser via
parser.c - No external dependencies: raw-mode terminal handling implemented manually.
- Clone the repository
git clone https://github.com/AnirudhMathur12/anishell.git
cd anishell- Create a build directory, run CMake, compile and run the executable:
mkdir build && cd build
cmake ..
make
./anishellOr simply run the build.sh file
./build.sh- Launch the shell: you’re presented with a prompt.
- On startup the shell will run
~/.anishellrc. - Enter commands: the shell will parse and execute (via standard exec/fork) depending on the commands implementation.
- Use tab/autocomplete support while typing.
- Use commands as you would in a typical Unix‐like shell (cd, ls, etc), subject to what’s implemented.
├── autocomplete.c # autocomplete logic
├── config.c # configuration parameters
├── input.c # reading input in raw mode, handling line editing
├── parser.c # parsing command line into tokens/args
├── shell.h # common definitions/interfaces
├── main.c # entry point, shell loop
├── CMakeLists.txt # build config
├── .gitignore
└── LICENSE # Apache-2.0 License
- Requires a C compiler (e.g., gcc or clang) supporting C99 or newer.
- Uses CMake (version ≥ 3.x) for build configuration.
- Platform: Developed and tested on Unix-like systems (Linux/macOS).
- No additional external libraries beyond standard C library.
- Contributions are welcome! Here’s how you can help:
- Report issues or feature requests via the Issues tab.
- Fork the repo, make your changes, and submit a pull request (PR).
- Suggested enhancements:
- Job control
- Please follow the coding style (e.g., indentation, naming) used in the project.
This project is licensed under the Apache License 2.0. See the LICENSE file for full details.