<commit_before>import { _ } from 'azk';
import { promiseResolve, promiseReject, isPromise } from 'azk/utils/promises';
import { Cli as AzkCli } from 'azk/cli/cli';
import { UI } from 'azk/cli/ui';
import { InvalidCommandError } from 'azk/utils/errors';

export class Cli extends AzkCli {
  invalidCmd(error) {
    this.fail("commands.not_found", error.command);
    this.showUsage();
    return promiseResolve(1);
  }
}

export function cli(args, cwd, ui = UI) {
  var result;
  try {
    var azk_cli = new Cli();
    azk_cli
      // Options
      .route('help', (p, args) => p.help || p['--help'] || _.isEmpty(args))
      .route('version', (p) => p.version || p['--version'])
      // Commands
      .route('agent', (p, args) => p.agent && /(start|status|stop)/.test(args))
      .route('vm', (p, args) => p.vm && /(ssh|start|status|installed|stop|remove)/.test(args))
      .route('config', (p, args) => p.vm && /(track-toggle|track-status)/.test(args))
      .route('docker')
      .route('doctor')
      .route('info')
      .route('init')
      .route('scale')
      .route('shell')
      .route('status')
      .route('start')
      .route('restart', (p) => p.restart, 'start.index')
      .route('stop'   , (p) => p.stop   , 'start.index')
      .route('logs')
      .route('help'); // If you do not fall in any other route, the help is called.

    result = azk_cli.run({
      argv: args.slice(2)
    }, {
      ui: ui,
      cwd: process.cwd()
    });
  } catch (e) {
    result = (e instanceof InvalidCommandError) ?
      azk_cli.invalidCmd(e) : promiseReject(e);
  }

  if (isPromise(result)) {
    result
      .then((code) => {
        ui.exit(code ? code : 0);
      })
      .catch((error) => {
        ui.fail(error);
        ui.exit(error.code ? error.code : 127);
      });
  } else {
    ui.exit(result);
  }
}
<commit_msg>[Cli] Fixing filter to cmd `config`<commit_after>import { _ } from 'azk';
import { promiseResolve, promiseReject, isPromise } from 'azk/utils/promises';
import { Cli as AzkCli } from 'azk/cli/cli';
import { UI } from 'azk/cli/ui';
import { InvalidCommandError } from 'azk/utils/errors';

export class Cli extends AzkCli {
  invalidCmd(error) {
    this.fail("commands.not_found", error.command);
    this.showUsage();
    return promiseResolve(1);
  }
}

export function cli(args, cwd, ui = UI) {
  var result;
  try {
    var azk_cli = new Cli();
    azk_cli
      // Options
      .route('help', (p, args) => p.help || p['--help'] || _.isEmpty(args))
      .route('version', (p) => p.version || p['--version'])
      // Commands
      .route('agent', (p, args) => p.agent && /(start|status|stop)/.test(args))
      .route('vm', (p, args) => p.vm && /(ssh|start|status|installed|stop|remove)/.test(args))
      .route('config', (p, args) => p.config && /(track-toggle|track-status)/.test(args))
      .route('docker')
      .route('doctor')
      .route('info')
      .route('init')
      .route('scale')
      .route('shell')
      .route('status')
      .route('start')
      .route('restart', (p) => p.restart, 'start.index')
      .route('stop'   , (p) => p.stop   , 'start.index')
      .route('logs')
      .route('help'); // If you do not fall in any other route, the help is called.

    result = azk_cli.run({
      argv: args.slice(2)
    }, {
      ui: ui,
      cwd: process.cwd()
    });
  } catch (e) {
    result = (e instanceof InvalidCommandError) ?
      azk_cli.invalidCmd(e) : promiseReject(e);
  }

  if (isPromise(result)) {
    result
      .then((code) => {
        ui.exit(code ? code : 0);
      })
      .catch((error) => {
        ui.fail(error);
        ui.exit(error.code ? error.code : 127);
      });
  } else {
    ui.exit(result);
  }
}

{'fraction_non_alphanumeric': 0.1968800430338892, 'fraction_numerical': 0.0032275416890801506, 'mean_word_length': 2.508490566037736, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '5784604', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1311, 'n_words': 277}