AnyAgent

goose

Use goose through AnyAgent: what you can ask for, how it behaves, and the flags underneath.

The goose adapter drives goose run --output-format stream-json --quiet with the prompt piped over stdin via -i -; import goose from anyagent/goose. goose is Apache-2.0 open source and bring-your-own-key (BYOK): pass model as "provider/model", or configure a provider in goose’s own config and pass a bare name.

What you can ask for

model, systemPrompt, and session resume work on the CLI’s own flags; schema is provided by AnyAgent. readOnly, effort, mcp, and model listing are undeclared and throw. authStatus() runs goose info -v and checks the provider’s key env var; when the key may live in goose’s keyring the answer is "unknown". The full grid is on the support matrix.

Good to know

  • goose sessions are keyed by name and never expose an id headless, so result.sessionId stays absent. agent.session() generates and threads the name for you; by hand, name the first run via extraArgs: ["--name", "review-1"], then pass resume with that name.
  • model splits at the first slash only, so an openrouter path like "openrouter/openai/gpt-5.2" works verbatim.
  • Usage reports inputTokens and outputTokens only.
  • A failed run reports the provider error as ordinary assistant text rather than throwing.

Under the hood

Every run executes goose run --output-format stream-json --quiet -i -, with GOOSE_MODE=auto set as an env default so approval modes cannot hang a headless run; a GOOSE_MODE you pass in env wins. Run options append flags:

OptionFlag
model--provider <provider> --model <model> from "provider/model"; a bare name maps to --model <name> alone
systemPrompt--system <text>
resume--name <name> --resume

On this page