module

Bai

Bai exposes the CLI entry logic for the executable and for tests.

Constants

VERSION = "0.4.4"

The current released version of the CLI.

Class methods

run(argv : Array(String), stdin : IO = STDIN, stdout : IO = STDOUT, stderr : IO = STDERR, stdin_tty : Bool = STDIN.tty?, command_requester : Proc(String, RequestOptions, GenerationResult) | Nil = nil, clipboard_copier : Proc(String, Bool) | Nil = nil) : Int32

Parses CLI arguments and prints either help text, a dry-run prompt preview, or the proposed shell command.

The query is read from argv first and falls back to stdin when piped input is available. Returns 0 on success, 1 on runtime or API failures, and 2 when no query was provided.

Source

Nested types