Module: Rubydex::CLI

Defined in:
lib/rubydex/cli.rb,
lib/rubydex/cli/command.rb,
lib/rubydex/cli/command/mcp.rb,
lib/rubydex/cli/command/lint.rb,
lib/rubydex/cli/command/query.rb,
lib/rubydex/cli/command/skill.rb,
lib/rubydex/cli/command/console.rb,
lib/rubydex/cli/command/lint/explain.rb

Overview

Command-line entry point for the rdx executable. It handles the top-level flags, resolves the subcommand and delegates to it, which keeps exe/rdx a thin shim.

Subcommands live one per file in lib/rubydex/cli/command/ and declare the name they answer to (see Command). Both dispatch and the rdx help command list are driven by that declaration, so adding a subcommand means adding a file — there is no dispatch table or usage text to keep in step.

Defined Under Namespace

Classes: Command

Constant Summary collapse

HEADER =

: String

"Usage: rdx <command> [options]"
"Run `rdx <command> --help` for command-specific options."
HELP_ENTRY =

help is served by the top-level flags rather than by a Command subclass, so its entry is listed here to keep it in the generated command list.

["help", "Show this help message"].freeze

Class Method Summary collapse

Class Method Details

.start(argv = ARGV) ⇒ Object

Entry point used by exe/rdx. : (?Array argv) -> void



22
23
24
25
26
27
28
29
# File 'lib/rubydex/cli.rb', line 22

def start(argv = ARGV)
  return if handle_top_level_flags(argv)

  # Everything past this point needs the native extension.
  require "rubydex"

  dispatch(argv.shift, argv)
end