In some cases, someone might want to switch to just shell script to avoid it while interactive but still have a Lua config, or go full Lua to use Hilbish as a REPL. This also allows users to add alternative languages like Fennel as the interactive script runner." property="og:description"><metacontent="Hilbishallowsyoutochangehowinteractivetextcanbeinterpreted.ThisismainlyduetothefactthatthedefaultmethodHilbishusesisthatitrunsLuafirstandthenfallsbacktoshellscript.
In some cases, someone might want to switch to just shell script to avoid it while interactive but still have a Lua config, or go full Lua to use Hilbish as a REPL. This also allows users to add alternative languages like Fennel as the interactive script runner." name=description><metaname=revisit-aftercontent="2 days"><metaname=keywordscontent="Lua,Hilbish,Linux,Shell"><metaproperty="og:locale"content="en_GB"><linkrel=canonicalhref=https://rosettea.github.io/Hilbish/><metaproperty="og:url"content="https://rosettea.github.io/Hilbish/"><linkhref=https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.cssrel=stylesheetintegrity=sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVorcrossorigin=anonymous><scriptsrc=https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.jsintegrity=sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2crossorigin=anonymous></script><linkrel=stylesheethref=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.cssintegrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="crossorigin=anonymousreferrerpolicy=no-referrer><linkrel=stylesheethref=/Hilbish/versions/doc-improvements/css/syntax.min.eb77978873f3b324603120b558a36c98ad57d6ee7b77928e3bc131bd76c5935a.cssintegrity="sha256-63eXiHPzsyRgMSC1WKNsmK1X1u57d5KOO8ExvXbFk1o="></link><style>.heading>.heading-link{opacity:0}.heading:hover>.heading-link{visibility:visible;opacity:1;transition:all.1sease-in}@keyframeshighlight{0%{background:00}50%{background:#fff2cf}100%{background:00}}div:target{animation:highlight1.2s;animation-timing-function:cubic-bezier(1,-.02,.45,.89)}table{border-width:1px;border-style:solid;border-color:#565c64;border-collapse:collapse;margin-bottom:12px}tabletd{padding:5px}tabletr{border-width:1px}thead{display:none}</style></head><bodyclass="d-flex flex-column min-vh-100"style=overflow-x:hidden><svgxmlns="http://www.w3.org/2000/svg"style="display:none"><symbolid="check-circle-fill"fill="currentcolor"viewBox="0 0 16 16"><pathd="M16 8A8 8 0 110 8a8 8 0 0116 0zm-3.97-3.03a.75.75.0 00-1.08.022L7.477 9.417 5.384 7.323a.75.75.0 00-1.06 1.06L6.97 11.03a.75.75.0 001.079-.02l3.992-4.99a.75.75.0 00-.01-1.05z"/></symbol><symbolid="info-fill"fill="currentcolor"viewBox="0 0 16 16"><pathd="M8 16A8 8 0 108 0a8 8 0 000 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194.0.487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703.0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 110-2 1 1 0 010 2z"/></symbol><symbolid="exclamation-triangle-fill"fill="currentcolor"viewBox="0 0 16 16"><pathd="M8.982 1.566a1.13 1.13.0 00-1.96.0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889.0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535.0.954.462.9.995l-.35 3.507a.552.552.0 01-1.1.0L7.1 5.995A.905.905.0 018 5zm.002 6a1 1 0 110 2 1 1 0 010-2z"/></symbol></svg><header><navclass="navbar navbar-expand-md sticky-top bg-light border-bottom"><divclass=container-fluid><aclass=navbar-brandhref=/Hilbish><imgsrc=/Hilbish/hilbish-logo-and-text.pngaltheight=48>
and also provides the shell script and Lua runner functions that Hilbish itself uses.</p><p>A runner function is expected to return a table with the following values:</p><ul><li><code>exitCode</code> (number): Exit code of the command</li><li><code>input</code> (string): The text input of the user. This is used by Hilbish to append extra input, in case
more is requested.</li><li><code>err</code> (string): A string that represents an error from the runner.
hooks and have a better looking message.<ul><li><code><command>: not-found</code> will throw a <code>command.not-found</code> hook
based on what <code><command></code> is.</li><li><code><command>: not-executable</code> will throw a <code>command.not-executable</code> hook.</li></ul></li><li><code>continue</code> (boolean): Whether Hilbish should prompt the user for no input</li></ul><h3id=functionsclass=heading>Functions
<ahref=#functionsclass=heading-link><iclass="fas fa-paperclip"></i></a></h3><p>These are the “low level” functions for the <code>hilbish.runner</code> interface.</p><ul><li>setMode(mode) > The same as <code>hilbish.runnerMode</code></li><li>sh(input) -> table > Runs <code>input</code> in Hilbish’s sh interpreter</li><li>lua(input) -> table > Evals <code>input</code> as Lua code</li></ul><p>These functions should be preferred over the previous ones.</p><ul><li>setCurrent(mode) > The same as <code>setMode</code>, but works with runners managed
via the functions below.</li><li>add(name, runner) > Adds a runner to a table of available runners. The <code>runner</code>
argument is either a function or a table with a run callback.</li><li>set(name, runner) > The same as <code>add</code> but requires passing a table and
overwrites if the <code>name</code>d runner already exists.</li><li>get(name) > runner > Gets a runner by name. It is a table with at least a
run function, to run input.</li><li>exec(cmd, runnerName) > Runs <code>cmd</code> with a runner. If <code>runnerName</code> isn’t passed,