# `ClaudeWrapper.Commands.Plugin`
[🔗](https://github.com/genagent/claude_wrapper_ex/blob/main/lib/claude_wrapper/commands/plugin.ex#L1)

Plugin management commands.

Wraps `claude plugin install|uninstall|list|enable|disable|update|validate|tag|details|prune`.

## Usage

    config = ClaudeWrapper.Config.new()

    # List installed plugins
    {:ok, plugins} = ClaudeWrapper.Commands.Plugin.list(config)

    # List with available marketplace plugins
    {:ok, plugins} = ClaudeWrapper.Commands.Plugin.list(config, available: true)

    # Install a plugin
    {:ok, _} = ClaudeWrapper.Commands.Plugin.install(config, "my-plugin")

    # Install from a specific marketplace
    {:ok, _} = ClaudeWrapper.Commands.Plugin.install(config, "my-plugin@my-marketplace")

    # Enable / disable
    {:ok, _} = ClaudeWrapper.Commands.Plugin.enable(config, "my-plugin")
    {:ok, _} = ClaudeWrapper.Commands.Plugin.disable(config, "my-plugin")

    # Inspect a plugin's component inventory and token cost
    {:ok, info} = ClaudeWrapper.Commands.Plugin.details(config, "my-plugin")

    # Tag a plugin release (current dir), pushing the tag
    {:ok, _} = ClaudeWrapper.Commands.Plugin.tag(config, message: "release %s", push: true)

    # Remove auto-installed dependencies no longer needed (non-TTY needs :yes)
    {:ok, _} = ClaudeWrapper.Commands.Plugin.prune(config, yes: true)

# `scope`

```elixir
@type scope() :: :user | :project | :local
```

# `details`

```elixir
@spec details(ClaudeWrapper.Config.t(), String.t()) ::
  {:ok, String.t()} | {:error, term()}
```

Show a plugin's component inventory and projected token cost.

Wraps `claude plugin details <name>`.

# `disable`

```elixir
@spec disable(ClaudeWrapper.Config.t(), String.t() | nil, keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Disable an enabled plugin.

## Options

  * `:scope` - Scope (`:user`, `:project`, or `:local`). Default: auto-detect.
  * `:all` - Disable all enabled plugins (boolean).

# `enable`

```elixir
@spec enable(ClaudeWrapper.Config.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Enable a disabled plugin.

## Options

  * `:scope` - Scope (`:user`, `:project`, or `:local`). Default: auto-detect.

# `install`

```elixir
@spec install(ClaudeWrapper.Config.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Install a plugin from available marketplaces.

Use `"name@marketplace"` to install from a specific marketplace.

## Options

  * `:scope` - Installation scope (`:user`, `:project`, or `:local`). Default: `:user`.
  * `:config` - Manifest `userConfig` values set at install time, as a list of
    `"key=value"` strings. Each entry emits a repeated `--config key=value`.

# `list`

```elixir
@spec list(
  ClaudeWrapper.Config.t(),
  keyword()
) :: {:ok, [map()]} | {:error, term()}
```

List installed plugins.

## Options

  * `:available` - Include available plugins from marketplaces (boolean, requires JSON output)

# `prune`

```elixir
@spec prune(
  ClaudeWrapper.Config.t(),
  keyword()
) :: {:ok, String.t()} | {:error, term()}
```

Remove auto-installed dependencies that are no longer needed.

Wraps `claude plugin prune` (alias `autoremove`).

## Options

  * `:dry_run` - List what would be removed without removing it (`--dry-run`, boolean).
  * `:scope` - Prune at scope (`:user`, `:project`, or `:local`). Default: `:user`.
  * `:yes` - Skip the confirmation prompt (`--yes`, boolean). Required when stdin or
    stdout is not a TTY, which every wrapper consumer is by definition.

# `tag`

```elixir
@spec tag(
  ClaudeWrapper.Config.t(),
  keyword()
) :: {:ok, String.t()} | {:error, term()}
```

Create a `{name}--v{version}` git tag for a plugin release.

Validates that the plugin's `plugin.json` and any enclosing marketplace entry
agree on the version before tagging. Without `:path`, the CLI uses the current
directory.

## Options

  * `:path` - Path to the plugin directory (positional argument).
  * `:dry_run` - Print what would be tagged without creating it (`--dry-run`, boolean).
  * `:force` - Skip the dirty-working-tree and tag-already-exists checks
    (`--force`, boolean).
  * `:message` - Tag annotation message; use `%s` for the version (`--message`).
  * `:push` - Push the tag to the remote after creating it (`--push`, boolean).
  * `:remote` - Remote to push to with `:push` (`--remote`). Default: `origin`.

# `uninstall`

```elixir
@spec uninstall(ClaudeWrapper.Config.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Uninstall an installed plugin.

## Options

  * `:scope` - Scope to uninstall from (`:user`, `:project`, or `:local`). Default: `:user`.
  * `:keep_data` - Preserve the plugin's persistent data directory (`--keep-data`, boolean).
  * `:prune` - Also remove auto-installed dependencies that are no longer needed
    (`--prune`, boolean). Requires `:yes` in non-interactive contexts.
  * `:yes` - Skip the `--prune` confirmation prompt (`--yes`, boolean). Required when
    stdin or stdout is not a TTY, which every wrapper consumer is by definition.

# `update`

```elixir
@spec update(ClaudeWrapper.Config.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Update a plugin to the latest version.

## Options

  * `:scope` - Scope (`:user`, `:project`, `:local`, or `:managed`). Default: `:user`.

# `validate`

```elixir
@spec validate(ClaudeWrapper.Config.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Validate a plugin or marketplace manifest at the given path.

## Options

  * `:strict` - Treat warnings as errors and exit non-zero (`--strict`,
    boolean). Intended for CI / programmatic validation.

---

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