banish.shdocs
HomeGitHub
Concepts / The .bsh language
View as Markdown

The .bsh language

The third part of banish is a small scripting runtime. A .bsh file declares verbs, filters, and config in plain directives. Drop one in ~/.banish/ext and your change is live with no recompile.

Verbs

A verb is a named command shortcut. It can take arguments and expand into a real command:

!verb kpods
!args ns
!expand exec kubectl get pods -n {ns} -o wide
!help "List pods in namespace"

!args names the parameters, {ns} interpolates them, and !help is the description shown to your agent.

Filters

A filter matches a command and pipes its raw output through a shell one-liner that strips the noise:

!filter docker-build
!match docker build
!compact "grep -v '^Sending build' | grep -v '^---> ' | tail -20"

!match is a substring match against the command. !compact receives raw stdout on stdin and writes the compact version to stdout. Keep the one-liner simple: reach for grep, sed, head, tail, cut, and awk before anything heavier.

Config

A !config block sets runtime options for the file:

!config
!timeout "60s"
!output json

Where files live

  • Built-in filters are embedded in the binary, one .bsh file per ecosystem.
  • Your own extensions go in ~/.banish/ext. Every file there is loaded at startup.
  • A project can ship a BANISH file in its root for repo-specific verbs.

See built-in filters for the full directive list and the ecosystems banish ships with.

The .bsh language - write a token-saving output filter in ten lines - banish