Class: Legion::CLI::Features

Inherits:
Thor
  • Object
show all
Defined in:
lib/legion/cli/features_command.rb

Constant Summary collapse

BUNDLES =
{
  tasking:       {
    label:       'Tasking Engine',
    description: 'Task scheduling, chaining, conditioning, and metering',
    gems:        %w[lex-tasker lex-scheduler lex-lex lex-conditioner lex-transformer lex-health lex-metering]
  },
  cognitive:     {
    label:       'Cognitive / Agentic',
    description: 'Full GAIA cognitive stack (13 agentic domains + tick + mesh + apollo)',
    gems:        %w[legion-gaia]
  },
  ai:            {
    label:       'AI / LLM',
    description: 'LLM routing, provider integration, and MCP tools',
    gems:        %w[legion-llm legion-mcp]
  },
  observability: {
    label:       'Observability',
    description: 'Telemetry, logging, anomaly detection, and webhooks',
    gems:        %w[lex-telemetry lex-log lex-webhook lex-detect]
  },
  governance:    {
    label:       'Governance & Security',
    description: 'RBAC, audit trails, FinOps, PII protection, and lifecycle governance',
    gems:        %w[lex-governance lex-audit lex-finops lex-privatecore]
  },
  channels:      {
    label:       'Chat Channels',
    description: 'Slack, Microsoft Teams, and GitHub chat adapters',
    gems:        %w[lex-slack lex-microsoft_teams lex-github]
  },
  devtools:      {
    label:       'Development Tools',
    description: 'Eval gating, datasets, prompt templates, autofix, and mind-growth',
    gems:        %w[lex-eval lex-dataset lex-prompt lex-autofix lex-mind-growth]
  },
  swarm:         {
    label:       'Swarm / Multi-Agent',
    description: 'Multi-agent orchestration, GitHub swarm pipeline, and ACP adapter',
    gems:        %w[lex-swarm lex-swarm-github lex-adapter lex-acp]
  },
  services:      {
    label:       'Service Integrations',
    description: 'HTTP, Vault, and Consul service connectors',
    gems:        %w[lex-http lex-vault lex-consul]
  }
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/legion/cli/features_command.rb', line 13

def self.exit_on_failure?
  true
end

Instance Method Details

#installObject



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/legion/cli/features_command.rb', line 71

def install
  out = formatter
  selected = options[:all] ? BUNDLES.keys : prompt_bundle_selection(out)

  return out.error('No bundles selected') if selected.empty?

  gems = resolve_gems(selected)
  installed, missing = partition_gems(gems)

  if missing.empty?
    report_all_present(out, selected, installed)
  elsif options[:dry_run]
    report_dry_run(out, selected, installed, missing)
  else
    execute_install(out, selected, installed, missing)
  end
end

#listObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/legion/cli/features_command.rb', line 90

def list
  out = formatter
  statuses = bundle_statuses

  if options[:json]
    out.json(bundles: statuses)
  else
    out.header('Feature Bundles')
    out.spacer
    statuses.each { |s| print_bundle_status(out, s) }
    out.spacer
    installed_count = statuses.count { |s| s[:missing].empty? }
    puts "  #{installed_count} of #{statuses.size} bundle(s) fully installed"
  end
end