Skip to main content
Without CTAs (call-to-actions), agents have to guess what to do next or ask the user. With CTAs, your CLI tells the agent exactly which commands are relevant after each run, so it can chain operations without extra prompting.

Basic Usage

Return CTAs from c.ok() to suggest next steps:
Output

Type-Safe CTAs

CTA parameters are fully type-inferred, so agents get valid command names, arguments, and options:
Output

CTAs with Options

Suggest commands with both arguments and options:
Output

Short-Form CTAs

Use plain strings for simple command suggestions:
Output

Custom CTA Labels

Customize the “Next:” label:
Output

Error CTAs

Suggest recovery commands after errors:
Output

Agent Behavior

CTAs appear in all output formats: TOON (default)
JSON
Agents can parse the meta.cta structure to determine the next command to run.

Conditional CTAs

Generate CTAs based on the result:
Output

Implementation Details

CTAs are part of the output envelope and appear in the meta section when using --verbose or --json:
In TTY mode (human terminal), CTAs are formatted as a “Next:” section. In non-TTY mode (agent), they’re included in the JSON envelope for programmatic parsing.
Use CTAs to guide agents through multi-step workflows without requiring them to prompt the user for next steps.