$ hz --help
NAME:
hz - A idl parser and code generator for Hertz projects
USAGE:
hz [global options] command [command options] [arguments...]
VERSION:
v0.x.x
COMMANDS:
new Generate a new Hertz project
update Update an existing Hertz project
model Generate model code only
client Generate hertz client based on IDL
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--verbose turn on verbose mode (default: false)
--help, -h show help (default: false)
--version, -v print the version (default: false)
$ hz help new
NAME:
hz new - Generate a new Hertz project
USAGE:
hz new [command options] [arguments...]
OPTIONS:
--idl value [ --idl value ] Specify the IDL file path. (.thrift or .proto)
--service value Specify the service name.
--module value, --mod value Specify the Go module name.
--out_dir value Specify the project path.
--handler_dir value Specify the handler relative path (based on "out_dir").
--model_dir value Specify the model relative path (based on "out_dir").
--router_dir value Specify the router relative path (based on "out_dir").
--client_dir value Specify the client path. If not specified, IDL generated path is used for 'client' command; no client code is generated for 'new' command
--use value Specify the model package to import for handler.
--proto_path value, -I value [ --proto_path value, -I value ] Add an IDL search path for includes. (Valid only if idl is protobuf)
--thriftgo value, -t value [ --thriftgo value, -t value ] Specify arguments for the thriftgo. ({flag}={value})
--protoc value, -p value [ --protoc value, -p value ] Specify arguments for the protoc. ({flag}={value})
--option_package value, -P value [ --option_package value, -P value ] Specify the package path. ({include_path}={import_path})
--no_recurse Generate master model only. (default: false)
--force, -f Force new a project, which will overwrite the generated files (default: false)
--enable_extends Parse 'extends' for thrift IDL (default: false)
--json_enumstr Use string instead of num for json enums when idl is thrift. (default: false)
--unset_omitempty Remove 'omitempty' tag for generated struct. (default: false)
--pb_camel_json_tag Convert Name style for json tag to camel(Only works protobuf). (default: false)
--snake_tag Use snake_case style naming for tags. (Only works for 'form', 'query', 'json') (default: false)
--rm_tag value [ --rm_tag value ] Remove the specified tag
--exclude_file value, -E value [ --exclude_file value, -E value ] Specify the files that do not need to be updated.
--customize_layout value Specify the path for layout template.
--customize_layout_data_path value Specify the path for layout template render data.
--customize_package value Specify the path for package template.
--handler_by_method Generate a separate handler file for each method. (default: false)
--protoc-plugins value [ --protoc-plugins value ] Specify plugins for the protoc. ({plugin_name}:{options}:{out_dir})
--thrift-plugins value [ --thrift-plugins value ] Specify plugins for the thriftgo. ({plugin_name}:{options})
--help, -h show help (default: false)
$ hz help update
NAME:
hz update - Update an existing Hertz project
USAGE:
hz update [command options] [arguments...]
OPTIONS:
--idl value [ --idl value ] Specify the IDL file path. (.thrift or .proto)
--module value, --mod value Specify the Go module name.
--out_dir value Specify the project path.
--handler_dir value Specify the handler relative path (based on "out_dir").
--model_dir value Specify the model relative path (based on "out_dir").
--client_dir value Specify the client path. If not specified, IDL generated path is used for 'client' command; no client code is generated for 'new' command
--use value Specify the model package to import for handler.
--proto_path value, -I value [ --proto_path value, -I value ] Add an IDL search path for includes. (Valid only if idl is protobuf)
--thriftgo value, -t value [ --thriftgo value, -t value ] Specify arguments for the thriftgo. ({flag}={value})
--protoc value, -p value [ --protoc value, -p value ] Specify arguments for the protoc. ({flag}={value})
--option_package value, -P value [ --option_package value, -P value ] Specify the package path. ({include_path}={import_path})
--no_recurse Generate master model only. (default: false)
--enable_extends Parse 'extends' for thrift IDL (default: false)
--json_enumstr Use string instead of num for json enums when idl is thrift. (default: false)
--unset_omitempty Remove 'omitempty' tag for generated struct. (default: false)
--pb_camel_json_tag Convert Name style for json tag to camel(Only works protobuf). (default: false)
--snake_tag Use snake_case style naming for tags. (Only works for 'form', 'query', 'json') (default: false)
--rm_tag value [ --rm_tag value ] Remove the specified tag
--exclude_file value, -E value [ --exclude_file value, -E value ] Specify the files that do not need to be updated.
--customize_package value Specify the path for package template.
--handler_by_method Generate a separate handler file for each method. (default: false)
--protoc-plugins value [ --protoc-plugins value ] Specify plugins for the protoc. ({plugin_name}:{options}:{out_dir})
--thrift-plugins value [ --thrift-plugins value ] Specify plugins for the thriftgo. ({plugin_name}:{options})
--help, -h show help (default: false)
$ hz help model
NAME:
hz model - Generate model code only
USAGE:
hz model [command options] [arguments...]
OPTIONS:
--idl value [ --idl value ] Specify the IDL file path. (.thrift or .proto)
--module value, --mod value Specify the Go module name.
--out_dir value Specify the project path.
--model_dir value Specify the model relative path (based on "out_dir").
--proto_path value, -I value [ --proto_path value, -I value ] Add an IDL search path for includes. (Valid only if idl is protobuf)
--thriftgo value, -t value [ --thriftgo value, -t value ] Specify arguments for the thriftgo. ({flag}={value})
--protoc value, -p value [ --protoc value, -p value ] Specify arguments for the protoc. ({flag}={value})
--no_recurse Generate master model only. (default: false)
--json_enumstr Use string instead of num for json enums when idl is thrift. (default: false)
--unset_omitempty Remove 'omitempty' tag for generated struct. (default: false)
--pb_camel_json_tag Convert Name style for json tag to camel(Only works protobuf). (default: false)
--snake_tag Use snake_case style naming for tags. (Only works for 'form', 'query', 'json') (default: false)
--rm_tag value [ --rm_tag value ] Remove the specified tag
--exclude_file value, -E value [ --exclude_file value, -E value ] Specify the files that do not need to be updated.
--help, -h show help (default: false)
client 命令的示例及高级设置可参考 hz client 代码生成。
$ hz help client
NAME:
hz client - Generate hertz client based on IDL
USAGE:
hz client [command options] [arguments...]
OPTIONS:
--idl value [ --idl value ] Specify the IDL file path. (.thrift or .proto)
--module value, --mod value Specify the Go module name.
--base_domain value Specify the request domain.
--model_dir value Specify the model relative path (based on "out_dir").
--client_dir value Specify the client path. If not specified, IDL generated path is used for 'client' command; no client code is generated for 'new' command
--use value Specify the model package to import for handler.
--force_client_dir value Specify the client path, and won't use namespaces as subpaths
--proto_path value, -I value [ --proto_path value, -I value ] Add an IDL search path for includes. (Valid only if idl is protobuf)
--thriftgo value, -t value [ --thriftgo value, -t value ] Specify arguments for the thriftgo. ({flag}={value})
--protoc value, -p value [ --protoc value, -p value ] Specify arguments for the protoc. ({flag}={value})
--no_recurse Generate master model only. (default: false)
--enable_extends Parse 'extends' for thrift IDL (default: false)
--json_enumstr Use string instead of num for json enums when idl is thrift. (default: false)
--unset_omitempty Remove 'omitempty' tag for generated struct. (default: false)
--pb_camel_json_tag Convert Name style for json tag to camel(Only works protobuf). (default: false)
--snake_tag Use snake_case style naming for tags. (Only works for 'form', 'query', 'json') (default: false)
--rm_tag value [ --rm_tag value ] Remove the specified tag
--exclude_file value, -E value [ --exclude_file value, -E value ] Specify the files that do not need to be updated.
--customize_package value Specify the path for package template.
--protoc-plugins value [ --protoc-plugins value ] Specify plugins for the protoc. ({plugin_name}:{options}:{out_dir})
--thrift-plugins value [ --thrift-plugins value ] Specify plugins for the thriftgo. ({plugin_name}:{options})
--help, -h show help (default: false)