{"id":14966144,"url":"https://github.com/spitsh/spitsh","last_synced_at":"2025-10-25T13:31:15.167Z","repository":{"id":46767176,"uuid":"84067885","full_name":"spitsh/spitsh","owner":"spitsh","description":"👻The Spook in the Shell🐚 compiler","archived":true,"fork":false,"pushed_at":"2023-02-03T04:05:58.000Z","size":1015,"stargazers_count":22,"open_issues_count":6,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-23T11:27:00.809Z","etag":null,"topics":["compiler","configuration-management","devops","perl6","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spitsh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-03-06T11:56:25.000Z","updated_at":"2024-10-28T02:34:10.000Z","dependencies_parsed_at":"2024-09-14T02:09:04.434Z","dependency_job_id":null,"html_url":"https://github.com/spitsh/spitsh","commit_stats":{"total_commits":915,"total_committers":5,"mean_commits":183.0,"dds":"0.0043715846994535346","last_synced_commit":"f50edd5bfce3370c2a7c23ee64c2013472b5500c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spitsh%2Fspitsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spitsh%2Fspitsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spitsh%2Fspitsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spitsh%2Fspitsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spitsh","download_url":"https://codeload.github.com/spitsh/spitsh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238147594,"owners_count":19424291,"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":["compiler","configuration-management","devops","perl6","shell-script"],"created_at":"2024-09-24T13:35:55.281Z","updated_at":"2025-10-25T13:31:14.682Z","avatar_url":"https://github.com/spitsh.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 👻 Spook in the Shell 👻 (Spit-sh) [![Build Status](https://travis-ci.org/spitsh/spitsh.svg?branch=master)](https://travis-ci.org/spitsh/spitsh)\n\n**Sp**ook **i**n **t**he **Sh**ell (Spit or Spit-sh) is a\nlanguage/compiler that outputs shell scripts. It compiles a strongly\ntyped Perl 6 like language called \"Spook\" into `/bin/sh` compatible\nscripts. It's main purpose is devops/infrastructure related\ntasks. Current features include:\n\n- Compile time type checking\n- Basic libraries/modules\n- Test module for outputting TAP\n- Useful builtin classes and functions\n- Running and testing scripts in Docker\n- Logging to standard output\n\nEverything about the language and compiler is still experimental. I am\nthinking about pivoting a bit into compiling golang to create\nstandalone binaries instead of shell scripts. 🤔\n\n## Example\nTo get an idea of what Spit is consider the following basic program:\n\n``` perl6\n.install unless Pkg\u003cnc\u003e; # install nc unless it's already there\nok Cmd\u003cnc\u003e,\"nc command exists now\"; # test the nc command is there\n\n```\n\nYou can compile this for CentOS from the command line like:\n\n``` shell\nspit eval --os=centos  '.install unless Pkg\u003cnc\u003e; ok Cmd\u003cnc\u003e,\"nc command exists now\"'\n```\n\nWhich ouputs the following shell at the time of writing:\n\n``` shell\nBEGIN(){\n  e(){ printf %s \"$1\"; }\n  exec 4\u003e/dev/null\n  installed(){ yum list installed \"$1\" \u003e\u00264 2\u003e\u00264; }\n  install(){ yum install -y $1 \u003e\u00264 2\u003e\u00264; }\n  exists(){ command -v \"$1\" \u003e\u00264; }\n  exec 3\u003e\u00261\n  say(){ printf '%s\\n' \"$1\" \u003e\u00263; }\n  note(){ printf '%s\\n' \"$1\" \u003e\u00262; }\n  die(){ note \"$1\" \u0026\u0026 kill \"-TERM\" $$ \u003e\u00264; }\n  ok(){ test \"$1\" \u0026\u0026 say \"✔ - $2\" || die \"✘ - $2\"; }\n}\nMAIN(){\n  if ! installed nc; then\n    install nc\n  fi\n  ok \"$(exists nc \u0026\u0026 e 1)\" 'nc command exists now'\n}\nBEGIN \u0026\u0026 MAIN\n```\nIf you have docker installed you can test this with:\n\n``` shell\nspit eval --in-docker=centos '.install unless Pkg\u003cnc\u003e; ok Cmd\u003cnc\u003e,\"nc command exists now\"'\n✔ - nc command exists now\n```\n\nUnfortunately on Debian the package is named 'netcat'. Let's deal with that:\n\n``` perl6\n# install-nc.sp\nconstant Pkg $nc = on {\n    Debian { 'netcat' }\n    Any    { 'nc' } # the default\n};\n\n.install unless $nc;\nok Cmd\u003cnc\u003e,\"nc command exists now\";\n```\n\nAnd now it should work on both the RHEL and Debian families of\nLinux distributions.\n\n```\nspit  compile install-nc.sp --in-docker=debian:latest\n✔ - nc command exists now\n```\n\n## Install\n\nSpit is written in Perl 6 and\nrequires [rakudo](https://github.com/rakudo/rakudo) and something to\ninstall Perl 6 ecosystem modules with\nlike [zef](https://github.com/ugexe/zef).\n\n```shell\nzef install Spit\n```\nand run\n```shell\nspit eval 'say \"hello world\"'\n```\nTo check it's working.\n\n## Documentation\n\nThe documentation is pretty useless at the moment because the tooling has\nfallen far behind the language. What exists is under: [doc/](doc).\n\n## Project Layout\n\n* The Perl 6 Spit compiler module is in `lib`\n* The actual Spit source code is under `resources/src`\n* The core spit modules are under `resouces/core-lib`\n* The spec tests are in `spec`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspitsh%2Fspitsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspitsh%2Fspitsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspitsh%2Fspitsh/lists"}