# `mix bb_jido.add_agent`
[🔗](https://github.com/beam-bots/bb_jido/blob/main/lib/mix/tasks/bb_jido.add_agent.ex#L6)

Scaffolds a Jido agent that controls a BB robot

Creates a new module that `use`s `Jido.Agent` and attaches
`BB.Jido.Plugin.Robot` for the given robot.

Once generated, start the agent at runtime with:

    Jido.start_agent(MyApp.Jido, MyRobot.Agent, id: "main")

## Example

```bash
mix bb_jido.add_agent --robot MyApp.Robot
mix bb_jido.add_agent --robot MyApp.Robot --agent MyApp.MainAgent
mix bb_jido.add_agent --robot MyApp.Robot --name main_robot
```

## Options

* `--robot` - The robot module the agent will drive (defaults to
  `{AppPrefix}.Robot`).
* `--agent` - The module name for the agent (defaults to
  `{robot_module}.Agent`).
* `--name` - The Jido `name:` string for the agent (defaults to a
  snake_cased version of the agent module's last segment).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
