{"id":21470916,"url":"https://github.com/saadarazzaq/command-shell","last_synced_at":"2025-03-17T06:45:07.629Z","repository":{"id":244706812,"uuid":"816021220","full_name":"SaadARazzaq/Command-Shell","owner":"SaadARazzaq","description":"Command Shell implemented in Python with important functionalities 🐚🐍","archived":false,"fork":false,"pushed_at":"2024-06-16T21:03:02.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T16:14:20.995Z","etag":null,"topics":["cli","cmd","command-line-interface","command-shell","documentation","python"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/watch?v=I4EWvMFj37g","language":"Python","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/SaadARazzaq.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}},"created_at":"2024-06-16T20:56:31.000Z","updated_at":"2024-06-16T21:09:51.000Z","dependencies_parsed_at":"2024-06-16T22:03:53.128Z","dependency_job_id":null,"html_url":"https://github.com/SaadARazzaq/Command-Shell","commit_stats":null,"previous_names":["saadarazzaq/command-shell"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaadARazzaq%2FCommand-Shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaadARazzaq%2FCommand-Shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaadARazzaq%2FCommand-Shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaadARazzaq%2FCommand-Shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaadARazzaq","download_url":"https://codeload.github.com/SaadARazzaq/Command-Shell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243988956,"owners_count":20379649,"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","cmd","command-line-interface","command-shell","documentation","python"],"created_at":"2024-11-23T09:29:44.299Z","updated_at":"2025-03-17T06:45:07.610Z","avatar_url":"https://github.com/SaadARazzaq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Command Shell\n\n## Overview\nThis Python-based Command Shell is a simple CLI (Command Line Interface) application that mimics basic functionalities of a typical shell. It allows users to navigate directories, list contents, execute external commands, and customize the shell prompt.\n\n## Features\n- Change directory (`cd`)\n- List directory contents (`ls`)\n- Execute external commands\n- Exit the shell (`exit`)\n- Customize the shell prompt (`prompt`)\n\n## Requirements\n- Python 3.x\n\n## Installation\n1. Ensure you have Python 3.x installed on your system.\n2. Download or clone the shell script to your local machine.\n\n## How to Use\n1. Open your terminal or command prompt.\n2. Navigate to the directory where the script is located.\n3. Run the script using Python:\n    ```sh\n    python shell.py\n    ```\n\n## Commands\n### `cd \u003cdirectory\u003e`\n- Change the current working directory.\n- Example:\n    ```sh\n    cd /path/to/directory\n    ```\n\n### `ls [directory]`\n- List the contents of the specified directory. If no directory is specified, it lists the contents of the current directory.\n- Example:\n    ```sh\n    ls /path/to/directory\n    ```\n\n### `exit`\n- Exit the shell.\n\n### `prompt \u003cformat\u003e`\n- Customize the shell prompt format.\n- Placeholders:\n  - `$PWD$`: Current working directory\n  - `$HOME$`: Home directory\n- Example:\n    ```sh\n    prompt MyShell:$PWD$\u003e \n    ```\n\n### Executing External Commands\n- Any command not recognized as a built-in command will be executed as an external command using `subprocess.run`.\n- Example:\n    ```sh\n    python --version\n    ```\n\n## Output Screenshots\n\n![image](https://github.com/SaadARazzaq/Command-Shell/assets/123338307/8edf1f68-0d40-486f-a7d4-dc5160a169b5)\n\n## Test Cases:\n\n![image](https://github.com/SaadARazzaq/Command-Shell/assets/123338307/433dca4b-455f-4bbd-83d8-9d4bdf6a435c)\n![image](https://github.com/SaadARazzaq/Command-Shell/assets/123338307/0a2fc73e-abdb-4431-89a9-fd19cf261842)\n\n## Developer Notes\n- The shell uses the `os` module for directory operations and the `subprocess` module to run external commands.\n- The `self.prompt_format` variable stores the format of the shell prompt, which can be customized using the `prompt` command.\n- The `handle_command` method parses user input and calls the appropriate method to handle the command.\n\n## Future Enhancements\n- Add support for more built-in commands.\n- Implement command history and autocomplete features.\n- Improve error handling and user feedback.\n\n---\n\nEnjoy using the Command Shell! If you encounter any issues or have suggestions for improvements, feel free to contribute or open an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadarazzaq%2Fcommand-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaadarazzaq%2Fcommand-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadarazzaq%2Fcommand-shell/lists"}