The SHOW INDEX doesn't have enough information. You can try this:
select concat('ALTER TABLE `', table_schema, '`.`', table_name, '` ADD ',
if(non_unique, '', 'UNIQUE '), 'INDEX `', index_name, '` (',
group_concat('`', column_name, '`' order by seq_in_index), ');') as _ddl
from information_schema.statistics
where (table_schema, table_name) = (?, ?)
group by table_schema, table_name, index_name, non_unique;
You would need to fill in the schema and table name where I left placeholders ?, ?.
This is just to get you started. I know it doesn't account for a few options including prefix indexes, expression indexes, or comments. I'll leave that as an exercise for the reader.
Also it would generate a separate alter table statement for each index. If you want to do one alter table to add all indexes, use a subquery to generate the column list for each index, and then group_concat() to combine them in the outer query.