Class: ClaudeMemory::Commands::BaseCommand
- Inherits:
-
Object
- Object
- ClaudeMemory::Commands::BaseCommand
- Defined in:
- lib/claude_memory/commands/base_command.rb
Overview
Base class for all CLI commands. Provides consistent interface for commands with I/O isolation for testing.
Direct Known Subclasses
ChangesCommand, CompactCommand, CompletionCommand, ConflictsCommand, DbInitCommand, DoctorCommand, EmbeddingsCommand, ExplainCommand, ExportCommand, GitLfsCommand, HelpCommand, HookCommand, IndexCommand, IngestCommand, InitCommand, InstallSkillCommand, PromoteCommand, PublishCommand, RecallCommand, RecoverCommand, RejectCommand, RestoreCommand, SearchCommand, ServeMcpCommand, StatsCommand, SweepCommand, UninstallCommand, VersionCommand
Instance Attribute Summary collapse
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdin ⇒ Object
readonly
Returns the value of attribute stdin.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#call(args) ⇒ Integer
Execute the command with given arguments.
-
#initialize(stdout: $stdout, stderr: $stderr, stdin: $stdin) ⇒ BaseCommand
constructor
A new instance of BaseCommand.
Constructor Details
#initialize(stdout: $stdout, stderr: $stderr, stdin: $stdin) ⇒ BaseCommand
Returns a new instance of BaseCommand.
38 39 40 41 42 |
# File 'lib/claude_memory/commands/base_command.rb', line 38 def initialize(stdout: $stdout, stderr: $stderr, stdin: $stdin) @stdout = stdout @stderr = stderr @stdin = stdin end |
Instance Attribute Details
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
33 34 35 |
# File 'lib/claude_memory/commands/base_command.rb', line 33 def stderr @stderr end |
#stdin ⇒ Object (readonly)
Returns the value of attribute stdin.
33 34 35 |
# File 'lib/claude_memory/commands/base_command.rb', line 33 def stdin @stdin end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
33 34 35 |
# File 'lib/claude_memory/commands/base_command.rb', line 33 def stdout @stdout end |
Instance Method Details
#call(args) ⇒ Integer
Execute the command with given arguments
47 48 49 |
# File 'lib/claude_memory/commands/base_command.rb', line 47 def call(args) raise NotImplementedError, "Subclass must implement #call" end |