• Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    Shell
  • License
    Other
  • Created almost 9 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

transpiler written in bash: painless shellscript, indentbased, coffee for the shell with hipster-sparkles v1 BETA LANDED ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ thanks fcard!

Travis build status

write shellscript in a powful way!

Usage

$ wget "https://raw.githubusercontent.com/coderofsalvation/powscript/master/powscript" -O /usr/local/bin/powscript && chmod 755 /usr/local/bin/powscript
$ powscript myscript.pow                          # run directly
$ powscript -c myscript.pow > myscript            # output bashscript
$ powscript -c --to sh myscript.pow > myscript.sh # output sh-script (experimental)

Wiki

Example

#!/usr/bin/env powscript
require_cmd 'echo'
require_env 'TERM'

error(msg exitcode)
  echo "error: $msg"
  if set? $exitcode
    exit $exitcode

run(@args -- foo)
  if empty? foo
    error "please pass --foo <string>" 1
  echo $args[@] "$foo universe!!"
  echo "HOME=$HOME"

run $@

Output:

$ powscript -c foo.pow -o foo.bash
$ ./foo.bash hello --foo powful
hello powful universe!
HOME=/home/yourusername

Check a json example here and here for more examples

Features

Examples

Interactive mode (experimental)

Put this line in your .inputrc:

"\C-p" "powscript --interactive\n"

Then hitting ctrl-p in your console will enter powscript mode:

hit ctrl-c to exit powscript, type 'edit' to launch editor, and 'help' for help
> each(line)
>   echo line=$line
> run()
>   tail -2 ~/.kanban.csv | mappipe each
> run
line=1,foo,bar,flop
line=2,foo2,bar2,flop2
>

POSIX /bin/sh compatibility

Powscript can produce 'kindof' POSIX /bin/sh-compatible output by removing bashisms, by introducing the --sh flag:

$ powscript --c foo.pow -o foo.bash
$ powscript --to sh --c foo.pow -o foo.sh

This however, is experimental, as well as the standalone bash2sh converter:

$ cat foo.bash | powscript --to sh  > foo.sh

NOTE: remove bashisms manually using docs/tools like bashism guide or checkbashisms The general rule for POSIX sh-output is: don't write bashfeatures in powscript

Debug your powscript syntax

See FAQ

OSX users

OSX might protest since it isn't quite GNU focused. Please run these commands after installing:

$ brew install bash
$ brew install coreutils gnu-sed grep gawk --default-names
$ echo 'export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH' >> ~/.bashrc
$ sed -i 's|#!/bin/bash|#!/usr/local/bin/bash|g' powscript

Live expansion inside editor

HINT: use live expansion inside vim. Put the lines below in .vimrc and hit 'p>' in normal/visual mode to expand powscript to bash

vmap p> :!PIPE=2 powscript -c<CR>
nmap p> ggVG:!PIPE=2 powscript -c<CR>

More Repositories

1

kanban.bash

commandline asciii kanban board for minimalist productivity hackers & managers (csv-based) #scriptable #nestable #statistics #singlefile #shellscript
Shell
845
star
2

Gexpress

Express middleware for google appscript (build NODEJS-like applications) + generated api-client
56
star
3

pd-puredata-vanilla-patches

collection of public puredata vanilla patches found on internet
C
53
star
4

hubot-script-shellcmd

easy integration, execution and outputting of shellcommands +(line by line output instead of whole output at once)
CoffeeScript
45
star
5

pm.sh

pm2 in 1 shellscript without the fat + git webhooksupport (bitbucket/github/CI)
Shell
26
star
6

electribe-emx-esx-reverse-engineering

projectplaceholder to organize all possible research concerning 'freeing-the-electribe'-attempts
C++
18
star
7

debootstrap-container

simple way of running multiple debian containers on a (openvz) VPS (instead of docker )
Shell
17
star
8

audiobrowse.bash

simple commandline audio preview of directories for sample-artists / musician and producers
Shell
14
star
9

gspreadsheet-bash

portable google spreadsheet bash client for easily piping/replacing data between spreadsheets
Shell
14
star
10

hubot-script-spreadsheet

hubot plugin: (query) interface to google spreadsheet (*with* authentication)
CoffeeScript
13
star
11

bashdown

markdown to html converter with bash as templating language, written in 100% pure bash, macgyver-style documentation generator
HTML
12
star
12

aframe-verse

deadsimple immersive navigation: a single-player-verse component
JavaScript
12
star
13

parse-server-scheduler

get scheduled jobs to run automatically (without external server) in parse
JavaScript
11
star
14

usm

[unix sample manager] search TERABYTES of samples across different (network) disks in few seconds (+offline)
Shell
11
star
15

soxmasterhouse

automatically mastering of audio using sox/ladspa/vst
Shell
11
star
16

npm-collect

automatically update package.json according to installed/linked modules in node_modules
CoffeeScript
10
star
17

json-dsl

easily create dsl's from json by evaluating json keys and values, json decode on steroids
CoffeeScript
9
star
18

sample-multi-shotifier

hack which expands your traditional hardware/software samplers using many-samples-in-one-sample (poor man's soundfont). Perfect for electribe esx.
Shell
9
star
19

lodash-fp-composition

supercharge lodash/fp with promise- and immutable support
JavaScript
8
star
20

parse-server-image-resize-byurl

Flexible way to resize images on demand (using url-arguments)
JavaScript
8
star
21

syslog-flexible

Minimal PHP class to easily log messages to local syslog and/or papertrail and/or a remote syslog server
PHP
8
star
22

imagegrep-bash

grep word in pdf or image based on OCR
Shell
7
star
23

instr2raw

SF2/XI instrument inspection/conversion utilities + looppoint insertiontools for AIFF/WAV..all for loopedinstrument fanatics
C++
7
star
24

pixilang.GUI

minimal gui library for pixilang
7
star
25

hubot-script-http

run all hubot commands thru the browser or using bash terminal
CoffeeScript
6
star
26

dpd-swagger-doc

automatically generated apidocs from deployd resources
JavaScript
6
star
27

json-ref-lite

Extremely light weight way to resolve jsonschema '$ref' references & inheritance: create circular/graphs, fractals from json (browser/coffeescript/javascript)
Shell
6
star
28

hubot-script-ical

google calendar integration, allows hubot to notify roommembers when ical events (are about) to happen
CoffeeScript
6
star
29

podi

a cute gitops utility (~7kb) to turn servers into PaaS platforms using only git+ssh. #hybrid #baremetal #bubblewrap #k8s #podman #docker
Shell
6
star
30

soakbean

Write beautiful ~2.3MB redbean (docker) apps using (redbean) plug-and-play middleware. #tiniest_fastest_server_in_the_universe
Lua
5
star
31

puretheme

drop-in solution to create beautiful gui's and node-editor using puredata (VANILLA)
5
star
32

framebuffer.bash

framebuffer in bash to draw ascii pixels, borders, animate e.g. (bash ui bootstrap)
Shell
5
star
33

bashdoc

simple portable documentation generator for any sourcecode using simply bash & markdown
Shell
4
star
34

webpipe.bash

extend your bash using webpipes, aka bash-in-the-cloud
Shell
4
star
35

restify-generator

generates a restify RESTserver from a iodocs json schema
JavaScript
4
star
36

sunvoxjs

mirror of Alexander Zolotov's sunvoxjs lib
JavaScript
4
star
37

express-datafire

Live-editing & testing of datafire endpoints & scheduled tasks using express
JavaScript
4
star
38

sheetlabs-google-restproxy

gscript + nodejs rest-proxy which turn a google spreadsheet in sheetlabs.com into a full REST api
JavaScript
4
star
39

dpd-filebased-mongodb

run deployd without mongodb (but a jsonfile instead to store data)
JavaScript
4
star
40

parse-server-jsreactor

A flexible IFTTT-engine with generated gui (backend-agnostic)
JavaScript
3
star
41

dpd-test

easily mock & e2e tests for deployd endpoints, without mongodb-requirement
JavaScript
3
star
42

testosteron

simple crosslanguage testing-utility using bash, crosslanguage bootstrapper for unittests
Shell
3
star
43

ffnode

visual node editor (powered by ffmpeg filtergraph)
C++
3
star
44

aap

an npm-like, highlevel dependency manager, buildtool and installer using bash+git
Shell
3
star
45

middleware-remoteshell

allow developers to tail logs remotely using curl (and run cmds)
JavaScript
3
star
46

nodejs-deploy-githook.bash

DEPRECATED, SUPERSEDED BY pm.sh -------------- KISS automatic node deployment for VPS (minimalist PAAS) node container bootstrapper in few lines of bash using only git & ssh, similar like gitreceive
Shell
3
star
47

dpd-acl-roles-permissions

Easily configure roles/permissions and limitations for methods and (nested) keyvalue-pairs for deployd
JavaScript
3
star
48

restglue

multi-api restful client (javascript) with endpoint-glue & promises (lightweight, no buildchain needed)
JavaScript
3
star
49

BrowserStream

Stream text to browser in realtime without using websockets using PHP
PHP
3
star
50

expressa-swagger

genereated api documentation-page + restclients for expressa
JavaScript
3
star
51

logfilter

easy portable bashscript to monitor syslog- and logfile events with on-the-fly filtering and highlight features
Shell
3
star
52

udev-autorun

udev rule + utility which automatically runs a shellscript on drives when plugged in (or asks for action like windows)
Shell
3
star
53

bashlive.repo

official repo for BASHLIVE, a BASH communitysnippetfunctionframeworkcoderepository-tool for bashhackers
Shell
3
star
54

bless

256 bytes mixin-alternative for ALL js frameworks in the world FOREVER: function bless(๐Ÿ’ช)
JavaScript
2
star
55

expressa-cli

helper commands for expressa applications
JavaScript
2
star
56

hubot-syslogd

flexible monitoring and aggregation of logs by using hubot as syslog server (replacement)
CoffeeScript
2
star
57

jsongraph

minimalist dataflow programming with json based on jsonschema references (nodejs/coffeescript)
CoffeeScript
2
star
58

mongodb-filebased

mongodb without mongodb (but stores into jsonfile)
JavaScript
2
star
59

nohupr

the 6K minimalist way to manage an multi-app linux server
Shell
2
star
60

sutra-php

Automatically exported from code.google.com/p/sutra-php
PHP
2
star
61

flowee

a lightweight way to create JSONAPI-compatible api's_ using nodejs:
CoffeeScript
2
star
62

riot-admin

generic api-agnostic admin dashboard interface, like ng-admin but less javascript-ish
CSS
2
star
63

podman-sh

redirect (ssh) users to a podman/docker container by setting podman-sh as usershell
Shell
2
star
64

typeshave.js

Lightweight function wrapper to ensure typesafe data. Wrap functions,forms,api's and more with jsonschema
Shell
2
star
65

timetrack.bash

passive timetracking to csv based on bash history + cronjob and patternmatching
Shell
2
star
66

node-red-contrib-splitter

A Node-RED node to split arrays into seperate messages, making it easy to loop over
HTML
2
star
67

VikingBot

Vikingbot is yet another simple PHP based IRC bot with support for plugins and secure IRC servers. The bot requires Unix/Linux shell access with PHP support and SSL support in PHP for use against secure IRC servers.
PHP
2
star
68

ohmygraph

Easily generate a REST (graph)client from a json api-modelspecification. Like restangular/traverse/backbone/restful but more atheist-style.
Shell
2
star
69

bullmq

*deprecated* simple api management rate limiting: http proxy + throttler + message/job queue based on nodejs bull
JavaScript
2
star
70

docker.alpine.nodejs.pod

alpine linux nodejs pm2+pod docker image for ARM and x86
Shell
2
star
71

notmuch-bash

portable bash client for notmuch, simple consolewrapper for notmuch to save yourself from typing all the time
Shell
2
star
72

jsonschema-acl

jsonschema validator with acl-layer added for nodejs: handy validator before doing db inserts, api replies, form submits etc
JavaScript
2
star
73

deployogi

easy, automatic deployment of webapplications/databases on staging/production webservers using GIT hooks and bash triggers. DEPRECATED: use pm.sh
Shell
2
star
74

bash_builtin_skeleton

"hello world" skeleton for bash custom builtin-commands in C/C++
C
1
star
75

node-red-contrib-coffeescript

coffeescript node for node-red
HTML
1
star
76

bashdownjson

portable/easy way of generating of json feeds using commandline (piping) using 100% bash and bashdown templates
Shell
1
star
77

dot.bash

interactive bash toolbelt for webdevelopment hipsters
Shell
1
star
78

lsmail

deadsimple console imapclient (think: ls [email protected] ) written in bash & php
PHP
1
star
79

loopback-swagger-cli

extend your swagger json with loopback syntax, one jsonfile to rule them all
Shell
1
star
80

parse-server-queue

easy-peasy parse-dashboard-compatible queue for parse-server with mongodb
JavaScript
1
star
81

bashlive

BASHLIVE, a BASH communitysnippetfunctionframeworkcoderepository-tool for bashhackers
Shell
1
star
82

jsreactor-channel-sendgrid

sendgrid-integration for jsreactor
JavaScript
1
star
83

expressa-folder

extend expressa collections with ORM-ish js-code (get.js/post.js/functions.js/etc) & setup sub-endpoints
JavaScript
1
star
84

microfunctional.php

bare minimum functional programming for php5
PHP
1
star
85

riot-datatables

riotjs datagrid tag (based on datatables.net)
Shell
1
star
86

dpd-api-token

simple headerbased X-API-TOKEN authentication for 3rd party api auth (+ google analytics for API metrics)
JavaScript
1
star
87

renoise2soundfont

experimental renoise module to soundfont converter
Python
1
star
88

dpd-ratelimit

ratelimit incoming requests based on ip or user
JavaScript
1
star
89

webhookmonkey

webhook monitoring & patch platform (prevent webhook-spaghetti & centralizes webhook routing)
JavaScript
1
star
90

jsreactor

A flexible IFTTT-engine with generated gui (backend-agnostic)
JavaScript
1
star
91

micro-material-css3

lightweight micro material stylesheet for mobile webapps using css3
CSS
1
star
92

spadmin

RAD framework for a SPA rest-to-admin interface
JavaScript
1
star
93

google-keep-lab

codesnippets for the google keep lab chrome extension (brew our own features)
1
star
94

coffeerest-api

Api scaffolding from a model specification in few lines OH MY (coffeescript)
CoffeeScript
1
star
95

nrpn2jesusonic

Bash script which easily converts midi nrpn-descriptions into jesusonic plugins (to gain full midicontrol over your hardware mididevice).
Shell
1
star
96

webpipe.bash.php

php-skeleton to run bash webpipes using another server
PHP
1
star
97

protoplug.scripts

protoplug dsp scripts
Lua
1
star
98

webpipe.coffeescript.nodejs

coffeescript skeleton webpipe
CoffeeScript
1
star
99

datamapper-minimal

Easily transform arrays and objects in PHP with different layouts into one format
PHP
1
star
100

sunvoxosc

python experiment to trigger sunvox modules thru OSC
Python
1
star