Using actions
Use this when you want to find an action, run it, and read the run it records, or add an action of your own.
An action is a validated procedure with declared inputs and requirements, optional checks, and a recorded run. For the full definition, see actions.
Before you begin
Section titled “Before you begin”- Build a Barry. These commands act as the
bonanzaidentity from that guide; use your own identity’s command in its place. - The example is
list-action-runs, which lists recorded action runs, the ones still open by default. The actions bag ships with Barry and provides it. - To run an action that declares a
prompt:, have Barry’s services running.
Find an action
Section titled “Find an action”To list the actions you can run, run:
bonanza tool actions find-actionsEach result gives the action’s name, its bag, its qualified name in the form
bag:name, a description, and its inputs. To search by name or description,
add a word after the command.
In a session, ask for the task instead. The agent searches with the
find_actions tool, starts the action with begin_action, and closes the run
with complete_action, or with cancel_action if it stops early:
Find the action that lists action runs, and show me the ones that have closed.Run an action from the terminal
Section titled “Run an action from the terminal”Pass --input once per input. Barry reads each value as JSON when it parses,
and as a string otherwise. To pass every input as one object, use
--inputs-json instead.
Where the action runs depends on its kind. Barry runs an action that declares
a run: command itself, in the same process. An action that declares a
prompt: goes to Barry’s API, which gives it to an agent, so the API must be
running. list-action-runs declares run:, so it works with the API down.
Read recorded runs
Section titled “Read recorded runs”bonanza action show prints the deliverable alone on standard output and the
run’s status and summary on standard error, so you can redirect the deliverable
to a file.
Add an action of your own
Section titled “Add an action of your own”Actions come from bags: each directory under a bag’s actions/ holds one
action.yaml.
The
actions bag
documents every action.yaml field.
Verify
Section titled “Verify”bonanza action run prints the run’s status and ID on standard error, and the
status reads complete when the run succeeds. The command exits zero only
then, so a script can check it:
bonanza action run list-action-runs --input active=false && echo completeIn bonanza action runs, a run with a recorded deliverable carries a ✎
marker; print it with bonanza action show.
If it fails
Section titled “If it fails”No action named …. Barry found no action by that name. Search withbonanza tool actions find-actionsand use the name it lists.Could not reach the API to run an agent action. Aprompt:action needs Barry’s API. Start the services withbarry up, and see See what is running.--input expects key=value. Write each input asname=value, or pass them all with--inputs-json.This run never completed.bonanza action showfound no deliverable because the run stopped early. Check its status inbonanza action runs.
What’s next
Section titled “What’s next”- Automate a recurring task to turn a prompt into an action and schedule it.
- Schedule and distribute work to fire an action on a trigger.
- Action fields for the full
action.yamlschema.