Add query subcommand