<commit_before>package cmd

import (
	"fmt"
	"os"

	"github.com/ironman-project/ironman/template/repository/git"
	"github.com/olekukonko/tablewriter"
	"github.com/spf13/cobra"
)

// listCmd represents the list command
var listCmd = &cobra.Command{
	Use:   "list",
	Short: "Lists the available installed templates with its ID and description",
	Long: `Lists the available installed templates with its ID description:

Example:
ironman list
+------+-----------------------+--------------+
| ID   |      Name             |  Description |
+------+-----------------------+--------------+
|  A   |       The Good        |    500 	  |
|  B   | The Very very Bad Man |    288       |
|  C   |       The Ugly        |    120       |
|  D   |      The Gopher       |    800       |
+------+-----------------------+--------------+

`,
	RunE: func(cmd *cobra.Command, args []string) error {

		repository := git.New(ironmanHome)
		fmt.Println("Installed templates")
		installedList, err := repository.Installed()
		if err != nil {
			return err
		}
		table := tablewriter.NewWriter(os.Stdout)
		table.SetHeader([]string{"ID", "Name", "Description"})

		for _, installed := range installedList {
			table.Append([]string{installed.ID, installed.ID, "TODO"})
		}
		table.Render() // Send output
		return nil
	},
}

func init() {
	rootCmd.AddCommand(listCmd)

}<commit_msg>#9 update ironman list example output<commit_after>package cmd

import (
	"fmt"
	"os"

	"github.com/ironman-project/ironman/template/repository/git"
	"github.com/olekukonko/tablewriter"
	"github.com/spf13/cobra"
)

// listCmd represents the list command
var listCmd = &cobra.Command{
	Use:   "list",
	Short: "Lists the available installed templates with its ID and description",
	Long: `Lists the available installed templates with its ID description:

Example:
ironman list

+--------------------+--------------------+-------------+
|         ID         |        NAME        | DESCRIPTION |
+--------------------+--------------------+-------------+
| wizard-hello-world | wizard-hello-world | TODO        |
+--------------------+--------------------+-------------+
`,
	RunE: func(cmd *cobra.Command, args []string) error {

		repository := git.New(ironmanHome)
		fmt.Println("Installed templates")
		installedList, err := repository.Installed()
		if err != nil {
			return err
		}
		table := tablewriter.NewWriter(os.Stdout)
		table.SetHeader([]string{"ID", "Name", "Description"})

		for _, installed := range installedList {
			table.Append([]string{installed.ID, installed.ID, "TODO"})
		}
		table.Render() // Send output
		return nil
	},
}

func init() {
	rootCmd.AddCommand(listCmd)

}
{'fraction_non_alphanumeric': 0.22914307285768215, 'fraction_numerical': 0.006417516043790109, 'mean_word_length': 2.0849825378346916, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5467635', 'n_tokens_mistral': 855, 'n_tokens_neox': 783, 'n_words': 193}