<commit_before>import * as chalk from 'chalk';

import {
  BACKEND_PRO,
  Command,
  CommandLineInputs,
  CommandLineOptions,
  CommandMetadata,
  pathExists,
  prettyPath,
} from '@ionic/cli-utils';

@CommandMetadata({
  name: 'setup',
  type: 'global',
  backends: [BACKEND_PRO],
  description: 'Setup your Ionic SSH keys automatically',
})
export class SSHSetupCommand extends Command {
  async run(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void | number> {
    const [{ getGeneratedPrivateKeyPath }, { getSSHConfigPath }] = await Promise.all([import('../../lib/ssh'), import('../../lib/ssh-config')]);

    const config = await this.env.config.load();

    const sshconfigPath = getSSHConfigPath();
    const keyPath = await getGeneratedPrivateKeyPath(this.env);
    const pubkeyPath = `${keyPath}.pub`;

    // TODO: link to docs about manual git setup

    const [ pubkeyExists, keyExists ] = await Promise.all([pathExists(keyPath), pathExists(pubkeyPath)]);

    if (config.git.setup) {
      const rerun = await this.env.prompt({
        type: 'confirm',
        name: 'confirm',
        message: `SSH setup wizard has run before. Would you like to run it again?`,
      });

      if (!rerun) {
        return 0;
      }
    } else if (!pubkeyExists && !keyExists) {
      this.env.log.info(
        'The automatic SSH setup will do the following:\n' +
        `1) Generate SSH key pair with OpenSSH.\n` +
        `2) Upload the generated SSH public key to our server, registering it on your account.\n` +
        `3) Modify your SSH config (${chalk.bold(prettyPath(sshconfigPath))}) to use the generated SSH private key for our server(s).`
      );

      const confirm = await this.env.prompt({
        type: 'confirm',
        name: 'confirm',
        message: 'May we proceed?',
      });

      if (!confirm) {
        return 1;
      }<commit_msg>chore(ssh): less scary words<commit_after>import * as chalk from 'chalk';

import {
  BACKEND_PRO,
  Command,
  CommandLineInputs,
  CommandLineOptions,
  CommandMetadata,
  pathExists,
  prettyPath,
} from '@ionic/cli-utils';

@CommandMetadata({
  name: 'setup',
  type: 'global',
  backends: [BACKEND_PRO],
  description: 'Setup your Ionic SSH keys automatically',
})
export class SSHSetupCommand extends Command {
  async run(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void | number> {
    const [{ getGeneratedPrivateKeyPath }, { getSSHConfigPath }] = await Promise.all([import('../../lib/ssh'), import('../../lib/ssh-config')]);

    const config = await this.env.config.load();

    const sshconfigPath = getSSHConfigPath();
    const keyPath = await getGeneratedPrivateKeyPath(this.env);
    const pubkeyPath = `${keyPath}.pub`;

    // TODO: link to docs about manual git setup

    const [ pubkeyExists, keyExists ] = await Promise.all([pathExists(keyPath), pathExists(pubkeyPath)]);

    if (config.git.setup) {
      const rerun = await this.env.prompt({
        type: 'confirm',
        name: 'confirm',
        message: `SSH setup wizard has run before. Would you like to run it again?`,
      });

      if (!rerun) {
        return 0;
      }
    } else if (!pubkeyExists && !keyExists) {
      this.env.log.info(
        'The automatic SSH setup will do the following:\n' +
        `1) Generate a new SSH key pair with OpenSSH (will not overwrite any existing keys).\n` +
        `2) Upload the generated SSH public key to our server, registering it on your account.\n` +
        `3) Modify your SSH config (${chalk.bold(prettyPath(sshconfigPath))}) to use the generated SSH private key for our server(s).`
      );

      const confirm = await this.env.prompt({
        type: 'confirm',
        name: 'confirm',
        message: 'May we proceed?',
      });

      if (!confirm) {
        return 1;
      }
{'fraction_non_alphanumeric': 0.12767624020887727, 'fraction_numerical': 0.0026109660574412533, 'mean_word_length': 2.990625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2353141', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1115, 'n_words': 351}