Class: SwarmCLI::Commands::Migrate
- Inherits:
-
Object
- Object
- SwarmCLI::Commands::Migrate
- Defined in:
- lib/swarm_cli/commands/migrate.rb
Overview
Migrate command converts Claude Swarm v1 configurations to SwarmSDK v2 format.
Usage:
swarm migrate old-config.yml
swarm migrate old-config.yml --output new-config.yml
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options) ⇒ Migrate
constructor
A new instance of Migrate.
Constructor Details
#initialize(options) ⇒ Migrate
Returns a new instance of Migrate.
14 15 16 |
# File 'lib/swarm_cli/commands/migrate.rb', line 14 def initialize() = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/swarm_cli/commands/migrate.rb', line 12 def end |
Instance Method Details
#execute ⇒ Object
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 43 44 45 46 |
# File 'lib/swarm_cli/commands/migrate.rb', line 18 def execute # Validate options .validate! # Create migrator migrator = Migrator.new(.input_file) # Perform migration migrated_yaml = migrator.migrate # Write to output file or stdout if .output File.write(.output, migrated_yaml) $stderr.puts "✓ Migration complete! Converted configuration saved to: #{options.output}" else puts migrated_yaml end exit(0) rescue SwarmCLI::ExecutionError => e handle_error(e) exit(1) rescue Interrupt $stderr.puts "\n\nMigration cancelled by user" exit(130) rescue StandardError => e handle_error(e) exit(1) end |