goose_test_cli: Test if Goose CLI is Working

View source: R/cli_integration.R

goose_test_cliR Documentation

Test if Goose CLI is Working

Description

Tests if Goose CLI is properly configured and can execute queries. This is especially useful for Block employees who have CLI configured but don't need to provide API keys in R.

Usage

goose_test_cli(verbose = TRUE, timeout = 60)

Arguments

verbose

Logical, whether to print status messages

timeout

Numeric, timeout in seconds for the test query (default 60). Increase this if authentication prompts require more time.

Value

Logical, TRUE if CLI works, FALSE otherwise

Examples

## Not run: 
# Check if CLI works
if (goose_test_cli()) {
  # Ready to use goose_ask() etc.
  response <- goose_ask("Hello!")
} else {
  # May need configuration
  goose_configure(provider = "openai", model = "gpt-4", api_key = "key")
}

# Allow more time for authentication
goose_test_cli(timeout = 120)

## End(Not run)

gooseR documentation built on Feb. 6, 2026, 5:07 p.m.