{"id":29308584,"url":"https://github.com/itshsvm/hsh","last_synced_at":"2026-04-18T14:04:30.057Z","repository":{"id":302857997,"uuid":"1013742085","full_name":"itshsvm/hsh","owner":"itshsvm","description":"simple command line writted with rust","archived":false,"fork":false,"pushed_at":"2025-07-14T10:08:24.000Z","size":20,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T11:18:10.192Z","etag":null,"topics":["command","rust","shell"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itshsvm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-07-04T11:45:33.000Z","updated_at":"2025-07-14T10:08:27.000Z","dependencies_parsed_at":"2025-07-04T13:54:44.260Z","dependency_job_id":null,"html_url":"https://github.com/itshsvm/hsh","commit_stats":null,"previous_names":["itshsvm/hsh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itshsvm/hsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itshsvm%2Fhsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itshsvm%2Fhsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itshsvm%2Fhsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itshsvm%2Fhsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itshsvm","download_url":"https://codeload.github.com/itshsvm/hsh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itshsvm%2Fhsh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["command","rust","shell"],"created_at":"2025-07-07T07:14:06.163Z","updated_at":"2026-04-18T14:04:27.712Z","avatar_url":"https://github.com/itshsvm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HSH: A Simple Shell in Rust\n\n\nHSH (Hobby SHell) is a basic command-line shell implemented in **Rust**. This project goes beyond just a simple command executor; it serves as a practical, hands-on example for understanding the core mechanics of a shell. It demonstrates fundamental concepts of system programming, including command parsing, interacting with the file system, and basic process control in a safe and efficient language like Rust. HSH is designed to be extensible, providing a solid foundation for exploring more advanced shell features.\n\n## ✨ Features\n\nHSH provides the following built-in commands:\n\n* **`read \u003cfile\u003e`**: Reads and displays the content of a specified file to the console.\n* **`ls`**: Lists the contents of the current working directory. By default, it hides files and directories that start with a dot (`.`) on Unix-like systems, offering a cleaner view.\n* **`clear`**: Clears the terminal screen, providing a fresh workspace.\n* **`cd \u003cdirectory\u003e`**: Changes the current working directory. Supports relative and absolute paths.\n* **`exit`**: Gracefully terminates the shell session.\n* **`touch \u003cfile\u003e`**: Creates a new, empty file if it doesn't exist. If the file already exists, it updates its last modified timestamp to the current time without altering the file's content.\n\n## 🚀 Getting Started\n\nThese instructions will help you get HSH up and running on your local machine for development and testing.\n\n### Prerequisites\n\nYou'll need **Rust and Cargo** installed on your system. If you don't have them, the easiest way to install them is via `rustup`:\n\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs) | sh\n````\n\n### Installation\n\n1.  **Clone the repository:**\n\n    ```bash\n    git clone https://github.com/itshsvm/hsh.git\n    cd hsh\n    ```\n\n2.  **Build the project:**\n\n    ```bash\n    cargo build --release\n    ```\n\n    This command compiles the project in **release mode**, which generates an optimized executable for better performance.\n\n3.  **Run the shell:**\n\n    ```bash\n    ./target/release/hsh\n    ```\n\n    You should now see the `hsh\u003e` prompt, ready for your commands\\!\n\n## 💡 Usage\n\nOnce the shell is running, you can type any of the supported commands at the `hsh\u003e` prompt and press `Enter`.\n\n```bash\nhsh \u003e ls\nsrc   target   README.md   Cargo.toml\n\nhsh \u003e touch new_document.txt\n\nhsh \u003e read README.md\n# HSH: A Simple Shell in Rust\n...\n\nhsh \u003e set lang=Rust\nhsh \u003e echo Welcome to $lang programming.\n# Welcome to Rust programming.\n\nhsh \u003e set lang=Rust name=Hesam\nhsh \u003e set\n# name=Hesam\n# lang=Rust\n\nhsh \u003e export editor=nvim\nhsh \u003e env\n# editor=nvim\n\nhsh \u003e unset name\nhsh \u003e set\n# lang=Rust\n# editor=nvim\n\nhsh \u003e rm -v new_document.txt\n# removed 'new_document.txt'\n\nhsh \u003e mkdir mydir\nhsh \u003e rmdir -v mydir\n# removed directory 'mydir'\n\nhsh \u003e cd src\nhsh \u003e pwd\n/current/directory/src\n\nhsh \u003e clear\n# (the terminal screen will clear)\n\nhsh \u003e exit\n# (shell session ends)\n```\n\n### 🧠 Supported Flags\n\n| Command   | Flags       | Description                                                           |\n|-----------|-------------|------------------------------------------------------------------------|\n| ls      | -a         | Show hidden files (those starting with `.`)                            |\n|           | -l         | Display in long listing format                                         |\n| rm      | -f         | Force removal; ignore nonexistent files and suppress errors           |\n|           | -v         | Verbose mode; print each file as it is removed                        |\n| rmdir   | -v         | Verbose mode; print each directory as it is removed                   |\n| cat     | —         | Number all output lines                                               |\n|           | —         | Display $ at the end of each line                                   |\n| echo    | —         | Do not output the trailing newline                                     |\n| clear   | —            | Clears the terminal screen                                             |\n| cd      | —            | Change current working directory                                       |\n| touch   | —            | Create an empty file or update its modification timestamp             |\n| read    | —            | Print the contents of a file                                           |\n| set     | —            | Set or view internal shell variables                                   |\n| export  | —            | Export a variable to environment for child processes                   |\n| unset   | —            | Remove a variable from shell scope                                     |\n| env     | —            | List currently exported environment variables                          |\n\n-----\n\n## 📋 TODO\n\nHSH is an ongoing project, and there are many features planned for future development:\n\n  * **External Command Execution**: Allow running commands that are not built-in (e.g., `git`, `python`, `code`). This involves searching the `PATH` environment variable and spawning child processes.\n  * **Command History**: Implement an in-memory history of executed commands that can be navigated with arrow keys.\n  * **Tab Completion**: Enable auto-completion for commands and file paths.\n  * **Piping (`|`)**: Support redirecting the output of one command as the input to another.\n  * **Input/Output Redirection (`\u003e`, `\u003e\u003e`, `\u003c`)**: Allow directing command output to files or reading input from files.\n  * **Background Processes (`\u0026`)**: Run commands in the background without blocking the shell.\n  * **More Built-in Commands**:\n      * `pwd`: Print current working directory. [Done]\n      * `mkdir`: Create new directories.\n      * `rm`: Remove files or directories. [Done]\n      * `cp`: Copy files or directories.\n      * `mv`: Move/rename files or directories.\n      * `echo`: Print arguments to stdout. [Done]\n  * **Environment Variables**: Support setting, getting, and listing environment variables. [Done]\n  * **Error Handling Improvements**: More robust and user-friendly error messages for various scenarios.\n  * **Prompt Customization**: Allow users to customize the shell prompt.\n\n-----\n\n## 🤝 Contributing\n\nContributions are always welcome\\! If you have suggestions for new features, improvements, or bug fixes, please feel free to:\n\n1.  **Open an issue**: Describe the bug or suggest an enhancement.\n2.  **Submit a pull request**: Fork the repository, make your changes, and then submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitshsvm%2Fhsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitshsvm%2Fhsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitshsvm%2Fhsh/lists"}