# `BB.Command.Server`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/command/server.ex#L5)

GenServer wrapper for command callback modules.

This module manages the lifecycle of user-defined command modules, handling:
- Parameter reference resolution at startup
- Subscription to parameter changes
- Safety state change notifications
- Delegation of GenServer callbacks to user module
- Result extraction and delivery to awaiting callers

Command servers are temporary - they are not restarted on crash.

# `t`

```elixir
@type t() :: %BB.Command.Server{
  awaiting: [GenServer.from()],
  callback_module: module(),
  context: BB.Command.Context.t(),
  execution_id: reference(),
  goal: BB.Command.goal(),
  param_subscriptions: %{required([atom()]) =&gt; atom()},
  raw_opts: keyword(),
  resolved_opts: keyword(),
  runtime_pid: pid(),
  timeout_ref: reference() | nil,
  user_state: term()
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

---

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