cchitsiang
8/19/2016 - 2:40 PM

replify - Create a REPL for any command

replify - Create a REPL for any command

See mchav/With for a similar tool that has more features.

#!/bin/sh

git clone https://gist.github.com/bb88e3dad565c0d8ee54031f6b758a09.git ./replify && cd ./replify && mv ./"  replify" ./replify && sudo chmod +x ./replify && sudo ln -s `pwd`/replify /usr/bin/replify

HN Discussion

$ replify echo
Initialized REPL for [echo]
echo> "Hello, World!" 
Hello, World!

echo> "It works!"
It works!

$ replify git
Initialized REPL for [git]
git> init
Initialized empty Git repository in /your/directory/here/.git/

git> remote add origin https://your-url/repo.git                

git> checkout -b new-branch
Switched to a new branch 'new-branch'

git> push   
#!/bin/sh

command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
    eval "$command $input"
    printf "%s> " "$command"
    read -r input
done