MCPcopy Create free account
hub / github.com/aws/smithy-go

github.com/aws/smithy-go

Chat with this repo
repository ↗ · DeepWiki ↗ · release release-2026-06-26 ↗ · + Follow · compare 2 versions
5,000 symbols 17,683 edges 517 files 2,229 documented · 45% updated 3d agorelease-2026-06-26 · 2026-06-26★ 25131 open issues

Browse by type

Functions 4,136 Types & classes 864
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Smithy Go

Go Build StatusCodegen Build Status

Smithy code generators for Go and the accompanying smithy-go runtime.

The smithy-go runtime requires a minimum version of Go 1.24.

WARNING: All interfaces are subject to change.

:warning: Client codegen is unstable

The client code generator in this repository powers the aws-sdk-go-v2. Arbitrary client generation, while technically possible, is in an early stage of development:

  • Generated clients are missing certain features that were originally implemented SDK-side (e.g. retries)
  • There may be bugs
  • The public APIs of generated clients may be unstable

If you are interested in using the client code generators, we encourage you to experiment and share any feedback with us in an issue.

Plugins

This repository implements the following Smithy build plugins:

ID GAV prefix Description
go-codegen software.amazon.smithy.go:smithy-go-codegen Implements Go client code generation for Smithy models.
go-server-codegen software.amazon.smithy.go:smithy-go-codegen Implements Go server code generation for Smithy models.
go-shape-codegen software.amazon.smithy.go:smithy-go-codegen Implements Go shape code generation (types only) for Smithy models.

NOTE: Build plugins are not currently published to mavenCentral. You must publish to mavenLocal to make the build plugins visible to the Smithy CLI. The artifact version is currently fixed at 0.1.0.

go-codegen

Configuration

GoSettings contains all of the settings enabled from smithy-build.json and helper methods and types. The up-to-date list of top-level properties enabled for go-client-codegen can be found in GoSettings::from().

Setting Type Required Description
service string yes The Shape ID of the service for which to generate the client.
module string yes Name of the module in generated.json (and go.mod if generateGoMod is enabled) and doc.go.
generateGoMod boolean Whether to generate a default go.mod file. The default value is false.
goDirective string Go directive of the module. The default value is the minimum supported Go version.

Supported protocols

The protocol a client uses is configured by the Protocol field on a client's Options. The SDK will configure a default based on the protocol traits applied to the modeled service.

Protocol Notes
smithy.protocols#rpcv2Cbor
aws.protocols#restJson1
aws.protocols#restXml
aws.protocols#awsJson1_0
aws.protocols#awsJson1_1
aws.protocols#awsQuery
aws.protocols#ec2Query

Example

This example applies the go-codegen build plugin to the Smithy quickstart example created from smithy init:

{
  "version": "1.0",
  "sources": [
    "models"
  ],
  "maven": {
    "dependencies": [
      "software.amazon.smithy.go:smithy-go-codegen:0.1.0"
    ]
  },
  "plugins": {
    "go-codegen": {
      "service": "example.weather#Weather",
      "module": "github.com/example/weather",
      "generateGoMod": true,
      "goDirective": "1.24"
    }
  }
}

go-server-codegen

This plugin is a work-in-progress and is currently undocumented.

go-shape-codegen

This plugin is a work-in-progress and is currently undocumented.

License

This project is licensed under the Apache-2.0 License.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 3,153
Function 983
Struct 425
Class 243
Interface 111
TypeAlias 60
FuncType 20
Enum 5

Languages

Go60%
Java40%

Modules by API surface

codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/HttpProtocolUnitTestGenerator.java86 symbols
eventstream/header_value.go73 symbols
serde.go60 symbols
codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/HttpBindingProtocolGenerator.java55 symbols
codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java53 symbols
transport/http/protocol/internal/json/benchmark_test.go51 symbols
ptr/to_ptr.go51 symbols
ptr/from_ptr.go51 symbols
ptr/to_ptr_test.go48 symbols
metrics/metrics.go47 symbols
transport/http/protocol/internal/json/shape_deserializer.go45 symbols
codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoWriter.java45 symbols

Dependencies from manifests, versioned

go.opentelemetry.io/otel/metricv1.29.0 · 1×
go.opentelemetry.io/otel/tracev1.29.0 · 1×

For agents

$ claude mcp add smithy-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page