LinuxCommandLibrary

kitex

generates Go code from Thrift or Protobuf IDL files

TLDR

Generate service code

$ kitex -module [module] [idl_file.thrift]
copy
Generate client code
$ kitex -module [module] -client [idl_file.thrift]
copy
Specify service name
$ kitex -module [module] -service [svc] [idl.thrift]
copy
Use Protobuf
$ kitex -module [module] [idl.proto]
copy
Generate with templates
$ kitex -module [module] -template [dir] [idl.thrift]
copy

SYNOPSIS

kitex [options] idlfile_

DESCRIPTION

kitex is a code generation tool for the Kitex high-performance RPC framework, part of ByteDance's open-source CloudWeGo ecosystem. It reads Thrift or Protocol Buffers interface definition language (IDL) files and generates Go scaffolding code for both servers and clients, including service interfaces, request/response types, serialization logic, and a runnable project skeleton.
The generated code is designed for building Go microservices with features like connection pooling, load balancing, and circuit breaking built into the Kitex framework. By default, kitex produces both server and client code, but the `-client` flag restricts output to client stubs only. Custom code templates can be provided via the `-template` option to control the structure and style of the generated project.

PARAMETERS

IDLFILE_

Thrift or Protobuf IDL file.
-module NAME
Go module name.
-service NAME
Service name.
-client
Generate client code only.
-template DIR
Custom template directory.
--help
Display help information.

CAVEATS

Part of CloudWeGo. Go-specific. Thrift or Protobuf IDL required.

HISTORY

kitex is the code generator for Kitex, a high-performance RPC framework created by ByteDance.

SEE ALSO

thrift(1), protoc(1), go(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community