Package: ptrepl
AboutMake REPL out of any bash commandhas bash completionhas vi modehas PS1 parsing(experimental)stores history in$XDG_DATA_HOME/ptrepl/historybash like history expansionlist historycommand modealiasesInstallationRequirespython>=3.6,prompt_toolkit>=2.0.7,<3.0.0,pygmentsRecommended way of installation is viapipxpipxinstallptreplptreplvendorshttps://github.com/xonsh/py-bash-completionUsageBasic Usage$ptrepl--helpUsage:ptrepl[OPTIONS]COMMANDOptions:--promptTEXTOverrideprompt--helpShowthismessageandexit.$ptreplgit$git># to call "git status"$git>status# if you need execute some other bash command see system mode belowCustom prompt command$ptreplgit--promptg$g>Multiword command$ptrepl"echo prefix"$echoprefix>1echoprefix1ConfigPlace settings file in :bash:$XDG_CONFIG_HOME/ptrepl/config.jsonHere is example of config with enabled vi mode and git alias{"settings":{"EXIT_COMMAND":"exit","EDITING_MODE":"vi","SHOW_MODE_IN_PROMPT":true,"EMACS_MODE_STRING":"@","VI_INS_MODE_STRING":"+","VI_CMD_MODE_STRING":":","READLINE_COMPLETION":false,"PARSE_PS1":false,"LOCAL_SHADA":false,"LOCAL_SHADA_PATH":"$PWD/.ptrepl/",},"alias":{"git st":"git status"}}Available settingsEXIT_COMMAND - change exit commandEDITING_MODE - choose mode vi/emacsSHOW_MODE_IN_PROMPT - show editing mode string in promptEMACS_MODE_STRING - set emacs mode prompt stringVI_INS_MODE_STRING - set vi insert mode prompt stringVI_CMD_MODE_STRING - set vi command mode prompt stringREADLINE_COMPLETION: use readline like completion instead of dropdown onePARSE_PS1 {experimental} - will try to adgust ptrepl’s prompt according to your PS1 settingLOCAL_SHADA - store shada(history) in LOCAL_SHADA_PATHLOCAL_SHADA_PATH - path to local shadaDefault settings{"EXIT_COMMAND":"exit","EDITING_MODE":"emacs","SHOW_MODE_IN_PROMPT":false,"EMACS_MODE_STRING":"@","VI_INS_MODE_STRING":"(ins)","VI_CMD_MODE_STRING":"(cmd)","READLINE_COMPLETION":false,"PARSE_PS1":false,"LOCAL_SHADA":false,"LOCAL_SHADA_PATH":"$DIRENV_DIR/.direnv/ptrepl/",}FeaturesParsing PS1(requires PARSE_PS1 set to true)Here is how my bash prompt(PS1) looks like by default{ptrepl}~/Development/Python/ptrepl[master]|19:18:3607-Feb-18|+❯ptreplgit{ptrepl}~/Development/Python/ptrepl[master]|19:20:1507-Feb-18|+git❯Completion$ptreplgit$git>sta(pressTAB)# result$git>stastatusstagestashReadline like completion(requires READLINE_COMPLETION set to true)$ptreplgit$git>sta(pressTAB)# result$git>stastagestashstatusSystem mode$ptreplgit$git>(pressEscape+!)# result
# you could enter your shell commands hereShellcommand:lsCommand mode$ptreplgit$git>(pressEscape+:)# result
# you could enter your command mode commands here
# to list historyCommandmode:historyBash like history expansion$ptreplgit$git>status# repeat last command$git>!!# repeat 10th command$git>!10# repeat 10th command from bottom of history stack$git>!-10Bash like aliases$ptreplgit$git>(pressEscape+:)# you could enter your command mode commands here
# to list aliasCommandmode:aliasalias"git st"="git status"$git>stSimilar projectsWritten in Rubyhttps://github.com/defunkt/replWritten in Bashhttps://github.com/joh6nn/shreplhttps://github.com/mchav/withWritten in Pythonhttps://github.com/mbr/replhttps://github.com/renanivo/with