--- title: AI-generated commit messages | Stainless description: 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](https://www.conventionalcommits.org/) 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. ## Enable AI 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](https://app.stainless.com/org/default/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](/docs/_astro/ai-commit-messages-org-setting.DAiVaGvY_15dxbq.webp) Once enabled: - Studio branch builds will generate AI commit messages asynchronously - Preview builds will automatically generate AI commit messages ## Where you can use AI commit messages AI commit messages are available in the following places: - [**Studio**](#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**](#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**](#cli) — You can enable AI commit messages when using the Stainless CLI with a command line flag. ### Use AI commit messages in the Studio 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](/docs/_astro/ai-commit-messages-merge-screen.Bl04zuYq_vLqyJ.webp) 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 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](/docs/_astro/ai-commit-messages-preview-pr.D7-jOZ8L_255Erf.webp) ### Use AI commit messages with the CLI **The Stainless CLI has limited support for AI commit messages:** you can enable AI commit messages with the CLI, but not preview or edit them. We recommend you test AI commit messages in the Studio before using them with the CLI to determine if they’re a good fit for your workflow. If you’re interested in more robust AI commit messages support in the CLI please [let us know](mailto:support@stainless.com)! 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](#enable) - 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](mailto:support@stainless.com) 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.