> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tuneplane.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# tp plugin

> 插件中心：发布、安装、锁定与治理

工作流讲解见[插件中心](/zh-Hans/extend/overview)。

## 浏览

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin ls                        # 平台上的插件
tp plugin info <owner>/<name>       # manifest、版本历史、digest
```

## 安装与锁定

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin install <owner>/<name>                # 下载到本地 tuneplane_plugins/（缺省最新版）
tp plugin install <owner>/<name> --exp my-grpo  # 锁定到实验 plugins.lock.json
tp plugin remove <owner>/<name> --exp my-grpo   # 从实验锁移除引用
```

| `install` 选项 | 说明                              |
| ------------ | ------------------------------- |
| `-e, --exp`  | 锁定到该实验：提交时随 JobSpec 引用，由平台注入作业包 |

## 发布

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin publish ./my-plugin                 # 目录内须有 plugin.yaml
tp plugin publish ./my-plugin --owner team-x  # admin 可跨命名空间
```

发布时校验：入口模块存在、不占用保留顶层名、包大小预检。**版本不可变**——迭代发新版本。

## 治理（admin）

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin disable <owner>/<name>    # 新作业不可引用；历史记录保留
tp plugin enable <owner>/<name>
```

## `tp plugin`

Manage plugins

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin <subcommand>
```

| 命令                  | 说明                                 |
| ------------------- | ---------------------------------- |
| `tp plugin disable` | Disable a plugin                   |
| `tp plugin enable`  | Enable a plugin (admin)            |
| `tp plugin info`    | Show a plugin's details            |
| `tp plugin install` | Install a plugin                   |
| `tp plugin ls`      | List the plugins on the platform   |
| `tp plugin publish` | Publish a plugin version           |
| `tp plugin remove`  | Remove a plugin from an experiment |

### `tp plugin disable`

Disable a plugin

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin disable <REF>
```

| 参数    | 说明                                              |
| ----- | ----------------------------------------------- |
| `REF` | Plugin id: \<owner>/\<name>\[@version] (**必填**) |

除 `--help` 外没有其他选项。

### `tp plugin enable`

Enable a plugin (admin)

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin enable <REF>
```

| 参数    | 说明                                              |
| ----- | ----------------------------------------------- |
| `REF` | Plugin id: \<owner>/\<name>\[@version] (**必填**) |

除 `--help` 外没有其他选项。

### `tp plugin info`

Show a plugin's details

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin info <REF>
```

| 参数    | 说明                                              |
| ----- | ----------------------------------------------- |
| `REF` | Plugin id: \<owner>/\<name>\[@version] (**必填**) |

除 `--help` 外没有其他选项。

### `tp plugin install`

Install a plugin

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin install <REF> [options]
```

| 参数    | 说明                                                                      |
| ----- | ----------------------------------------------------------------------- |
| `REF` | Plugin id: \<owner>/\<name>\[@version], defaults to the latest (**必填**) |

| 选项            | 说明                                                                                                                   |
| ------------- | -------------------------------------------------------------------------------------------------------------------- |
| `--exp`, `-e` | Lock it to this experiment: referenced with the JobSpec on submission, injected into the job package by the platform |

### `tp plugin ls`

List the plugins on the platform

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin ls
```

除 `--help` 外没有其他选项。

### `tp plugin publish`

Publish a plugin version

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin publish <PATH> [options]
```

| 参数     | 说明                        |
| ------ | ------------------------- |
| `PATH` | Plugin directory (**必填**) |

| 选项        | 说明                                                                          |
| --------- | --------------------------------------------------------------------------- |
| `--owner` | Target namespace (only an admin can cross namespaces; defaults to your own) |

### `tp plugin remove`

Remove a plugin from an experiment

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tp plugin remove <REF> [options]
```

| 参数    | 说明                                   |
| ----- | ------------------------------------ |
| `REF` | Plugin id: \<owner>/\<name> (**必填**) |

| 选项            | 说明                               |
| ------------- | -------------------------------- |
| `--exp`, `-e` | Experiment name or path (**必填**) |
