Class: ClaudeMemory::Commands::DoctorCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/claude_memory/commands/doctor_command.rb

Overview

Performs system health checks for ClaudeMemory Delegates to specialized check classes for actual validation

Instance Attribute Summary

Attributes inherited from BaseCommand

#stderr, #stdin, #stdout

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from ClaudeMemory::Commands::BaseCommand

Instance Method Details

#call(args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/claude_memory/commands/doctor_command.rb', line 10

def call(args)
  opts = parse_options(args, {brief: false}) do |o|
    OptionParser.new do |parser|
      parser.on("--brief", "Output single-line status summary") { o[:brief] = true }
    end
  end
  return 1 if opts.nil?

  manager = ClaudeMemory::Store::StoreManager.new

  checks = [
    Checks::DatabaseCheck.new(manager.global_db_path, "global"),
    Checks::DatabaseCheck.new(manager.project_db_path, "project"),
    Checks::DistillCheck.new(manager.global_db_path, "global"),
    Checks::DistillCheck.new(manager.project_db_path, "project"),
    Checks::VecCheck.new,
    Checks::SnapshotCheck.new,
    Checks::ClaudeMdCheck.new,
    Checks::HooksCheck.new
  ]

  results = checks.map(&:call)

  manager.close

  if opts[:brief]
    report_brief(results)
  else
    reporter = Checks::Reporter.new(stdout, stderr)
    success = reporter.report(results)
    success ? 0 : 1
  end
end