Module: AIA

Defined in:
lib/aia/main.rb,
lib/aia.rb,
lib/aia/clause.rb,
lib/aia/version.rb

Overview

aia/lib/aia/clause.rb

Defined Under Namespace

Modules: BackendCommon, Clause, DynamicContent, UserQuery Classes: AiClientBackend, Cli, Client, Config, Directives, Editor, Fzf, Glow, Llm, Logging, Main, Mods, Prompt, Sgpt, Subl, Tools, Vim

Constant Summary collapse

VERSION_FILEPATH =
"#{__dir__}/../../.version"
VERSION =
Versionaire::Version File.read(VERSION_FILEPATH).strip

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.clientObject

Returns the value of attribute client.



49
50
51
# File 'lib/aia.rb', line 49

def client
  @client
end

.configObject

Returns the value of attribute config.



48
49
50
# File 'lib/aia.rb', line 48

def config
  @config
end

Class Method Details

.debug?Boolean

Returns:

  • (Boolean)


75
# File 'lib/aia.rb', line 75

def debug?    = AIA.config.debug?

.run(args = ARGV) ⇒ Object



51
52
53
54
55
56
57
58
59
60
# File 'lib/aia.rb', line 51

def run(args=ARGV)
  args = args.split(' ') if args.is_a?(String)

  # TODO: Currently this is a one and done architecture.
  #       If the args contain an "-i" or and "--interactive"
  #       flag could this turn into some kind of
  #       conversation REPL?
  
  AIA::Main.new(args).call
end

.speak(what) ⇒ Object



63
64
65
66
67
68
69
70
71
# File 'lib/aia.rb', line 63

def speak(what)
  return unless config.speak?

  if OS.osx? && 'siri' == config.voice.downcase
    system "say #{Shellwords.escape(what)}"
  else
    Client.speak(what)
  end
end

.verbose?Boolean

Returns:

  • (Boolean)


74
# File 'lib/aia.rb', line 74

def verbose?  = AIA.config.verbose?

.versionObject



9
# File 'lib/aia/version.rb', line 9

def self.version  = VERSION