{"id":30805180,"url":"https://github.com/skryvvara/clsh","last_synced_at":"2025-09-06T00:52:47.093Z","repository":{"id":249528373,"uuid":"831756196","full_name":"Skryvvara/clsh","owner":"Skryvvara","description":"CLSH is a lightweight, experimental Lua scripting host written in C. The goal of this project is to learn and explore the possibilities with C and Lua.","archived":false,"fork":false,"pushed_at":"2024-07-25T17:27:06.000Z","size":416,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-25T20:18:28.534Z","etag":null,"topics":["clang","lua"],"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/Skryvvara.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-07-21T14:38:44.000Z","updated_at":"2024-07-25T17:32:39.000Z","dependencies_parsed_at":"2024-07-25T19:59:52.490Z","dependency_job_id":"55445c63-ba81-4d56-a869-cbf42202d447","html_url":"https://github.com/Skryvvara/clsh","commit_stats":null,"previous_names":["skryvvara/clsh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Skryvvara/clsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skryvvara%2Fclsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skryvvara%2Fclsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skryvvara%2Fclsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skryvvara%2Fclsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Skryvvara","download_url":"https://codeload.github.com/Skryvvara/clsh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skryvvara%2Fclsh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273842867,"owners_count":25177921,"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-09-05T02:00:09.113Z","response_time":402,"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":["clang","lua"],"created_at":"2025-09-06T00:52:45.936Z","updated_at":"2025-09-06T00:52:47.076Z","avatar_url":"https://github.com/Skryvvara.png","language":"C","readme":"\u003cdiv id=\"top\"\u003e\u003c/div\u003e\n\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/skryvvara/clsh\"\u003e\n      \u003cimg src=\"./.github/assets/clsh.svg\" width=124 height=124 alt=\"CLSH Logo\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eCLSH - A \u003ca href=\"http://lua.org\" target=\"_BLANK\"\u003eLua\u003c/a\u003e scripting host written in C\u003c/h3\u003e\n\u003c/div\u003e\n\n## Description\n\n\u003e ! This is a very early proof of concept\n\nCLSH is a [Lua](https://lua.org) scripting host written in C.\n\n## Build\n\nYou can build clsh using cmake, first verify that cmake and a c++ compiler is installed.\nThe Lua sources are included in the lib/lua directory, therefore no external packages or an internet connection is required.\n\n```sh\ncmake --version\n\n#cmake version 3.30.0\n#\n#CMake suite maintained and supported by Kitware (kitware.com/cmake).\n\nclang --version\n\n#Apple clang version 15.0.0 (clang-1500.3.9.4)\n#Target: arm64-apple-darwin23.5.0\n#Thread model: posix\n#InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin\n```\n\nnow run the steps below to compile and run the code\n\n```sh\nmkdir build\ncd build\n\ncmake ..\nmake\n\n./clsh\n# usage: ./clsh [file]\n```\n\n## Usage\n\nCurrently the only supported usage is by providing a lua file as the first argument to CLSH.\n\nExample:\n```sh\n./clsh\n\n./clsh\n# usage: ./clsh [file]\n\n./clsh ../scripts/test.lua\n# Hi from test.lua\n```\n\nAlternatively you can use the shebang notation to run the lua scripts directly, to do this some preperation\nis necessary.\n\n1. Copy the clsh binary to a directory in your path\n```sh\necho $PATH\ncp ./clsh /dir/in/path/clsh\n\n# example:\n# I have a directory called $HOME/bin containing the clsh binary\n\nmkdir ~/bin\necho \"export PATH=$PATH:$HOME/bin \u003e\u003e .zshrc\ncp ./clsh $HOME/bin/clsh\n```\n2. Now create a lua script with the shebang line. You can find an example under scripts/shebang.lua\n```lua\n#!/usr/bin/env clsh\n\n-- test.lua\nprint(\"Hi from shebang.lua\")\n```\n3. Check the permissions for the lua script, if you are using this method the script itself has to be executable\n```sh\nchmod +x ./scripts/shebang.lua\n./scripts/shebang.lua\n# Hi from shebang.lua\n```\n4. (optional) copy the script to a location within your path\n```sh\ncp shebang.lua $HOME/bin/shebang\n\nshebang\n# Hi from shebang.lua\n```\n\n## License\n\nCLSH is licensed under the [MIT License](https://opensource.org/license/mit).\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://lua.org\"\u003e\n      \u003cimg src=\"./.github/assets/lua.gif\" width=124 height=124 alt=\"powered by lua logo\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskryvvara%2Fclsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskryvvara%2Fclsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskryvvara%2Fclsh/lists"}