{"id":17382193,"url":"https://github.com/coderofsalvation/powscript","last_synced_at":"2025-04-12T22:18:20.714Z","repository":{"id":57329174,"uuid":"51869822","full_name":"coderofsalvation/powscript","owner":"coderofsalvation","description":"transpiler written in bash: painless shellscript, indentbased, coffee for the shell with hipster-sparkles v1 BETA LANDED 🎉🎉🎉🎉 thanks fcard!","archived":false,"fork":false,"pushed_at":"2024-12-13T16:48:43.000Z","size":808,"stargazers_count":162,"open_issues_count":15,"forks_count":13,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-04T12:36:03.244Z","etag":null,"topics":["bash","coffeescript","transpiler"],"latest_commit_sha":null,"homepage":"http://powscript.isvery.ninja/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderofsalvation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://gumroad.com/l/hGYGh"}},"created_at":"2016-02-16T20:59:57.000Z","updated_at":"2025-02-05T21:50:52.000Z","dependencies_parsed_at":"2025-02-07T10:11:21.671Z","dependency_job_id":"0deaf5e3-4bf0-4d93-a1e4-e5dc161df787","html_url":"https://github.com/coderofsalvation/powscript","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fpowscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fpowscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fpowscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fpowscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderofsalvation","download_url":"https://codeload.github.com/coderofsalvation/powscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248316339,"owners_count":21083429,"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":["bash","coffeescript","transpiler"],"created_at":"2024-10-16T07:35:46.323Z","updated_at":"2025-04-12T22:18:20.679Z","avatar_url":"https://github.com/coderofsalvation.png","language":"Shell","readme":"\u003cimg alt=\"\" src=\".tools/pow.png\" width=\"12%\" style=\"width:12%\"/\u003e\n\n[![Travis build status](https://travis-ci.org/coderofsalvation/powscript.svg?branch=master)](https://travis-ci.org/coderofsalvation/powscript.svg?branch=master)\n\nwrite shellscript in a powful way!\n\n## Usage\n\n    $ wget \"https://raw.githubusercontent.com/coderofsalvation/powscript/master/powscript\" -O /usr/local/bin/powscript \u0026\u0026 chmod 755 /usr/local/bin/powscript\n    $ powscript myscript.pow                          # run directly\n    $ powscript -c myscript.pow \u003e myscript            # output bashscript\n    $ powscript -c --to sh myscript.pow \u003e myscript.sh # output sh-script (experimental)\n\n* [unnoficial AUR package](https://aur.archlinux.org/packages/powscript/)\n\n## Wiki\n\n* [Syntax reference](https://github.com/coderofsalvation/powscript/blob/master/doc/reference.md)\n* [ Modules / Developer Info / Contribution / Similar Projects / Why ](https://github.com/coderofsalvation/powscript/wiki)\n\n## Example\n\n    #!/usr/bin/env powscript\n    require_cmd 'echo'\n    require_env 'TERM'\n\n    error(msg exitcode)\n      echo \"error: $msg\"\n      if set? $exitcode\n        exit $exitcode\n\n    run(@args -- foo)\n      if empty? foo\n        error \"please pass --foo \u003cstring\u003e\" 1\n      echo $args[@] \"$foo universe!!\"\n      echo \"HOME=$HOME\"\n\n    run $@\n\nOutput:\n\n    $ powscript -c foo.pow -o foo.bash\n    $ ./foo.bash hello --foo powful\n    hello powful universe!\n    HOME=/home/yourusername\n\nCheck a [json example here](https://github.com/coderofsalvation/powscript/blob/master/doc/json.md) and \u003ca href=\"https://github.com/coderofsalvation/powscript/wiki/Reference\"\u003ehere\u003c/a\u003e for more examples\n\n## Features\n\n* indentbased, memorizable, coffeescript-inspired syntax\n* removes semantic noise like { ! [[ @ ]] || ~=\n* safetynets: automatic quoting, halt on error or missing dependencies (`require_cmd`,`require_env`)\n* comfort: [json, easy arrays, easy async, functional programming](https://github.com/coderofsalvation/powscript/blob/master/doc/reference.md), named variables instead of positionals\n* [Modules / bundling](https://github.com/coderofsalvation/powscript/blob/master/doc/modules-example.md)\n* [remote/local packages \u0026 dependencies](http://github.com/coderofsalvation/powscript/blob/master/doc/dependencies-and-packages.md)\n* written/generated for bash \u003e= 4.x, 'zero'-dependency solution for embedded devices e.g.\n* hasslefree: easy installation without gcc compilation/3rd party software\n\n## Examples\n\n* [m3uchecker (19 lines powscript vs 57 lines bash)](https://gist.github.com/coderofsalvation/b1313d287c1f0a7e6cdf)\n* [pm.sh](https://github.com/coderofsalvation/pm.sh)\n* [Collection of codesnippets](https://github.com/coderofsalvation/powscript/blob/master/doc/reference.md)\n\n## Interactive mode (experimental)\n\nPut this line in your `.inputrc`:\n\n    \"\\C-p\" \"powscript --interactive\\n\"\n\nThen hitting ctrl-p in your console will enter powscript mode:\n\n    hit ctrl-c to exit powscript, type 'edit' to launch editor, and 'help' for help\n    \u003e each(line)\n    \u003e   echo line=$line\n    \u003e run()\n    \u003e   tail -2 ~/.kanban.csv | mappipe each\n    \u003e run\n    line=1,foo,bar,flop\n    line=2,foo2,bar2,flop2\n    \u003e\n\n## POSIX /bin/sh compatibility\n\nPowscript can produce 'kindof' POSIX `/bin/sh`-compatible output by removing bashisms, by introducing the `--sh` flag:\n\n    $ powscript --c foo.pow -o foo.bash\n    $ powscript --to sh --c foo.pow -o foo.sh\n\nThis however, is experimental, as well as the standalone bash2sh converter:\n\n    $ cat foo.bash | powscript --to sh  \u003e foo.sh\n\n\u003e NOTE: remove bashisms manually using docs/tools like [bashism guide](http://mywiki.wooledge.org/Bashism) or [checkbashisms](https://linux.die.net/man/1/checkbashisms)\n\u003e The general rule for POSIX sh-output is: `don't write bashfeatures in powscript`\n\n## Debug your powscript syntax\n\nSee [FAQ](doc/FAQ.md)\n\n## OSX users\n\nOSX might protest since it isn't quite GNU focused. Please run these commands after installing:\n\n    $ brew install bash\n    $ brew install coreutils gnu-sed grep gawk --default-names\n    $ echo 'export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH' \u003e\u003e ~/.bashrc\n    $ sed -i 's|#!/bin/bash|#!/usr/local/bin/bash|g' powscript\n\n## Live expansion inside editor\n\n\u003e HINT: use live expansion inside vim.\n\u003e Put the lines below in .vimrc and hit 'p\u003e' in normal/visual mode to expand powscript to bash\n\n    vmap p\u003e :!PIPE=2 powscript -c\u003cCR\u003e\n    nmap p\u003e ggVG:!PIPE=2 powscript -c\u003cCR\u003e\n\n","funding_links":["https://gumroad.com/l/hGYGh"],"categories":["Shell","Shell Script Development"],"sub_categories":["Directory Navigation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fpowscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderofsalvation%2Fpowscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fpowscript/lists"}