Skip to content

chore: autogenerate settings documentation#12451

Merged
cornmander merged 12 commits intomainfrom
chore/autogen-settings-docs
Nov 3, 2025
Merged

chore: autogenerate settings documentation#12451
cornmander merged 12 commits intomainfrom
chore/autogen-settings-docs

Conversation

@cornmander
Copy link
Contributor

Summary

  • add autogen markers and generate settings catalog from the schema
  • add docs generator script plus vitest to enforce drift detection
  • require npm run docs:settings -- --check in lint CI

Testing

  • npm run docs:settings
  • npm run docs:settings -- --check
  • npm run test:scripts

Fixes #11058

@cornmander cornmander requested review from a team as code owners November 2, 2025 17:45
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @cornmander, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request automates the generation of settings documentation, adds drift detection to ensure documentation accuracy, and integrates this process into the CI pipeline. This enhancement reduces manual effort and improves the reliability of the settings documentation.

Highlights

  • Autogeneration of Settings Documentation: This PR introduces a script to automatically generate settings documentation from the schema, ensuring the documentation remains up-to-date with the codebase.
  • Drift Detection: The PR includes vitest to enforce drift detection, which means the tests will fail if the documentation drifts from the actual settings schema.
  • CI Integration: The PR requires npm run docs:settings -- --check in lint CI, ensuring that the settings documentation is always up-to-date in the continuous integration process.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Nov 2, 2025

Size Change: +2.57 kB (+0.01%)

Total Size: 20.3 MB

Filename Size Change
./bundle/gemini.js 20.3 MB +2.57 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a script to auto-generate the settings documentation from the settings schema, which is a great step for maintainability. The script and its integration test look solid. However, in the process of migrating the descriptions to the schema, some have been over-simplified, leading to a significant loss of critical information in the documentation. I've pointed out a few places where the documentation is now either incorrect or critically incomplete, which could prevent users from using certain features correctly. These descriptions should be improved in the schema file to ensure the generated documentation is accurate and complete.

@jacob314

This comment has been minimized.

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with review. Looks good overall. Approved after these comments are resolved. We should probably file a tracking issue to show these descriptions in the settings dialog now that they are useful.

@cornmander cornmander force-pushed the chore/autogen-settings-docs branch 2 times, most recently from 9c2cf9b to 01ee66a Compare November 2, 2025 22:28
@cornmander cornmander force-pushed the chore/autogen-settings-docs branch from 01ee66a to 709f228 Compare November 2, 2025 22:37
@cornmander cornmander force-pushed the chore/autogen-settings-docs branch from 709f228 to 31a8ab2 Compare November 2, 2025 22:42
@cornmander
Copy link
Contributor Author

All comments resolved.

checkOnly: boolean;
}

const CUSTOM_DEFINITIONS: Record<string, JsonSchema> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These CUSTOM_DEFINITIONS worry me. Can you instead refactor so this info is captured in settingsSchema. If it is here, it will get inconsistent and people/LLMs modifying settingsSchema.ts will forget to make the needed changes.

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Approved once concern about the off to the side data in generate-settings-schema.ts is addressed.

@cornmander
Copy link
Contributor Author

cornmander commented Nov 3, 2025

Great call-out. I moved every $ref target into packages/cli/src/config/settingsSchema.ts as SETTINGS_SCHEMA_DEFINITIONS, and the generator now imports them instead of hard-coding shapes. That way authors only touch the schema file and the JSON schema stays in sync (commit dd6952e).

@cornmander
Copy link
Contributor Author

I also added a test to make sure that the type definitions and schema are kept in sync.

@cornmander cornmander force-pushed the chore/autogen-settings-docs branch from 95d2f18 to b91f9e5 Compare November 3, 2025 01:07
Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cornmander cornmander added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit 5062fad Nov 3, 2025
22 checks passed
@cornmander cornmander deleted the chore/autogen-settings-docs branch November 3, 2025 01:52
danpalmer pushed a commit to danpalmer/gemini-cli that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autogenerate settings documentation from settings schema

2 participants