{"id":13895477,"url":"https://github.com/dl-tg/luash","last_synced_at":"2026-01-17T02:41:48.511Z","repository":{"id":186340587,"uuid":"674981172","full_name":"dl-tg/luash","owner":"dl-tg","description":"Extensible Lua terminal emulator","archived":false,"fork":false,"pushed_at":"2023-08-06T20:34:01.000Z","size":29,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-07T18:34:25.822Z","etag":null,"topics":["cli","lua","lua-script","shell","terminal","terminal-emulator"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/dl-tg.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}},"created_at":"2023-08-05T11:29:08.000Z","updated_at":"2024-01-15T05:35:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf5a4e6f-3ea5-4c66-ac41-95679aa4d63b","html_url":"https://github.com/dl-tg/luash","commit_stats":null,"previous_names":["dl-tg/luash"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-tg%2Fluash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-tg%2Fluash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-tg%2Fluash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-tg%2Fluash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dl-tg","download_url":"https://codeload.github.com/dl-tg/luash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226255412,"owners_count":17595860,"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","lua","lua-script","shell","terminal","terminal-emulator"],"created_at":"2024-08-06T18:02:14.759Z","updated_at":"2026-01-17T02:41:48.500Z","avatar_url":"https://github.com/dl-tg.png","language":"Lua","readme":"# Luash\n\nLuash is a simple interactive shell written in Lua that allows you to execute custom commands defined in separate Lua script files. It provides a convenient way to extend the shell with your own commands, making it more versatile and tailored to your needs.\n\n## Features\n\n  - Easy-to-use interactive shell environment\n  - Customizable commands through Lua script files\n  - Support for required and optional arguments with type validation\n  - Default values for optional arguments\n\n## Requirements\n\n  - Lua (5.1 or above)\n  - LuaFileSystem (lfs) library\n  - Luasocket library\n  - Luasec library\n\n## Usage\n\n1. Clone or download the repository to your local machine\n2. Make sure you have Lua and the LuaFileSystem, Luasec and Luasocket library installed\n   - Download Lua here https://www.lua.org/download.html\n   - To install the libraries, install luarocks and run\n     ```shell\n     luarocks install luafilesystem\n     luarocks install luasocket\n     luarocks install luasec\n     ```\n    \n3. Navigate to the Luash directory\n4. Run the core.lua script using the Lua interpreter:\n\n```bash\n\nlua core.lua\n```\nYou will be presented with the Luash prompt (\u003e) where you can enter commands.\n\n## Custom Commands\n\nTo add your custom commands, create Lua script files (the filename will be command's name, e.g hello.lua would create a hello command) in the cmds folder, defining your commands with the required structure. Each command should be defined as a Lua table with the following properties:\n\n  - `args` (table): A table defining the arguments for the command, including type and whether they are required or optional.\n    \n      - Argument definition format: {argIndex, argType, isRequired, defaultValue, argAlias}\n  \n          - `argIndex` (number): The position of the argument.\n  \n          - `argType` (string): The data type of the argument. Supported types: \"string\", \"number\", \"boolean\".\n  \n          - `isRequired` (boolean): Whether the argument is required (true) or optional (false).\n  \n          - `defaultValue` (any, optional): The default value for optional arguments. Only applicable if isRequired is false,                   set to `nil` if arg is required. The type of default value should match the type of the argument\n  \n          - `argAlias` (string, optional): An alias for the argument, used in usage error messages.\n\n    Note: To pass a string argument that contains spaces, wrap the entire string in single or double quotes.\n\n    - `usage` (string): A usage string that provides information about how to use the command.\n\n    - `Handler` (function): The function that implements the behavior of the command.\n\nExample of a custom command file (echo.lua):\n\n```lua\n\nlocal echo = {}\n\necho.args = {\n    {1, \"string\", true, nil, \"msg\"},\n    {2, \"number\", false, 14, \"num\"}\n}\necho.usage = \"echo msg num\"\n\nfunction echo.Handler(msg, num)\n    print(msg)\n    print(num)\nend\n\nreturn echo\n```\n## Reloading\n\nAt any time, you can type reload at the Luash prompt (\u003e) to manually reload the custom commands. This is useful if you make changes to the command script files and want to apply the changes during runtime.\n\nTo exit the Luash shell, simply type exit.\n\n## Examples\n\n1. Execute the echo command with a string and a number:\n\n```shell\n\n\u003e echo 'Hello, Luash!' 42\nHello, Luash!\n42\n```\n2. Execute the echo command with only a string (optional argument will use the default value):\n\n```shell\n\n\u003e echo 'Hello, Luash!'\nHello, Luash!\n14\n```\n3. Execute the reload command to reload the custom commands after making changes:\n\n```shell\n\n\u003e reload\nReloading the commands...\nSuccess!\n```\n## Contributions\n\nIf you encounter any issues, have suggestions, or want to contribute new features, feel free to create a pull request or open an issue on GitHub.\nIf you want to contribute but are unsure how, refer to the official GitHub guide on [Contributing to projects](https://docs.github.com/en/get-started/quickstart/contributing-to-projects).\n\n## License\n\nLuash is open-source software licensed under the [MIT License](LICENSE).\n","funding_links":[],"categories":["Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-tg%2Fluash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdl-tg%2Fluash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-tg%2Fluash/lists"}