Class: Harnex::AgentsGuide

Inherits:
Object
  • Object
show all
Defined in:
lib/harnex/commands/agents_guide.rb

Constant Summary collapse

GUIDES_DIR =
File.expand_path("../../../../guides", __FILE__)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ AgentsGuide

Returns a new instance of AgentsGuide.



31
32
33
# File 'lib/harnex/commands/agents_guide.rb', line 31

def initialize(argv)
  @argv = argv.dup
end

Class Method Details

.usageObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/harnex/commands/agents_guide.rb', line 5

def self.usage
  <<~TEXT
    Usage: harnex agents-guide [list|show <topic>|<topic>]

    Subcommands:
      list           List available agent guide topics (default)
      show <topic>   Print a guide by name or number

    Examples:
      harnex agents-guide
      harnex agents-guide list
      harnex agents-guide show 01
      harnex agents-guide show dispatch
      harnex agents-guide monitoring

    Common patterns:
      harnex agents-guide dispatch
      harnex agents-guide chain
      harnex agents-guide naming

    Gotchas:
      Agent guides replace the old harnex skills install flow.
      They are packaged with the gem and require no external project docs.
  TEXT
end

Instance Method Details

#runObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/harnex/commands/agents_guide.rb', line 35

def run
  subcommand = @argv.shift
  case subcommand
  when nil, "list"
    list_guides
  when "show"
    show_guide(@argv.first)
  when "-h", "--help"
    puts self.class.usage
    0
  else
    show_guide(subcommand)
  end
end