There is nothing special about subcommands, they are simply command objects registered under a nested command name:
#!/usr/bin/env ruby
extend Dry::CLI::Registry
end
end
end
end
end
end
Foo::CLI::Commands.register "generate configuration", Foo::CLI::Commands::Generate::Configuration
Dry::CLI.new(Foo::CLI::Commands).call