Bashit.kak a kakoune editor command line gateway. *Relaunch*

BashIt.kak a kakoune editor command line gateway.

See or clone the docs/javadoc, docs/coverage, and docs/tests for the API.

Download pre-built bashit.jar with sha256 hash check.
$ openssl dgst -sha256 bashit.kak-<version>.jar

      bashit [-i | -debug] <BINARY|JAR|OTHER> [FLAGS] [args ...]

        ignore output in Kakoune client

        terminal debugging of a java.lang.Process

      is on your PATH|CLASSPATH|OTHER

      are native to the BINARY|JAR|OTHER

      BashIt a Kakoune command line gateway. Easily invoke a 
      binary, jar, or any script/executable without leaving
      the kakoune command line. With automated temp file setup
      and teardown on stdin/out/err. Default invocation
      opens the temporary file in current kakoune client.
      The temporary file is deleted on programs exit,
      invoke kakoune :write command to save the buffers
      output to a file name and destination of your choosing.

      :bashit stderr available in kakoune *debug* buffer
      java -jar is automatically prefixed to <name>.jar calls
      kotlinc -script is automatically prefixed to <name>.kts calls
      :bashit python3 --help
      :bashit perl --help
      :bashit --help

      :bashit brew info shellcheck
      :bashit brew home shellcheck
      :bashit howdoi -c -n 5 catch an exception kotlin
      :bashit curl

      :ansi-render see
      :bashit open

Woman had me my man-pants, press play on the motivational song spotify Schubert: Ave Maria, D.839 or youtube and put yourself in scrutineers mode. Peer review time!

HTML format:
docs/javadoc docstrings with UML diagrams and Harvard referencing style.
docs/coverage 119 passing tests with 96% coverage.
docs/tests viewable results of all tests.


@see gradle wrapper
@see shadowJar

Run the gradle command from the terminal in bashit.kak top level directory:
$ gradle wrapper

$ ./gradlew shadowJar

$ gradlew.bat shadowJar

The fat-jar is located:
$ bashit.kak/build/libs/bashit.kak-<version>.jar

Build with passing tests use:
$ ./gradlew build

Gradle is a command line tool:
$ ./gradlew --help
$ ./gradlew tasks
$ ./gradlew dependencies --configuration compileClasspath

Gradle can also build shared and static libraries, and executables in Assembler, C/C++ and Obj-C/C++


$ curl -s "" | bash
$ source "$HOME/.sdkman/bin/"
$ sdk version
$ sdk install java 11.0.5-zulu
$ sdk install kotlin
$ sdk install gradle  
$ sdk install kscript  // optional


# kakoune command
define-command -params .. bashit %{ evaluate-commands %sh{ java -jar <your-path-to>/bashit.kak-<version>.jar "${kak_session}" "${@:1}" } }

# .bashrc command
if [[ -d "$HOME/.local/jars" ]] ; then
    export JARPATH
#! /usr/bin/env bash
# `.jar` suffix is no longer required from bash command line
exec java -jar "$JARPATH/$1.jar" "${@:2}"
exit 1

# .bash_alias command
alias jj=<your-path-to>/

Alternate Setup (linux/osx/*nix)

# kakoune command
define-command -params .. bashit %{ evaluate-commands %sh{ "${kak_session}" "${@:1}" } }

MYSELF=`which "$0" 2>/dev/null`

[ $? -gt 0 -a -f "$0" ] && MYSELF="./$0"


if test -n "$JAVA_HOME"; then

exec "$java" $java_args -jar $MYSELF "$@"

exit 1

$ cat bashit.kak-<version>.jar > && chmod u+x && mv ~/.local/bin/

@author Tommaso, P 2019, How to make a JAR file Linux executable,, viewed on 6 Jan 2019,


 * bitbucket repo  ✅
 * uml diagrams  ✅
 * logger  ✅
 * mockk   ✅
 * tests with coverage  ✅
 * dokka api, docstrings and references  ✅
 * build fatjar  ✅
 * post on discuss.kakoune  ✅

Before running ./gradlew command run:
$ ps aux | grep java
Note the process_id of all current running java processes.
Then run all the required ./gradlew commands, after re-run the previous ps command for any additional unclosed java process noting their process_id.
You can then use the:
$ kill process_id
to terminate the additional running java process.
The cause is strictly ./gradlew command and NOT or bashit.jar.

Kakoune General Information

Kakoune is an open source modal editor. The source code lives on github mawww/kakoune.
A discussion on the repository structure of ’community plugins’ for Kakoune can be reviewed here: Standardi(s|z)ation of plugin file-structure layout #2402.
Read the Kakoune wiki for information on install options via a Plugin Manager.

And thank you to the Kakoune community 180+ contributors for a great modal editor in the terminal. I use it everyday for those keyboard shortcuts.


First: the standard java application bashit.kak-4.0.jar
Second: with the use of
Third: compiled with GraalVM native bashit.kak

$GRAALVM_HOME/bin/native-image -cp ./bashit.kak-4.0.jar -H:Name=bashit.kak -H:Class=org.kjd.bashit.kak.BashItKt -H:+ReportUnsupportedElementsAtRuntime --allow-incomplete-classpath

bashit.kak is language agnostic so insert your favourite language here *.* I am using *.kt for demo purposes only. Below are the commands I use in the asciinema cast. Please note that compile time is a little slower than most as I am on an iMac-2011 with 2008 parts.

$ kak ToUpper.kt

fun main(args: Array<String>) {
  args.forEach { println(it.toUpperCase()) }
:bashit toUpper ToUpper.kt
:bashit mv toUpper.kexe toUpper

$ ./toUpper wtf? bashit.kak

I did not quite get what bashi.kak provides compared to say :nop %sh{ my bash command }. Could you eleaborate ?

Sure and thanks for your interest. Answer: absolutely nothing! Honesty is always refreshing though.
Just doing something a little different from the pack and having fun with the jvm and kotlin.
I am not running any competitions @mawww , so view or use with a smile.

No need to context switch to preform tasks, if complied with GraalVM a ahead of time VM you can spawn multiple native VM tasks without leaving Kakoune editor. Process auto closes within 20 seconds which is a design choice, so no long-running tasks.

All stdout/err is available inside the Kakoune editor for you to view e.g. :bashit ghc --show-options . You can now view without leaving the kak editor the 1305 lines of options.

You can also use the -debug to see additional details from your terminal not via kakoune editor.

Like everything, limited by our imagination, hence a community of ideas and feedback propels growth. So how can I improve it? Let me know.

Alternately I could do this to view the stdout:
:bashit toUpper wtf? bashit.kak

That’s bashIt.kak a kakoune editor command line gateway.

kotlinx.cli for extending cli options/flags and parsing is on the todo list.

Thanks @mawww and keep up the good work mate. Bye :wave:

Wimmer, C. et al., 2019. Initialize once, start fast: application initialization at build time. Proceedings of the ACM on Programming Languages, 3(OOPSLA), pp.1–29. Available at:

BashIt.kak v5.0 GraalVM Native Image Compliant.

After pulling an all nigher to impress the boss (@mawww ) and with @andreyorst I’m human after all post in mind, here’s a tune for the day after spotify Road Trip Skegss or youtube.

Sincerely I appreciate the Kakoune editor and the work done by all the community more than I could ever express. Bye. :wave: