<commit_before>require 'thor'
require 'yaml'
require 'netrc'
require 'octokit'
require 'monotes/authenticator'
require 'monotes/issue_download'
require 'monotes/issue_repository'
require 'monotes/models/issue'
require 'monotes/app_directory'
require 'monotes/body_text'
require 'monotes/sync_list'

module Monotes
  module CLI
    class Application < Thor
      include Monotes::AppDirectory

      desc "login", "Login into GitHub"
      def login
        username = ask("Username > ")
        validate!("username", username)
        print "Password > "
        password = STDIN.noecho(&:gets).chomp
        validate!("password", password)
        STDOUT.puts "\n"
        authenticator = Monotes::Authenticator.new(Octokit::Client)
        begin
          oauth_token = authenticator.get_oauth_token(username, password) do
            print "Two-Factor token > "
            token = STDIN.gets.chomp
            validate!("Two-Factor token", token)
            token<commit_msg>Use ask with echo = false for password<commit_after>require 'thor'
require 'yaml'
require 'netrc'
require 'octokit'
require 'monotes/authenticator'
require 'monotes/issue_download'
require 'monotes/issue_repository'
require 'monotes/models/issue'
require 'monotes/app_directory'
require 'monotes/body_text'
require 'monotes/sync_list'

module Monotes
  module CLI
    class Application < Thor
      include Monotes::AppDirectory

      desc "login", "Login into GitHub"
      def login
        username = ask("Username > ")
        validate!("username", username)
        password = ask("Password > ", :echo => false)
        validate!("password", password)
        STDOUT.puts "\n"
        authenticator = Monotes::Authenticator.new(Octokit::Client)
        begin
          oauth_token = authenticator.get_oauth_token(username, password) do
            print "Two-Factor token > "
            token = STDIN.gets.chomp
            validate!("Two-Factor token", token)
            token
{'fraction_non_alphanumeric': 0.10229007633587786, 'fraction_numerical': 0.0, 'mean_word_length': 3.05360824742268, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1439986', 'n_tokens_mistral': 563, 'n_tokens_neox': 556, 'n_words': 137}