<commit_before>import { Command, flags } from 'cli-engine-command'
import { cli } from 'cli-ux'
import { Hooks } from '../../hooks'
import { Plugins } from '../../plugins'

let examplePlugin = 'heroku-production-status'
let bin = 'heroku'
const g = global as any
if (g.config) {
  bin = g.config.bin
  let pjson = g.config.pjson['cli-engine']
  if (pjson.help && pjson.help.plugins) {
    examplePlugin = Object.keys(pjson.help.plugins)[0]
  }
}

export default class PluginsInstall extends Command {
  static topic = 'plugins'
  static command = 'install'
  static description = 'installs a plugin into the CLI'
  static help = `
  Example:
    $ ${bin} plugins:install ${examplePlugin}
  `
  static args = [{ name: 'plugin', description: 'plugin to install', required: true }]
  static flags: flags.Input = {
    force: flags.boolean({ char: 'f' }),
  }

  async run() {
    const plugins = new Plugins(this.config)
    const [plugin, tag = 'latest'] = this.argv[0].split('@')
    if (!this.config.debug) cli.action.start(`Installing plugin ${plugin}${tag === 'latest' ? '' : '@' + tag}`)
    await plugins.install({ type: 'user', name: plugin, tag, force: this.flags.force })
    const hooks = new Hooks(this.config)
    await hooks.run('update')
  }
}<commit_msg>install multiple plugins at once<commit_after>import { Command, flags } from 'cli-engine-command'
import { cli } from 'cli-ux'
import { Hooks } from '../../hooks'
import { Plugins } from '../../plugins'

let examplePlugin = 'heroku-production-status'
let bin = 'heroku'
const g = global as any
if (g.config) {
  bin = g.config.bin
  let pjson = g.config.pjson['cli-engine']
  if (pjson.help && pjson.help.plugins) {
    examplePlugin = Object.keys(pjson.help.plugins)[0]
  }
}

export default class PluginsInstall extends Command {
  static topic = 'plugins'
  static command = 'install'
  static description = 'installs a plugin into the CLI'
  static usage = 'plugins:install PLUGIN...'
  static help = `
  Example:
    $ ${bin} plugins:install ${examplePlugin}
  `
  static variableArgs = true
  static args = [{ name: 'plugin', description: 'plugin to install', required: true }]
  static flags: flags.Input = {
    force: flags.boolean({ char: 'f' }),
  }

  async run() {
    const plugins = new Plugins(this.config)
    for (let plugin of this.argv) {
      const [name, tag = 'latest'] = plugin.split('@')
      if (!this.config.debug) cli.action.start(`Installing plugin ${name}${tag === 'latest' ? '' : '@' + tag}`)
      await plugins.install({ type: 'user', name, tag, force: this.flags.force })
    }
    const hooks = new Hooks(this.config)
    await hooks.run('update')
  }
}
{'fraction_non_alphanumeric': 0.1592021076401957, 'fraction_numerical': 0.0011290929619872036, 'mean_word_length': 3.49746192893401, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6516946', 'n_tokens_mistral': 850, 'n_tokens_neox': 856, 'n_words': 247}