Skip to content

CLI reference

After the source build, use the linked banh command or replace it with node packages/cli/dist/index.js from the Banh checkout.

Command Purpose
banh --help Print usage.
banh validate <workflow.yaml> Parse, validate, and compile without loading a model.
banh run <workflow.yaml> --input <file> Execute locally using input from a file.
banh run <workflow.yaml> --text <text> Execute locally using literal text.
banh login [--api-url <url>] [--no-browser] Sign in using Auth0 device authorization.
banh logout Remove the saved local login.
banh whoami [--json] [--api-url <url>] Show the verified user and account.
banh deploy <workflow.yaml> [--json] [--api-url <url>] Upload a new workflow version.

There is no CLI cloud invocation or run-inspection command yet. Use the HTTP API for those operations.

Option Behavior
--json Emit the execution result as JSON on stdout.
--verbose Emit runtime events on stderr.
--model-dir <dir> Load an existing ONNX model bundle.
--cache-dir <dir> Select the model download cache.
--revision <rev> Pin a model repository revision.

An existing bundle contains laya.onnx, laya.onnx.data, laya_config.json, tokenizer/tokenizer.json, and tokenizer/tokenizer_config.json.

The default API is http://127.0.0.1:3000 until a login is saved. Origins and URLs ending in /v1 are accepted. Remote endpoints require HTTPS; HTTP is allowed for loopback hosts. Requests do not follow redirects.

Setting Resolution order
API URL --api-url, BANH_API_URL, saved URL, local default
Developer token BANH_API_TOKEN, saved token for the exact API URL
Account BANH_ACCOUNT_ID, otherwise an account belonging to the verified identity

Lowercase-prefix aliases banh_API_URL, banh_API_TOKEN, and banh_ACCOUNT_ID also work; uppercase names take precedence. BANH_CONFIG_DIR selects a separate credential directory.

See authentication for token types, storage, and logout behavior.