| 1 | <p align="center"><a href="https://go-kratos.dev/" target="_blank"><img src="https://github.com/go-kratos/kratos/blob/main/docs/images/kratos-large.png?raw=true"></a></p> |
| 2 | |
| 3 | <p align="center"> |
| 4 | <a href="https://github.com/go-kratos/kratos/actions"><img src="https://github.com/go-kratos/kratos/workflows/Go/badge.svg" alt="Build Status"></a> |
| 5 | <a href="https://pkg.go.dev/github.com/go-kratos/kratos/v3"><img src="https://pkg.go.dev/badge/github.com/go-kratos/kratos/v3" alt="GoDoc"></a> |
| 6 | <a href="https://deepwiki.com/go-kratos/kratos"><img src="https://img.shields.io/badge/DeepWiki-go--kratos%2Fkratos-blue.svg" alt="DeepWiki"></a> |
| 7 | <a href="https://codecov.io/gh/go-kratos/kratos"><img src="https://codecov.io/gh/go-kratos/kratos/master/graph/badge.svg" alt="codeCov"></a> |
| 8 | <a href="https://goreportcard.com/report/github.com/go-kratos/kratos"><img src="https://goreportcard.com/badge/github.com/go-kratos/kratos" alt="Go Report Card"></a> |
| 9 | <a href="https://github.com/go-kratos/kratos/blob/main/LICENSE"><img src="https://img.shields.io/github/license/go-kratos/kratos" alt="License"></a> |
| 10 | <a href="https://github.com/avelino/awesome-go"><img src="https://awesome.re/mentioned-badge.svg" alt="Awesome Go"></a> |
| 11 | <a href="https://discord.gg/BWzJsUJ"><img src="https://img.shields.io/discord/766619759214854164?label=chat&logo=discord" alt="Discord"></a> |
| 12 | </p> |
| 13 | |
| 14 | <p align="center"> |
| 15 | <a href="https://trendshift.io/repositories/3233" target="_blank"><img src="https://trendshift.io/api/badge/repositories/3233" alt="go-kratos%2Fkratos | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"></a> |
| 16 | <a href="https://www.producthunt.com/posts/go-kratos?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-go-kratos" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=306565&theme=light" alt="Go Kratos - A Go framework for microservices. | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54"></a> |
| 17 | </p> |
| 18 | |
| 19 | Translations: [English](README.md) | [简体中文](README_zh.md) |
| 20 | |
| 21 | # Kratos |
| 22 | |
| 23 | 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. |
| 24 | |
| 25 | ## Features |
| 26 | |
| 27 | - API-first development with Protobuf and generated HTTP/gRPC code. |
| 28 | - 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). |
| 29 | - Composable [middleware](https://go-kratos.dev/docs/component/middleware/overview) for recovery, logging, validation, tracing, metrics, auth, and more. |
| 30 | - 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. |
| 31 | - Standard-library `log/slog` based logging with OpenTelemetry extensions in contrib packages. |
| 32 | - Consistent metadata, errors, validation, OpenAPI, and code-generation workflows. |
| 33 | - A contrib ecosystem for optional integrations such as registries, config stores, middleware, encodings, and observability. |
| 34 | |
| 35 | ## Installation |
| 36 | |
| 37 | ### Requirements |
| 38 | |
| 39 | - [Go](https://go.dev/dl/) 1.25 or later |
| 40 | - [protoc](https://github.com/protocolbuffers/protobuf) |
| 41 | - [protoc-gen-go](https://github.com/protocolbuffers/protobuf-go) |
| 42 | |
| 43 | ### Install the CLI |
| 44 | |
| 45 | ```shell |
| 46 | go install github.com/go-kratos/kratos/cmd/kratos/v3@latest |
| 47 | kratos upgrade |
| 48 | ``` |
| 49 | |
| 50 | ## Create a Service |
| 51 | |
| 52 | ```shell |
| 53 | kratos new helloworld |
| 54 | cd helloworld |
| 55 | go mod tidy |
| 56 | kratos run |
| 57 | ``` |
| 58 | |
| 59 | Visit `http://localhost:8000/helloworld/kratos` after the service starts. |
| 60 | |
| 61 | For a fuller generated service flow: |
| 62 | |
| 63 | ```shell |
| 64 | kratos proto add api/helloworld/helloworld.proto |
| 65 | kratos proto client api/helloworld/helloworld.proto |
| 66 | kratos proto server api/helloworld/helloworld.proto -t internal/service |
| 67 | go generate ./... |
| 68 | kratos run |
| 69 | ``` |
| 70 | |
| 71 | ## Usage Exa |