Enable AI-generated commit messages
Automatically generate descriptive commit messages for SDK builds using AI, with support for the Studio, CLI, and preview builds.
AI commit messages automatically generate descriptive commit messages for SDK builds using the Conventional Commits format based on your changes.
When AI commit messages are disabled, Stainless uses a default message like feat(api): api update.
In either case, you can always override the Stainless-provided values and specify your own commit messages.
Example AI-generated commit messages:
feat(api): add list and delete methods to users resourcefix(types): make timeout optional in client config
Where you can use AI commit messages
Section titled “Where you can use AI commit messages”AI commit messages are available in:
- Studio — When building from a branch, AI commit messages are generated automatically. You can edit them in the merge dialog before squashing.
- Preview builds — Messages appear in the PR comment and can be edited before merging.
- CLI — Enable AI commit messages with a command line flag
Enable AI commit messages
Section titled “Enable AI commit messages”AI commit messages are controlled by an organization-level setting. Once enabled, the feature works in the Studio and for Preview PRs.
- Navigate to your organization settings at
https://app.stainless.com/{your-org}/settings - Scroll to the AI Features section
- Toggle AI Commit Messages on
This setting takes effect immediately for all new builds
Once enabled:
- Studio branch builds will generate AI commit messages asynchronously
- Preview builds will automatically generate AI commit messages
Studio usage
Section titled “Studio usage”When working on a branch in the Studio:
- Make changes to your OpenAPI spec or Stainless config
- Click Save & Build SDKs to generate your SDKs
- AI generates commit messages for each SDK in the background
- Click Merge to main when ready
- The merge dialog displays commit message fields for each SDK, pre-filled with AI-generated messages
- Edit any message as needed, then click Squash and merge
AI commit messages are generated asynchronously. If you don’t want to wait, you can write your own SDK-specific commit messages, or specify a single commit message for all SDKs before the AI commit messages have been generated.
Preview builds usage
Section titled “Preview builds usage”When the organization-level AI commit messages setting is enabled:
- AI commit messages are automatically generated for each SDK in your Preview PR
- The PR comment displays separate commit message fields for each SDK
You can edit any message directly in the PR comment before merging.
No changes to your GitHub Action workflow are required. The feature is controlled entirely by the organization setting.
CLI usage
Section titled “CLI usage”The Stainless CLI has limited support for AI commit messages. You can enable AI commit messages when creating builds, but the Stainless CLI doesn’t display or allow you to edit AI commit messages.
To enable AI commit messages when using the CLI, run str builds create with the --enable-ai-commit-messages flag. The --enable-ai-commit-messages flag tells Stainless to generate and use AI commit messages for your builds:
str builds create ... --enable-ai-commit-messagesIf you receive an error that the --enable-ai-commit-messages flag is not defined, update to the latest version of the Stainless CLI with brew upgrade stl and try again.
The --enable-ai-commit-messages flag requires you to have the AI commit messages setting for your org enabled.
To view the AI commit messages Stainless generates, wait until your builds are complete and the associated commits are pushed, then review the commit history in your SDKs and other build target repositories.