<commit_before>package command

import (
	"strings"
)

type GenCommand struct {
	Meta
}

func (c *GenCommand) Run(args []string) int {
	// Write your code here

	return 0
}

func (c *GenCommand) Synopsis() string {
	return ""
}

func (c *GenCommand) Help() string {<commit_msg>Add support for gen subcommand<commit_after>package command

import (
	"fmt"
	"os"
	"path/filepath"
	"strings"

	"github.com/wantedly/apig/apig"
	"github.com/wantedly/apig/util"
)

const (
	modelDir   = "models"
	targetFile = "main.go"
)

type GenCommand struct {
	Meta
}

func (c *GenCommand) Run(args []string) int {
	wd, err := os.Getwd()
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		return 1
	}
	if !util.FileExists(filepath.Join(wd, targetFile)) || !util.FileExists(filepath.Join(wd, modelDir)) {
		fmt.Fprintf(os.Stderr, `%s is not project root. Please move.
`, wd)
		return 1
	}
	return apig.Generate(wd, modelDir, targetFile)
}

func (c *GenCommand) Synopsis() string {
	return ""
}

func (c *GenCommand) Help() string {
{'fraction_non_alphanumeric': 0.14554455445544554, 'fraction_numerical': 0.0029702970297029703, 'mean_word_length': 4.055, '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': '5067536', 'n_tokens_mistral': 399, 'n_tokens_neox': 387, 'n_words': 100}