babashka 2026-07-08

Hi @borkdude I wonder if you could update the README for babashka/cli as the "Simple example" doesn't work! Reading the API docs, it seems that cli/dispatch is expecting a vector (or a map of a different shape) than in the example. Changing

(cli/dispatch {:fn run :spec spec} args {:prog "mygit" :help true})
to
(cli/dispatch [{:fn run :spec spec}] args {:prog "mygit" :help true})
seems to work.

hmm let me check

Are you using the newest babashka.cli version?

and are you doing this from bb? bb wasn't updated with the newest CLI yt

you can load it using :reload

(require '[babashka.cli] :reload)

there will be a bb with this soon

I'm using the CLI that's included with babashka v1.12.218

yeah that doesn't have the newest cli yet. maybe I should do a new bb release with the bump since you're not the first, but I wanted to add some nice bb.edn stuff on top

So the newest version of the CLI will work as per the example?

the README mentions it though

The dispatch tree format now supports new things. Hmm, it doesn't mention that in the simple example. LEt me just push out a new bb release to get this solved

OK, confirmed that the example from the README works if I update to CLI v0.12.75, so my bad for not checking before assuming an error in the README.

No need to rush out a release just for this (unless it's causing problems for other people), it was my fault for not spotting the version discrepancy...

my assumption was that you wanted to use this in babashka right

Yes, I was just putting together a quick CLI tool with Babashka and tripped over this following an example from the README.

but if you can wait for a few more days... I hope to work on the new bb tasks completions with @clojurians-slack359 in Berlin this week a bit :)

Yes, I'm not in a rush for this, and have a perfectly fine work-around of wrapping the map in a vector that works with the included version.

yep, works with both old and new

it's the so-called "table" format vs the "tree" format mentioned later in README

the tree format is now also exposed (was only internal before)

👍 1