Skip to content
WIP

This guide is a work in progress. Barry is also a work in progress.

Empowering with traits

Use this when a session needs more tools than it starts with, for one session or for every session your identity starts.

A trait is a named grant of tools, and it can also mount skills and point the agent at instructions. For the full definition, see traits. Traits only add access: a bound only takes it away, and any bound a trait carries joins the session’s other bounds.

  • Build a Barry. These commands act as the bonanza identity from that guide; use your own identity’s command in its place.
  • The example is the memory trait. The memory bag ships with Barry, and every bag gets an automatic trait with the bag’s own name. For a bag of your own, pack it first.

To see every trait on your machine, run:

Terminal
barry trait list

Each entry names the trait and lists the namespaces it grants, the skills it mounts, its access level, and any restrictions it carries.

Every session starts with the identity’s default traits. The traits you choose add to those.

  1. To start a session with the memory tools, run:

    Terminal
    bonanza session start --traits memory

    Separate several traits with commas. Passing --traits skips the picker.

  2. To choose from a list instead, start a session without --traits:

    Terminal
    bonanza session start --show-builtin

    Move with the arrow keys, press Space to select a trait, and press Enter to start. The picker hides the traits of bags that ship with Barry, such as memory, unless you pass --show-builtin.

Your identity’s default traits join every session it starts, whatever you choose in the picker.

  1. To add memory to your identity’s default traits, run:

    Terminal
    bonanza identity traits add memory

    The output is similar to the following:

    Output
    Traits on identity 'bonanza': sessions, coding, memory

    Your list can differ. The coding trait appears only on a machine that has the coding bag.

  2. To take the trait off again, run:

    Terminal
    bonanza identity traits remove memory

    The output is similar to the following:

    Output
    Traits on identity 'bonanza': sessions, coding

To remove every default trait at once, run bonanza identity traits clear. Each of these commands acts on the identity whose command you run. To change a different identity, run the same command through that identity’s own command in place of bonanza.

Packing a bag loads its hooks, instructions, and actions, but its tools reach a session only when a trait selects them. That is bag_grant: session, the default.

If you want every packed bag’s tools in every session, set this line in your identity’s identity.yaml:

bag_grant: identity

Each packed bag then grants its automatic trait to every session. Any other value reads as session.

To confirm your identity’s default traits, run:

Terminal
bonanza identity show

The Traits: line lists the traits every session starts with, and Optional traits: lists the ones a session adds only when you choose them. To see what a trait grants, find it in barry trait list: its Namespaces: line names the tool namespaces a session gets.

  • A trait you named does not appear. Check the spelling against barry trait list, and install and pack the bag that provides it.
  • The session still lacks a tool. Confirm the trait grants the tool’s namespace. See A tool the agent should have is missing.