# `Beancount.Directives.Plugin`
[🔗](https://github.com/thanos/beancount_ex/blob/v0.6.0/lib/beancount/directives/plugin.ex#L1)

The `plugin` directive loads a Beancount plugin module.

See [Plugins](https://beancount.github.io/docs/beancount_language_syntax/#plugins).

## Beancount syntax

    plugin "beancount.plugins.auto_accounts"
    plugin "beancount.plugins.auto_accounts" "Assets:Cash"

General form: `plugin "Module" ["Config"]`

## Elixir struct

    %Beancount.Directives.Plugin{
      module: "beancount.plugins.auto_accounts",
      config: nil
    }

    %Beancount.Directives.Plugin{
      module: "beancount.plugins.auto_accounts",
      config: "Assets:Cash"
    }

Or use `Beancount.plugin/2`:

    Beancount.plugin("beancount.plugins.auto_accounts")
    Beancount.plugin("beancount.plugins.auto_accounts", "Assets:Cash")

## Fields

  * `module` - Python plugin module path as a string (Beancount plugin name).
  * `config` - optional configuration string passed to the plugin. `nil` omits
    the second argument in rendered `.bean` text.

# `t`

```elixir
@type t() :: %Beancount.Directives.Plugin{
  config: String.t() | nil,
  module: String.t()
}
```

---

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