sdk-generator
Generating SDKs for multiple programming languages and platforms ⚙️
Appwrite SDK Generator builds client and server SDKs from API specs
The Appwrite SDK Generator is a PHP library that renders SDK code for many languages and platforms from OpenAPI and other API specifications.
How the generator works
The Appwrite SDK Generator is a PHP library for auto generating SDK libraries across multiple languages and platforms. It uses predefined language settings expressed as Twig templates to render codebases from API specifications. A companion library, Utopia OpenAPI, parses OpenAPI 2.0, 3.0, and 3.1 documents into one canonical model, and the generator consumes that model to render services, methods, models, enums, and union types. In practice you require the autoloader, create a Parser from an OpenAPI document, create a language instance such as PHP, attach it to an SDK object with the spec, set cover image and version metadata, and call generate on a target directory. For artifacts that need no API operations, you can build a minimal canonical specification with empty paths and still produce output such as a skills plugin. The project lints its Twig templates with djLint, though formatting is disabled because it would break code generation syntax, and linting runs automatically on pull requests via GitHub Actions. The tool is aimed at teams that maintain many SDKs and want them to stay consistent with a single source specification, rather than hand writing each client and risking drift between languages as the API evolves over time. The language table lists Python 3.9, Ruby 3.1, and Go 1.26.5.
Supported specs and languages
On the input side, the generator supports OpenAPI 3.1, OpenAPI 3.0, and OpenAPI (Swagger) 2 as ready targets. RAML 1.0, RAML 0.8, Postman 2.0, Postman 1.0, and API Blueprint 1A are listed but marked not ready. On the output side, client SDK targets include Web with ES5 and newer, Flutter, Apple platforms, Android, and React Native. Server SDK targets include Node.js, PHP, Python, Ruby, Dart, Go, Swift, .NET, Kotlin, and Rust, each with documented minimum versions and a package manager such as NPM, Composer, pip, Cargo, or NuGet. Tooling and documentation targets include a CLI, REST examples, GraphQL, Skills, and editor plugins for Cursor, Claude, Codex, and Zed. You run a single example.php script to generate every target with the default console platform spec, or pass a target and optional platform and format. The platform can be console, client, or server, and the format can be openapi3 or swagger2, with both producing identical SDKs. This matrix lets one spec feed many official SDKs without hand writing each one, and the README documents the exact argument names for each supported target so the runs are reproducible. The README notes that both openapi3 and swagger2 formats produce identical SDKs, so the choice is a matter of input convention rather than output difference.
Enum naming and contribution
The generator converts enum wire values into identifiers for each target language, and the README explains how to give values explicit semantic names by describing an enum as titled oneOf branches, which is useful when values contain non Latin text. When a value has no explicit title and cannot form a valid identifier, the generator uses a deterministic positional name such as Value1. OpenAPI 3.1 specs can use const instead of a single value enum for the same effect. These rules keep generated code readable across languages that have different identifier rules. On contributions, the project requires that every change, including changes from people with commit access, go through a pull request and be approved by a core developer before merge, so that all code receives review. The project is part of the Appwrite ecosystem and is published under the MIT license. Because it renders real SDKs that Appwrite ships to many platforms, the strict review process and the shared Twig template approach help keep the generated clients close to the documented API behavior and to each language's accepted coding style. The README also links to the full contribution guide for anyone preparing a pull request to the generator itself. A documented example uses a non Latin script value.
Editorial conclusion
The Appwrite SDK Generator is released under the MIT license and, at the time of writing, the repository recorded 325 stars and was last updated on 2026-08-24.
Community notes