https://github.com/go-kratos/kratos
Your ultimate Go microservices framework for the cloud-native era.
https://github.com/go-kratos/kratos
ai architecture cloud-native framework generate go golang grpc http kratos mcp microservice microservices protobuf
Last synced: about 20 hours ago
JSON representation
Your ultimate Go microservices framework for the cloud-native era.
- Host: GitHub
- URL: https://github.com/go-kratos/kratos
- Owner: go-kratos
- License: mit
- Created: 2019-01-10T10:42:31.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2026-10-21T07:16:24.000Z (9 days ago)
- Last Synced: 2026-10-22T20:14:09.236Z (8 days ago)
- Topics: ai, architecture, cloud-native, framework, generate, go, golang, grpc, http, kratos, mcp, microservice, microservices, protobuf
- Language: Go
- Homepage: https://go-kratos.dev
- Size: 9.61 MB
- Stars: 25,984
- Watchers: 435
- Forks: 4,182
- Open Issues: 121
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
- awesome-go - go-kratos/kratos - native era.|20,539| (Popular)
- awesome-trevor - Kratos - Your ultimate Go microservices framework for the cloud-native era (Programming / Golang)
- awesome-go - Kratos - microservice-oriented governance framework implemented by golang, which offers convenient capabilities to help you quickly build a bulletproof application from scratch. (Web frameworks)
- awesome-go-cn - Kratos - kratos/kratos) [![包含中文文档][CN]](https://github.com/go-kratos/kratos) (分布式系统 / 检索及分析资料库)
- awesome-list - Kratos - Your ultimate Go microservices framework for the cloud-native era. (DevOps / Data Management)
- my-awesome - go-kratos/kratos - native,framework,generate,go,golang,grpc,http,kratos,mcp,microservice,microservices,protobuf pushed_at:2026-09 star:26.0k fork:4.2k Your ultimate Go microservices framework for the cloud-native era. (Go)
- go-collection - kratos
- go-collection - kratos
- awesome-go - go-kratos/kratos - Your ultimate Go microservices framework for the cloud-native era. (Web / Web Frameworks)
- fucking-awesome-go - Kratos - A modular-designed and easy-to-use microservices framework in Go. (Distributed Systems / Search and Analytic Databases)
- awesome-arsenal - go-kratos - 云原生时代的终极微服务框架。 (武器库 / 后端)
- awesome-go - go-kratos/kratos - native era. ☆`25,215` (Distributed Systems / Search and Analytic Databases)
- awesome-go-extra - kratos - native era.|18677|3583|112|2019-01-10T10:42:31Z|2022-08-25T12:49:17Z| (Distributed Systems / Advanced Console UIs)
- awesome-go - Kratos - A modular-designed and easy-to-use microservices framework in Go. (Distributed Systems / Search and Analytic Databases)
- awesome-go - Kratos - A modular-designed and easy-to-use microservices framework in Go. (Distributed Systems / Search and Analytic Databases)
- awesome-go - Kratos - A modular-designed and easy-to-use microservices framework in Go. (Distributed Systems / Search and Analytic Databases)
- awesome-go-plus - Kratos - A modular-designed and easy-to-use microservices framework in Go.  (Distributed Systems / Search and Analytic Databases)
- stars - go-kratos/kratos - Your ultimate Go microservices framework for the cloud-native era. (Go)
- awesome-go-info - kratos - designed and easy-to-use microservices framework in Go. | (Relational Databases)
- awesome-go - Kratos - A modular-designed and easy-to-use microservices framework in Go. (Distributed Systems / Search and Analytic Databases)
- awesome-go - Kratos - A modular-designed and easy-to-use microservices framework in Go. (Distributed Systems / Search and Analytic Databases)
- awesome-go-with-stars - Kratos - designed and easy-to-use microservices framework in Go. | 2026-06-26 | (Distributed Systems / Search and Analytic Databases)
- awesome-go-cn - Kratos - kratos/kratos) [![包含中文文档][CN]](https://github.com/go-kratos/kratos) (分布式系统 / 检索及分析资料库)
- awesome-golang - Kratos - Developed by Bilibili, a microservice-oriented framework inspired by Go-kit, offering `gRPC` and `HTTP` as standards. (API and RPC / Advanced and Specialized Tools)
- awesome-golang-repositories - kratos - native era. (Repositories)
- go-awesome-with-star-updatetime - Kratos - A modular-designed and easy-to-use microservices framework in Go. (Distributed Systems / Advanced Console UIs)
- awesome-go - Kratos - A modular-designed and easy-to-use microservices framework in Go. Stars:`24.9K`. (Distributed Systems / Search and Analytic Databases)
README
Translations: [English](README.md) | [简体中文](README_zh.md)
# Kratos
Kratos is a lightweight Go framework for building cloud-native microservices. It provides small, explicit APIs for transport, middleware, registry, configuration, logging, encoding, and code generation so applications can focus on business logic.
## Features
- API-first development with Protobuf and generated HTTP/gRPC code.
- Unified [transport](https://go-kratos.dev/docs/component/transport/overview) layer for [HTTP](https://go-kratos.dev/docs/component/transport/http) and [gRPC](https://go-kratos.dev/docs/component/transport/grpc).
- Composable [middleware](https://go-kratos.dev/docs/component/middleware/overview) for recovery, logging, validation, tracing, metrics, auth, and more.
- Pluggable [registry](https://go-kratos.dev/docs/component/registry), [configuration](https://go-kratos.dev/docs/component/config), and [encoding](https://go-kratos.dev/docs/component/encoding) components.
- Standard-library `log/slog` based logging with OpenTelemetry extensions in contrib packages.
- Consistent metadata, errors, validation, OpenAPI, and code-generation workflows.
- A contrib ecosystem for optional integrations such as registries, config stores, middleware, encodings, and observability.
## Installation
### Requirements
- [Go](https://go.dev/dl/) 1.25 or later
- [protoc](https://github.com/protocolbuffers/protobuf)
- [protoc-gen-go](https://github.com/protocolbuffers/protobuf-go)
### Install the CLI
```shell
go install github.com/go-kratos/kratos/cmd/kratos/v3@latest
kratos upgrade
```
## Create a Service
```shell
kratos new helloworld
cd helloworld
go mod tidy
kratos run
```
Visit `http://localhost:8000/helloworld/kratos` after the service starts.
For a fuller generated service flow:
```shell
kratos proto add api/helloworld/helloworld.proto
kratos proto client api/helloworld/helloworld.proto
kratos proto server api/helloworld/helloworld.proto -t internal/service
go generate ./...
kratos run
```
## Usage Example
```go
package main
import (
"github.com/go-kratos/kratos/v3"
"github.com/go-kratos/kratos/v3/transport/grpc"
"github.com/go-kratos/kratos/v3/transport/http"
)
func main() {
httpSrv := http.NewServer(http.Address(":8000"))
grpcSrv := grpc.NewServer(grpc.Address(":9000"))
app := kratos.New(
kratos.Name("helloworld"),
kratos.Version("v1.0.0"),
kratos.Server(httpSrv, grpcSrv),
)
if err := app.Run(); err != nil {
panic(err)
}
}
```
## v3 Migration
Kratos v3 reduces core dependencies and makes previously implicit behavior explicit. Review the [v2 to v3 migration guide](docs/migration/v2-to-v3.md) before upgrading production services.
## Further Reading
- [Documentation](https://go-kratos.dev/docs/getting-started/start)
- [Examples](https://github.com/go-kratos/examples)
- [Project Layout](https://github.com/go-kratos/kratos-layout)
- [v2 to v3 Migration Guide](docs/migration/v2-to-v3.md)
- [Community Contribution Guide](https://go-kratos.dev/docs/community/contribution)
## Development
```shell
make test
make lint
```
## Community
- [Documentation](https://go-kratos.dev/en)
- [WeChat Group](https://github.com/go-kratos/kratos/issues/682)
- [Discord Group](https://discord.gg/BWzJsUJ)
- [Discussions](https://github.com/go-kratos/kratos/discussions)
## Security
If you discover a security vulnerability in Kratos, please contact go-kratos@googlegroups.com. Security reports are handled privately before disclosure.
## Contributors
Thank you for contributing to Kratos. The contribution guide is available in the [Kratos documentation](https://go-kratos.dev/docs/community/contribution).
## Acknowledgments
The following projects influenced Kratos design:
- [go-kit/kit](https://github.com/go-kit/kit)
- [go-micro](https://github.com/asim/go-micro)
- [google/go-cloud](https://github.com/google/go-cloud)
- [go-zero](https://github.com/zeromicro/go-zero)
- [beego](https://github.com/beego/beego)
## License
Kratos is open-sourced software licensed under the [MIT license](./LICENSE).
