{"id":18062072,"url":"https://github.com/bisocm/rykeshell","last_synced_at":"2026-01-07T10:47:46.224Z","repository":{"id":259563973,"uuid":"878190424","full_name":"BisocM/RykeShell","owner":"BisocM","description":"RykeShell is a custom Unix shell built entirely in C++, offering users a powerful and customizable command-line experience.","archived":false,"fork":false,"pushed_at":"2024-10-27T01:46:53.000Z","size":869,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T07:34:43.849Z","etag":null,"topics":["cli","cmake","command-line","cpp","shell","terminal","unix-shell"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BisocM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-24T23:38:19.000Z","updated_at":"2025-01-13T19:57:02.000Z","dependencies_parsed_at":"2025-03-28T07:42:32.863Z","dependency_job_id":null,"html_url":"https://github.com/BisocM/RykeShell","commit_stats":null,"previous_names":["bisocm/rykeshell"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BisocM%2FRykeShell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BisocM%2FRykeShell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BisocM%2FRykeShell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BisocM%2FRykeShell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BisocM","download_url":"https://codeload.github.com/BisocM/RykeShell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162112,"owners_count":20733354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cmake","command-line","cpp","shell","terminal","unix-shell"],"created_at":"2024-10-31T05:05:34.749Z","updated_at":"2026-01-07T10:47:46.218Z","avatar_url":"https://github.com/BisocM.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n# **RykeShell**\n\n![Banner](https://github.com/BisocM/RykeShell/blob/master/RykeShell_Rectangle_Transparent.png?raw=true)\n\n[![CodeQL Analysis](https://github.com/BisocM/RykeShell/actions/workflows/codeql.yml/badge.svg)](https://github.com/BisocM/RykeShell/actions/workflows/codeql.yml)\n\n---\n\n## **Introduction**\n\n**RykeShell** is a modern, custom Unix shell implemented in C++. It combines essential shell functionalities with advanced features to provide a user-friendly and efficient command-line environment. RykeShell supports enhanced command parsing, case-insensitive auto-completion with correct casing, built-in commands, customizable theming, and more.\n\n---\n\n## **Features**\n\n- **Customizable Prompt**: Displays the username, hostname, and current directory with color customization using the `theme` command.\n\n- **Advanced Command Parsing**: Supports piping (`|`), input/output redirection (`\u003e`, `\u003c`, `\u003e\u003e`), background execution (`\u0026`), and command chaining (`\u0026\u0026`, `||`).\n- **Modern Redirections**: `|\u0026`, `\u0026\u003e`, `2\u003e`, `2\u003e\u003e`, here-documents (`\u003c\u003c`) and here-strings (`\u003c\u003c\u003c`).\n- **Scripting Mode**: Run `./RykeShell script.ryk` to execute scripts with the same engine as interactive mode.\n\n- **Built-in Commands**:\n    - `cd`: Change the current directory.\n    - `pwd`: Display the current working directory.\n    - `history`: View the command history.\n    - `alias`: Create command aliases.\n    - `prompt`: Configure the prompt template (supports `{user}`, `{host}`, `{cwd}`, `{color}`, `{cwdcolor}`, `{reset}`).\n    - `theme`: Change the prompt color.\n    - `set`: Toggle shell options (`-e`, `-u`, `-x`, `-C`, `-m`, `notify`, `history-ignore-dups`, `noclobber`, etc.).\n    - `jobs`, `jobs -l`, `fg`, `bg`, `disown` (via `bg` + `set -m`): Job control for background tasks.\n    - `source`: Load and run another script in the current session.\n    - `plugin load \u003cpath\u003e`: Dynamically load a plugin that exposes `register_plugin(ryke::Shell\u0026)`.\n    - `exit`: Exit RykeShell.\n    - `help`: Display help information for built-in commands.\n\n- **Wildcard Expansion**: Supports glob patterns (`*`, `?`) for file and directory matching.\n\n- **Environment Variable Expansion**: Expands variables using `$VAR` and `${VAR}`, including default values with `${VAR:-default}`; respects `set -u` for unset vars.\n- **Brace/Arithmetic/Command Substitution**: `{a,b}`/`{1..3}`, `$((1+2))`, and `$(cmd)` all work.\n\n- **Persistent State**: History, aliases, prompt template, and prompt color are stored under your home directory for the next session.\n\n- **Enhanced Auto-Completion**:\n    - **Case-Insensitive Matching**: Type commands and filenames without worrying about case sensitivity.\n    - **Correct Casing in Suggestions**: Auto-completed suggestions use the correct casing as they exist in the filesystem or system commands.\n    - **Inline Suggestions**: Provides suggestions as you type, with unmatched characters displayed in a different color.\n    - **History search**: Ctrl+R for reverse incremental search.\n\n- **Signal Handling**: Safely handles `SIGINT` (Ctrl+C) to prevent unintended termination.\n\n- **Multiline Support**: Allows for multiline commands.\n\n---\n\n## **Getting Started**\n\n### **Prerequisites**\n\n- **C++20-Compatible Compiler**: RykeShell requires a compiler that supports C++20 features (e.g., `g++` version 10 or higher).\n\n- **C++ Standard Library and POSIX-Compliant System**: Unix/Linux environment is required.\n\n### **Building RykeShell**\n\n#### **Clone the Repository**\n\n```bash\ngit clone https://github.com/BisocM/RykeShell.git\ncd RykeShell\n```\n\n#### **Build with CMake**\n\nRykeShell uses CMake for building. Ensure you have `cmake` installed.\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\n\n# Run tests\nctest\n```\n\n#### **Alternatively, Build Manually**\n\nIf you prefer to compile directly with `g++`, ensure you compile with the `-std=c++20` flag and include the necessary libraries.\n\n##### **Step 1: Navigate to the Source Directory**\n\n```bash\ncd src\n```\n\n##### **Step 2: Compile with `g++`**\n\n```bash\ng++ -Wall -Wextra -Wpedantic -std=c++20 -I../include -o RykeShell \\\n    main.cpp ryke_shell.cpp utils.cpp input.cpp autocomplete.cpp parser.cpp executor.cpp commands.cpp -ldl\n```\n\n**Note:** Replace `g++` with `g++-10` or higher if necessary.\n\n---\n\n## **Running RykeShell**\n\nAfter building, you can run RykeShell using:\n\n```bash\n./RykeShell\n```\n\nRun a script file:\n\n```bash\n./RykeShell path/to/script.ryk\n```\n\n---\n\n## **Usage**\n\n- **Executing Commands**: Type commands as you would in a standard shell.\n\n  ```bash\n  ls -l\n  ```\n\n- **Auto-Completion**:\n\n    - **Inline Suggestions**: As you type, RykeShell provides inline suggestions for commands and filenames.\n    - **Accepting Suggestions**: Press `Tab` to accept the suggestion.\n    - **Case-Insensitive Matching**: Type commands and filenames without worrying about case; the shell matches them case-insensitively but preserves the correct casing.\n\n    **Example:**\n\n    - If you have a file named `Makefile`, typing `cat ma` will show an inline suggestion for `Makefile`, and pressing `Tab` will complete it to `cat Makefile`.\n\n- **Built-in Commands**:\n\n    - **Change Directory**\n\n      ```bash\n      cd /path/to/directory\n      ```\n\n    - **Print Working Directory**\n\n      ```bash\n      pwd\n      ```\n\n    - **View Command History**\n\n      ```bash\n      history\n      ```\n\n    - **Set Alias**\n\n      ```bash\n      alias ll='ls -l'\n      ```\n\n    - **Change Prompt Theme**\n\n      ```bash\n      theme blue\n      ```\n\n    - **Set Prompt Template**\n\n      ```bash\n      prompt \"{color}{user}@{host}{reset}:{cwdcolor}{cwd}{reset}$ \"\n      ```\n\n    - **Toggle Options (`set`)**\n\n      ```bash\n      set -e      # exit on error\n      set -u      # error on unset vars\n      set -x      # trace commands\n      set -C      # noclobber\n      set -m      # monitor job control\n      set -o notify\n      ```\n\n    - **Source a Script**\n\n      ```bash\n      source ~/.rykeshellrc\n      ```\n\n    - **Load a Plugin**\n\n      ```bash\n      plugin load /path/to/plugin.so\n      ```\n\n    - **Job Control**\n\n      ```bash\n      sleep 5 \u0026\n      jobs\n      fg        # bring most recent job to the foreground\n      bg 1      # resume job 1 in the background\n      ```\n\n    - **Exit RykeShell**\n\n      ```bash\n      exit\n      ```\n\n    - **Display Help**\n\n      ```bash\n      help\n      ```\n\n- **Advanced Command Features**:\n\n    - **Piping**\n\n      ```bash\n      ls | grep txt\n      ```\n\n    - **Redirection**\n\n        - **Output Redirection:**\n\n          ```bash\n          ls \u003e output.txt\n          ```\n\n        - **Input Redirection:**\n\n          ```bash\n          sort \u003c unsorted.txt\n          ```\n\n        - **Append Output:**\n\n          ```bash\n          echo \"New Line\" \u003e\u003e file.txt\n          ```\n\n        - **Redirect stderr:**\n\n          ```bash\n          cmd 2\u003e errors.log\n          cmd \u0026\u003e all.log\n          cmd |\u0026 tee both.log\n          ```\n\n        - **Here-doc / Here-string:**\n\n          ```bash\n          cat \u003c\u003cEOF\n          hello\n          EOF\n\n          cat \u003c\u003c\u003c \"inline content\"\n          ```\n\n    - **Background Execution**\n\n      ```bash\n      long_running_command \u0026\n      ```\n\n    - **Command Chaining**\n\n        - **AND Operator (`\u0026\u0026`):**\n\n          Execute the next command only if the previous command succeeds.\n\n          ```bash\n          mkdir new_dir \u0026\u0026 cd new_dir\n          ```\n\n        - **OR Operator (`||`):**\n\n          Execute the next command only if the previous command fails.\n\n          ```bash\n          cd existing_dir || echo \"Directory does not exist.\"\n          ```\n\n- **Wildcard Expansion**\n\n  ```bash\n  ls *.cpp\n  ```\n\n- **Environment Variable Expansion**\n\n  ```bash\n  echo $HOME\n  echo ${USER}\n  echo ${UNSET_VAR:-default_value}\n  ```\n\n---\n\n## **Customization**\n\n- **Changing Prompt Color**\n\n  Use the `theme` command with one of the available colors:\n\n    - `red`\n    - `green`\n    - `yellow`\n    - `blue`\n    - `magenta`\n    - `cyan`\n\n  Example:\n\n  ```bash\n  theme magenta\n  ```\n\n- **Creating Aliases**\n\n  Create shortcuts for common commands:\n\n  ```bash\n  alias gs='git status'\n  ```\n\n- **State Files**\n\n  RykeShell persists session data in your home directory by default:\n\n  - `~/.rykeshell_history`\n  - `~/.rykeshell_aliases`\n  - `~/.rykeshell_config` (prompt, options)\n  - `~/.rykeshellrc` (sourced at startup if present)\n\n---\n\n## **Contributing**\n\nWe welcome contributions to RykeShell! Whether you're fixing bugs, adding new features, or improving documentation, your help is appreciated.\n\n### **Issue Reporting**\n\nIf you encounter any issues or have feature requests, please submit an issue on GitHub. We have issue templates to guide you:\n\n- **Bug Report**\n- **Feature Request**\n- **Question**\n\nWhen submitting an issue, please provide as much detail as possible to help us address it effectively.\n\n### **Pull Requests**\n\nTo contribute code:\n\n1. **Fork the Repository**\n2. **Create a Feature Branch**\n\n   ```bash\n   git checkout -b feature/your-feature-name\n   ```\n\n3. **Commit Your Changes**\n\n   ```bash\n   git commit -am 'Add new feature'\n   ```\n\n4. **Push to Your Fork**\n\n   ```bash\n   git push origin feature/your-feature-name\n   ```\n\n5. **Submit a Pull Request**\n\n---\n\n## **License**\n\nRykeShell is released under the [MIT License](LICENSE).\n\n---\n\n## **Acknowledgments**\n\n- Inspired by traditional Unix shells and built with modern C++ features.\n- Thanks to all contributors who have helped improve RykeShell.\n\n---\n\n## **Contact**\n\nFor questions or suggestions, feel free to open an issue or reach out to the maintainer.\n\n---\n\n## **Note on Compilation**\n\nRykeShell makes use of C++20 features. Ensure your compiler supports C++20. You can check your `g++` version:\n\n```bash\ng++ --version\n```\n\nIf necessary, install a newer version of `g++`.\n\n### **Example Installation on Ubuntu**\n\n```bash\nsudo apt-get update\nsudo apt-get install g++-10\n```\n\nThen, compile using `g++-10`:\n\n```bash\ng++-10 -Wall -Wextra -std=c++20 -g -I../include -o RykeShell main.cpp utils.cpp input.cpp autocomplete.cpp parser.cpp executor.cpp commands.cpp -lncurses\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbisocm%2Frykeshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbisocm%2Frykeshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbisocm%2Frykeshell/lists"}