Files
VERSE ebde9ba68f refactor(commands): separate commands and its core into two folders (#32)
- I think it would be better if one for commands only, one for the spec
handling core logic so people won't be confused by the core logic inside
the commands folder (cleaner I guess)
- Regen docs
2026-07-05 11:27:30 +07:00

97 lines
5.7 KiB
Go

package golang
import (
"github.com/versenilvis/iris/spec"
)
func init() {
spec.Register(&spec.Spec{
Name: "goctl",
Description: "A cli tool to generate go-zero code",
Subcommands: []spec.Subcommand{
{Name: "api", Description: "Generate api related files"},
{Name: "dart", Description: "Generate dart files for provided api in api file"},
{Name: "doc", Description: "Generate doc files"},
{Name: "format", Description: "Format api files"},
{Name: "go", Description: "Generate go files for provided api in yaml file"},
{Name: "java", Description: "Generate java files for provided api in api file"},
{Name: "kt", Description: "Generate kotlin code for provided api file"},
{Name: "new", Description: "Fast create api service"},
{Name: "plugin", Description: "Custom file generator"},
{Name: "ts", Description: "Generate ts files for provided api in api file"},
{Name: "validate", Description: "Validate api file"},
{Name: "bug", Description: "Report a bug"},
{Name: "completion", Description: "Generate the autocompletion script for the specified shell"},
{Name: "bash", Description: "Generate the autocompletion script for bash"},
{Name: "fish", Description: "Generate the autocompletion script for fish"},
{Name: "powershell", Description: "Generate the autocompletion script for powershell"},
{Name: "zsh", Description: "Generate the autocompletion script for zsh"},
{Name: "docker", Description: "Generate Dockerfile"},
{Name: "env", Description: "Check or edit goctl environment"},
{Name: "check", Description: "Detect goctl env and dependency tools"},
{Name: "install", Description: "Goctl env installation"},
{Name: "kube", Description: "Generate kubernetes files"},
{Name: "deploy", Description: "Generate deployment yaml file"},
{Name: "migrate", Description: "Migrate from tal-tech to zeromicro"},
{Name: "model", Description: "Generate model code"},
{Name: "mongo", Description: "Generate mongo model"},
{Name: "mysql", Description: "Generate mysql model"},
{Name: "datasource", Description: "Generate model from datasource"},
{Name: "ddl", Description: "Generate mysql model from ddl"},
{Name: "pg", Description: "Generate postgresql model"},
{Name: "quickstart", Description: "Quickly start a project"},
{Name: "rpc", Description: "Generate rpc code"},
{Name: "protoc", Description: "Generate grpc code"},
{Name: "template", Description: "Generate proto template"},
{Name: "clean", Description: "Clean the all cache templates"},
{Name: "init", Description: "Initialize the all templates(force update)"},
{Name: "revert", Description: "Revert the target template to the latest"},
{Name: "update", Description: "Update template of the target category to the latest"},
{Name: "upgrade", Description: "Upgrade goctl to latest version"},
{Name: "help", Description: "Help about any command"},
},
Options: []spec.Option{
{Name: "--api", Description: "The api file"},
{Name: "--dir", Description: "The target dir"},
{Name: "--hostname", Description: "Hostname of the server"},
{Name: "--legacy", Description: "Legacy generator for flutter v1"},
{Name: "--o", Description: "The output markdown directory"},
{Name: "--declare", Description: "Use to skip check api types already declare"},
{Name: "--iu", Description: "Ignore update"},
{Name: "--stdin", Description: "Generate go files for provided api in yaml file"},
{Name: "--branch", Description: "The branch of the remote repo, it does work with --remote"},
{Name: "--home", Description: "Generate java files for provided api in api file"},
{Name: "--pkg", Description: "Define package name for kotlin file"},
{Name: "--plugin", Description: "The plugin file"},
{Name: "--style", Description: "Generate ts files for provided api in api file"},
{Name: "--caller", Description: "The web api caller"},
{Name: "--unwrap", Description: "Unwrap the webapi caller for import"},
{Name: "--webapi", Description: "The web api file path"},
{Name: "--remote", Description: "Report a bug"},
{Name: "--no-descriptions", Description: "Disable completion descriptions"},
{Name: "--base", Description: "The base image to build the docker image, default scratch"},
{Name: "--go", Description: "The directory that contains main function"},
{Name: "--version", Description: "The goctl builder golang image version"},
{Name: "--install", Description: "Install dependencies if not found"},
{Name: "--write", Description: "Edit goctl environment"},
{Name: "--force", Description: "Silent installation of non-existent dependencies"},
{Name: "--verbose", Description: "Enable log output"},
{Name: "--limitCpu", Description: "The limit cpu to deploy"},
{Name: "--limitMem", Description: "The limit memory to deploy"},
{Name: "--maxReplicas", Description: "The max replicas to deploy"},
{Name: "--minReplicas", Description: "The min replicas to deploy"},
{Name: "--name", Description: "The name of deployment (required)"},
{Name: "--namespace", Description: "The namespace of deployment (required)"},
{Name: "--nodePort", Description: "The nodePort of the deployment to expose"},
{Name: "--port", Description: "The port of the deployment to listen on pod (required)"},
{Name: "--requestCpu", Description: "The request cpu to deploy"},
{Name: "--requestMem", Description: "The request memory to deploy"},
{Name: "--revisions", Description: "The number of revision history to limit"},
{Name: "--secret", Description: "The secret to image pull from registry"},
{Name: "--serviceAccount", Description: "The ServiceAccount for the deployment"},
{Name: "--cache", Description: "Generate code with cache [optional]"},
{Name: "--url", Description: "Generate mysql model from ddl"},
},
})
}