Module: Brainiac::Plugins::Discord::Cli

Defined in:
lib/brainiac/plugins/discord/cli.rb

Overview

CLI subcommands for brainiac-discord plugin.

Invoked when a user runs brainiac discord <command>. Manages discord.json config and agent bot tokens.

Constant Summary collapse

BRAINIAC_DIR =
ENV.fetch("BRAINIAC_DIR", File.join(Dir.home, ".brainiac"))
DISCORD_CONFIG_FILE =
File.join(BRAINIAC_DIR, "discord.json")
AGENT_REGISTRY_FILE =
File.join(BRAINIAC_DIR, "agents.json")

Class Method Summary collapse

Class Method Details

.run(args) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/brainiac/plugins/discord/cli.rb', line 20

def run(args)
  command = args.shift

  case command
  when "config"
    cmd_config
  when "map"
    cmd_map(args)
  when "default"
    cmd_default(args)
  when "token"
    cmd_token(args)
  when "status"
    cmd_status
  when "owner"
    cmd_owner(args)
  when "setup"
    cmd_setup
  else
    print_help
  end
end