Skip to content
FeedbackDashboard

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 resource
  • fix(types): make timeout optional in client config

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

AI commit messages are controlled by an organization-level setting. Once enabled, the feature works in the Studio and for Preview PRs.

  1. Navigate to your organization settings at https://app.stainless.com/{your-org}/settings
  2. Scroll to the AI Features section
  3. Toggle AI Commit Messages on

This setting takes effect immediately for all new builds

AI Features toggle in organization settings

Once enabled:

  • Studio branch builds will generate AI commit messages asynchronously
  • Preview builds will automatically generate AI commit messages

When working on a branch in the Studio:

  1. Make changes to your OpenAPI spec or Stainless config
  2. Click Save & Build SDKs to generate your SDKs
  3. AI generates commit messages for each SDK in the background
  4. Click Merge to main when ready
  5. The merge dialog displays commit message fields for each SDK, pre-filled with AI-generated messages
  6. Edit any message as needed, then click Squash and merge
Studio merge dialog with AI commit messages

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.

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.

Preview PR with AI commit messages

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:

Terminal window
str builds create ... --enable-ai-commit-messages

If 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.