-async function pluginsListCLI () {
- const { url, username, password } = await getServerCredentials(program)
- const accessToken = await getAdminTokenOrDie(url, username, password)
-
- let type: PluginType
- if (program['onlyThemes']) type = PluginType.THEME
- if (program['onlyPlugins']) type = PluginType.PLUGIN
-
- const res = await listPlugins({
- url,
- accessToken,
- start: 0,
- count: 100,
- sort: 'name',
- type
- })
- const plugins: PeerTubePlugin[] = res.body.data
-
- const table = new Table({
- head: ['name', 'version', 'homepage'],
+async function pluginsListCLI (command: Command, options: OptionValues) {
+ const { url, username, password } = await getServerCredentials(command)
+ const server = buildServer(url)
+ await assignToken(server, username, password)
+
+ let pluginType: PluginType
+ if (options.onlyThemes) pluginType = PluginType.THEME
+ if (options.onlyPlugins) pluginType = PluginType.PLUGIN
+
+ const { data } = await server.plugins.list({ start: 0, count: 100, sort: 'name', pluginType })
+
+ const table = new CliTable3({
+ head: [ 'name', 'version', 'homepage' ],