{"id":19852633,"url":"https://github.com/jhubi1/megashell","last_synced_at":"2025-07-23T02:34:53.554Z","repository":{"id":184825032,"uuid":"672490485","full_name":"JHubi1/MegaShell","owner":"JHubi1","description":"MegaShell is a fully functional terminal written in Python.","archived":false,"fork":false,"pushed_at":"2023-07-30T12:57:34.000Z","size":190,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-17T02:45:58.478Z","etag":null,"topics":["python-terminal"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JHubi1.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":"2023-07-30T09:08:04.000Z","updated_at":"2025-02-21T15:57:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"abf9e7e8-5657-4f9a-a1e6-34784e9945c6","html_url":"https://github.com/JHubi1/MegaShell","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"0184e4675e779f3cc68e5ae865da27ab6b0ebdae"},"previous_names":["jhubi1/megashell"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JHubi1/MegaShell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JHubi1%2FMegaShell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JHubi1%2FMegaShell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JHubi1%2FMegaShell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JHubi1%2FMegaShell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JHubi1","download_url":"https://codeload.github.com/JHubi1/MegaShell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JHubi1%2FMegaShell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266606828,"owners_count":23955351,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["python-terminal"],"created_at":"2024-11-12T14:03:45.798Z","updated_at":"2025-07-23T02:34:53.535Z","avatar_url":"https://github.com/JHubi1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MegaShell\nThis is a fully functional terminal written in Python.\n\nContent:\n- [MegaShell](#megashell)\n- [Installation](#installation)\n  - [Python](#python)\n  - [EXE Installer (Windows only!)](#exe-installer-windows-only)\n- [Usage](#usage)\n  - [Creating commands](#creating-commands)\n    - [Parsing V1](#parsing-v1)\n    - [Parsing V2](#parsing-v2)\n  - [Creating constants](#creating-constants)\n- [Contributing](#contributing)\n- [License](#license)\n\n![Terminal1: Terminal](images/terminal1.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eSee more screenshots\u003c/summary\u003e\n\n  ![Terminal2: Echo Hello World](images/terminal2.png)\n  ![Terminal2: Echo version](images/terminal3.png)\n  ![Terminal2: Example test command](images/terminal4.png)\n\u003c/details\u003e\n\n# Installation\nThere are two ways of installation. Either from Python or as an EXE installer.\n\n## Python\nThis probably works for all operating systems, but I only tested this on Windows and (Kali) Linux.\nAt the moment the installation process is simple. Just follow these steps:\n- Download this repository\n- Put all files in a new dictionary on your system\n- Start 'main.py'\n  - Windows: Double-click on the file icon\n  - Other: Run `python3 main.py` in the file folder\n\n## EXE Installer (Windows only!)\nDownload the latest installer from this repository.\nStart it and follow all steps.\n\n![Installer1: Terms of Service](images/installer1.png)\n\n# Usage\nIn general, MegaShell is a program in which any command can be added.\nThe easiest way to do that is by simply creating a new file in the subfolder named 'commands'. The name can be anything you want.\nAfter creating a file just import the default libraries.\n\nYou get the most important one by just importing:\n```python\nfrom files import internal as i\n```\n\nWe recommend you also import the following to create a new command as quickly as possible.\n```python\n# Get all information about the current MegaShell instance\nfrom files.internal import info as inf\n\n# Print library, highly recommended!\nfrom files.internal import tools as t\n\n# Print `errors`, `info`, etc\nfrom files.internal import outputLibrary as ol\n\n# The following is needed to create commands\nfrom files.internal import commands as c\n\n# This is needed to create constants like `%VERSION%` \nfrom files.internal import constants as const\n\n# Needed when using parsing `v2`, highly recommended!\nfrom files.commandtools import commandtools as ct\n```\n_**Important:**_ In the following documentation, we use short names like `inf` or `c`! If you use your one imports, make sure to use your names too!\n\n## Creating commands\nIn this section, we talk about, how to create a command from \"scratch\".\n\n### Parsing V1\nAfter that just type this in your created file:\n```python\n@c.command\ndef c_name(*extra):\n    \"\"\"v1\"\"\"\n    t.fprint(\"Well done!\")\n```\nHere is the explanation:\n- By this, you created a command named `name` that prints `\"Well done!\"`.\n- The version, in this case, `v1`, specifies how to parse the given arguments. It can be `v1` or `v2`\n- In `v1` only one attribute is allowed named `*extra` with just one star (!)\n\n### Parsing V2\nNow we talk about parsing `v2`, it's a bit more complex but can be used much more easily to get specific arguments.\n```python\n@c.command\ndef c_test(a=\"\", b=\"\", **extra):\n    \"\"\"v2\"\"\"\n    a, b = ct.parse(extra, a, b)\n    t.fprint(\"a: \" + a)\n    t.fprint(\"b: \" + b)\n```\nIf you read all of this, you see, this command is named `test`. The parsing version is set to `v2`.\nThe set variables are the ones you want to use. In this example you have to run the command like this:\n```bash\ntest --a aValue --b \"Value for B\"\n```\nOutput:\n```\na: aValue\nb: Value for B\n```\nYou see strings with `'` and `\"` are parsed too. The `**extra` argument is always needed to prevent errors. Unlike the one in `v1`, this is typed with two stars!\nThe function `commandtools.parse()` is called to translate the `extra` dictionary to the arguments.\nThat means you can also run the following command and still get the same output as given above.\n```bash\ntest \"aValue\" --b \"Value for B\"\n# OR\ntest --a aValue \"Value for B\"\n# OR\ntest aValue \"Value for B\"\n```\nOutput from all three:\n```\na: aValue\nb: Value for B\n```\n_**Important:**_ When running a command, a definition only ends, if a value is given or if another definition starts (then the value is `True`). That means, if a function wants the two arguments `a` and `a`, it doesn't care about any value, that is completed, but if it takes away something an error is fired.\n![UsageV2Img1: Error Example](images/usage-v2-img1.png)\n\n## Creating constants\nGenerally speaking, it's very easy to generate and use a constant. To create one just call the function `const.constants()`.\n```python\nconst.constant(\"VERSION\", inf.VERSION)\n```\nWith this, you created the constant `VERSION` that returns the MegaShell version. You can use this by adding the name between two `%` in your command.\n```bash\necho %VERSION%\n# OR\necho %version%\n```\nThe names can be executed in full upper or lowercase, so you can initial `VERSION` like this too, and get the same result.\n```python\nconst.constant(\"VerSioN\", inf.VERSION)\n```\n\n# Contributing\nThis is a small project by me ([@JHubi1](https://github.com/JHubi1)) and I don't have any help yet.\n\n# License\n(See in `LICENSE`)\n```text\nCopyright 2023 Xenia Software\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhubi1%2Fmegashell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhubi1%2Fmegashell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhubi1%2Fmegashell/lists"}