Skip to content
FeedbackDashboard
Generate SDKs
Test and iterate

AI-generated commit messages

Automatically generate descriptive commit messages for SDK builds using AI, with support for the Studio, CLI, and preview builds.

Our AI commit messages feature automatically generates descriptive commit messages for your SDK builds. AI commit messages use the Conventional Commits format and are derived from the changes you make.

Example AI-generated commit messages:

  • feat(api): add list and delete methods to users resource
  • fix(types): make timeout optional in client config

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.

AI commit messages are controlled by an organization-level setting. Once enabled, AI commit messages can be used in the Studio, preview builds, and in the CLI.

  1. Navigate to your organization settings
  2. Confirm the correct organization is selected at the top
  3. Scroll to the AI Features section
  4. 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

AI commit messages are available in the following places:

  • Studio — When building from a branch, AI commit messages are generated automatically. You can preview and edit them in the merge dialog before squashing.
  • Preview builds — AI commit messages appear in the comment Stainless adds to your PR. They can be edited before merging by editing the comment.
  • CLI — You can enable AI commit messages when using the Stainless CLI with a command line flag.

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.

Use AI commit messages with preview builds

Section titled “Use AI commit messages with preview builds”

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

To enable AI commit messages, add the --enable-ai-commit-messages flag to your command:

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

If you get an error when using the --enable-ai-commit-messages flag…

These troubleshooting steps solve the most common issues:

  • AI commit messages are available in version 0.1.0-alpha.69 of the Stainless CLI and later
    • Check the version you have installed: stl --version
    • Install the latest version: brew upgrade stl
  • The --enable-ai-commit-messages flag only works if you have the AI commit messages setting for your org enabled
  • You can either use AI commit messages or define your own, but not both, so the --enable-ai-commit-messages flag cannot be used with the --commit-message or --target-commit-messages flags

Still not working? Let us know and we’d be happy to help!

When AI commit messages are enabled via the CLI, Stainless will generate and immediately use rich commit messages instead of default generic commit messages.

To view AI commit messages when using the CLI, review the commit history of your SDK and other target repositories after your CLI builds finish.