Class: Aidp::CLI::StorageCommand

Inherits:
Object
  • Object
show all
Includes:
MessageDisplay
Defined in:
lib/aidp/cli/storage_command.rb

Overview

Command handler for aidp storage subcommand

Provides commands for managing AIDP storage:

- migrate: Migrate file-based storage to SQLite
- status: Show storage migration status
- cleanup: Remove old file-based storage after migration

Usage:

aidp storage migrate
aidp storage migrate --dry-run
aidp storage migrate --no-backup
aidp storage status
aidp storage cleanup

Constant Summary

Constants included from MessageDisplay

MessageDisplay::COLOR_MAP, MessageDisplay::CRITICAL_TYPES

Instance Method Summary collapse

Methods included from MessageDisplay

#display_message, included, #message_display_prompt, #quiet_mode?

Constructor Details

#initialize(prompt: TTY::Prompt.new, project_dir: nil) ⇒ StorageCommand

Returns a new instance of StorageCommand.



24
25
26
27
# File 'lib/aidp/cli/storage_command.rb', line 24

def initialize(prompt: TTY::Prompt.new, project_dir: nil)
  @prompt = prompt
  @project_dir = project_dir || Dir.pwd
end

Instance Method Details

#run(args) ⇒ Object

Main entry point for storage command



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/aidp/cli/storage_command.rb', line 30

def run(args)
  subcommand = args.shift

  case subcommand
  when "migrate"
    run_migrate(args)
  when "status"
    run_status
  when "cleanup"
    run_cleanup(args)
  when "-h", "--help", nil
    display_usage
  else
    display_message("Unknown subcommand: #{subcommand}", type: :error)
    display_usage
  end
end