The default engine: a thin wrapper around the Beancount bean-check and
bean-query CLI tools.
This is the behavioral oracle. Rendering is delegated to
Beancount.Renderer, checking to Beancount.Checker (shells out to
bean-check), and queries to Beancount.Query (shells out to bean-query).
The native Beancount.Engine.Elixir implements the same
Beancount.Engine behaviour and is validated against this oracle.
Summary
Functions
Validate .bean text via bean-check.
Validate a .bean file on disk via bean-check.
Run a BQL query via bean-query.
Render directives to .bean text via Beancount.Renderer.
Functions
Validate .bean text via bean-check.
Examples
text = "2026-01-01 open Assets:Bank USD\n"
if Beancount.Checker.available?() do
{:ok, %Beancount.Result{status: :ok}} = Beancount.Engine.CLI.check(text)
end
Validate a .bean file on disk via bean-check.
Examples
path = Path.join(System.tmp_dir!(), "cli_check.bean")
File.write!(path, "2026-01-01 open Assets:Bank USD\n")
if Beancount.Checker.available?() do
{:ok, _} = Beancount.Engine.CLI.check_file(path)
end
Run a BQL query via bean-query.
Examples
text = "2026-01-01 open Assets:Bank USD\n"
if Beancount.Query.available?() do
{:ok, _} = Beancount.Engine.CLI.query(text, "SELECT account GROUP BY account")
end
Render directives to .bean text via Beancount.Renderer.
Examples
iex> Beancount.Engine.CLI.render([Beancount.open(~D[2026-01-01], "Assets:Bank", ["USD"])])
"2026-01-01 open Assets:Bank USD\n"