Skip to content

chore!: rename tools-file flags to config#2738

Open
Yuan325 wants to merge 1 commit intoremove-deprecationfrom
update-config
Open

chore!: rename tools-file flags to config#2738
Yuan325 wants to merge 1 commit intoremove-deprecationfrom
update-config

Conversation

@Yuan325
Copy link
Contributor

@Yuan325 Yuan325 commented Mar 13, 2026

  • Remove deprecated support for tools_file flag.
  • Deprecate tools-file, tools-files, and tools-folder flag. Renaming them to config, configs, and config-folder flag.

@Yuan325 Yuan325 requested a review from a team as a code owner March 13, 2026 02:58
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 refactors the command-line interface for tool configuration by introducing new, more descriptive flag names. The change aims to enhance the user experience by making flag usage more intuitive and consistent across the application. It involves a comprehensive update of the codebase, including internal logic, tests, and all user-facing documentation and examples, ensuring a smooth transition for users while maintaining backward compatibility for a deprecation period.

Highlights

  • Flag Renaming: Renamed command-line flags for tool configuration from --tools-file, --tools-files, and --tools-folder to --config, --configs, and --config-folder respectively, improving clarity and consistency.
  • Deprecation: Deprecated the old --tools-file, --tools-files, and --tools-folder flags, and removed support for the previously deprecated tools_file flag.
  • Codebase Update: Updated internal Go structs, functions, and test cases to reflect the new configuration flag names and associated parsing logic.
  • Documentation and Examples: Updated all relevant documentation, quickstarts, and sample scripts to use the new --config flags.
Changelog
  • .ci/sample_tests/run_tests.sh
    • Updated the toolbox command to use the new --config flag.
  • README.md
    • Updated all command examples and configuration references to use the new --config flag.
  • cmd/internal/invoke/command.go
    • Replaced ToolsFileParser with ConfigParser in the runInvoke function.
  • cmd/internal/invoke/command_test.go
    • Modified test arguments to use --config instead of --tools-file.
  • cmd/internal/options.go
    • Renamed ToolsFile, ToolsFiles, and ToolsFolder fields to Config, Configs, and ConfigFolder respectively.
    • Updated the LoadConfig method to utilize the new field names and ConfigParser.
  • cmd/internal/persistent_flags.go
    • Introduced new flags --config, --configs, and --config-folder.
    • Marked the old --tools-file, --tools-files, and --tools-folder flags as deprecated.
  • cmd/internal/skills/command.go
    • Replaced ToolsFileParser with ConfigParser and updated flag references in the run function.
  • cmd/internal/skills/command_test.go
    • Updated test arguments to use --config instead of --tools-file.
  • cmd/internal/skills/generator_test.go
    • Modified configArgs in test cases to reflect the --config flag.
  • cmd/internal/tools_file.go
    • Renamed the ToolsFile struct to Config and ToolsFileParser to ConfigParser.
    • Updated function names and internal logic to align with the new Config and ConfigParser types.
  • cmd/internal/tools_file_test.go
    • Updated test function names and variable references to use Config and ConfigParser.
    • Modified test cases to reflect the new configuration structure.
  • cmd/root.go
    • Removed the deprecated tools_file flag.
    • Updated handleDynamicReload and validateReloadEdits functions to use internal.Config.
    • Modified the run function to use internal.ConfigParser and resolveWatcherInputs with the new flag names.
  • cmd/root_test.go
    • Updated test cases for flag parsing to use Config, Configs, and ConfigFolder.
    • Adjusted expected error messages for mutually exclusive flag combinations.
  • docs/TOOLBOX_README.md
    • Updated the example command to use --config.
  • docs/en/concepts/telemetry/index.md
    • Updated the example command to use --config.
  • docs/en/getting-started/colab_quickstart.ipynb
    • Updated the example command to use --config.
  • docs/en/getting-started/configure.md
    • Updated documentation to refer to the new --config flag.
  • docs/en/getting-started/introduction/_index.md
    • Updated example commands to use --config.
  • docs/en/getting-started/mcp_quickstart/_index.md
    • Updated the example command to use --config.
  • docs/en/getting-started/quickstart/shared/configure_toolbox.md
    • Updated the example command to use --config.
  • docs/en/how-to/deploy_docker.md
    • Updated example commands to use --config.
  • docs/en/how-to/deploy_toolbox.md
    • Updated example commands to use --config.
  • docs/en/how-to/generate_skill.md
    • Updated documentation and example commands to use --config.
  • docs/en/how-to/invoke_tool.md
    • Updated documentation and example commands to use --config.
  • docs/en/reference/cli.md
    • Updated the CLI reference table and examples to reflect --config, --configs, and --config-folder.
    • Adjusted the tip regarding mutually exclusive flags.
  • docs/en/reference/prebuilt-tools.md
    • Updated documentation to refer to --config, --configs, and --config-folder.
  • docs/en/samples/alloydb/ai-nl/alloydb_ai_nl.ipynb
    • Updated the example command to use --config.
  • docs/en/samples/alloydb/mcp_quickstart.md
    • Updated the example command to use --config.
  • docs/en/samples/bigquery/colab_quickstart_bigquery.ipynb
    • Updated the example command to use --config.
  • docs/en/samples/bigquery/local_quickstart.md
    • Updated the example command to use --config.
  • docs/en/samples/bigquery/mcp_quickstart/_index.md
    • Updated the example command to use --config.
  • docs/en/samples/neo4j/mcp_quickstart.md
    • Updated the example command to use --config.
  • docs/en/samples/snowflake/_index.md
    • Updated the example command to use --config.
  • docs/en/samples/snowflake/snowflake-env.sh
    • Updated the example command to use --config.
  • docs/en/samples/snowflake/test-snowflake.sh
    • Updated the example command to use --config.
  • server.json
    • Updated runtime argument names from tools-file, tools-files, tools-folder to config, configs, config-folder.
  • tests/server.go
    • Updated the StartCmd function to use the --config flag.
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.

@Yuan325 Yuan325 changed the base branch from main to remove-deprecation March 13, 2026 02:58
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 refactors command-line flags for configuration files. The review highlights a critical issue in the flag deprecation implementation that needs correction to prevent CLI breakage. Additionally, there's a minor bug in an error message and suggestions for file and test renames to enhance maintainability and consistency. While the refactoring improves flag clarity, addressing these points is crucial for a robust implementation.

Comment on lines +31 to +39
persistentFlags.StringVar(&opts.Config, "config", "", "File path specifying the tool configuration. Cannot be used with --configs, or --config-folder.")
persistentFlags.StringVar(&opts.Config, "config", "", "File path specifying the tool configuration. Cannot be used with --configs, or --config-folder.")
_ = persistentFlags.MarkDeprecated("config", "please use --config instead") // DEPRECATED
persistentFlags.StringSliceVar(&opts.Configs, "configs", []string{}, "Multiple file paths specifying tool configurations. Files will be merged. Cannot be used with --config, or --config-folder.")
persistentFlags.StringSliceVar(&opts.Configs, "configs", []string{}, "Multiple file paths specifying tool configurations. Files will be merged. Cannot be used with --config, or --config-folder.")
_ = persistentFlags.MarkDeprecated("configs", "please use --configs instead") // DEPRECATED
persistentFlags.StringVar(&opts.ConfigFolder, "config-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --config, or --configs.")
persistentFlags.StringVar(&opts.ConfigFolder, "config-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --config, or --configs.")
_ = persistentFlags.MarkDeprecated("config-folder", "please use --config-folder instead") // DEPRECATED
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There appears to be a copy-paste error in the flag definitions. The new flags (config, configs, config-folder) are being defined twice and then immediately marked as deprecated in favor of themselves. This will cause unexpected behavior and prevent the CLI from working as intended.

To correctly deprecate the old flags (tools-file, tools-files, tools-folder) while introducing the new ones, you should define the new flags, and then define the old flags with a MarkDeprecated call, pointing to the same underlying option variable.

Suggested change
persistentFlags.StringVar(&opts.Config, "config", "", "File path specifying the tool configuration. Cannot be used with --configs, or --config-folder.")
persistentFlags.StringVar(&opts.Config, "config", "", "File path specifying the tool configuration. Cannot be used with --configs, or --config-folder.")
_ = persistentFlags.MarkDeprecated("config", "please use --config instead") // DEPRECATED
persistentFlags.StringSliceVar(&opts.Configs, "configs", []string{}, "Multiple file paths specifying tool configurations. Files will be merged. Cannot be used with --config, or --config-folder.")
persistentFlags.StringSliceVar(&opts.Configs, "configs", []string{}, "Multiple file paths specifying tool configurations. Files will be merged. Cannot be used with --config, or --config-folder.")
_ = persistentFlags.MarkDeprecated("configs", "please use --configs instead") // DEPRECATED
persistentFlags.StringVar(&opts.ConfigFolder, "config-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --config, or --configs.")
persistentFlags.StringVar(&opts.ConfigFolder, "config-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --config, or --configs.")
_ = persistentFlags.MarkDeprecated("config-folder", "please use --config-folder instead") // DEPRECATED
persistentFlags.StringVar(&opts.Config, "config", "", "File path specifying the tool configuration. Cannot be used with --configs, or --config-folder.")
persistentFlags.StringSliceVar(&opts.Configs, "configs", []string{}, "Multiple file paths specifying tool configurations. Files will be merged. Cannot be used with --config, or --config-folder.")
persistentFlags.StringVar(&opts.ConfigFolder, "config-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --config, or --configs.")
// Deprecated flags
persistentFlags.StringVar(&opts.Config, "tools-file", "", "DEPRECATED: use --config instead.")
_ = persistentFlags.MarkDeprecated("tools-file", "please use --config instead")
persistentFlags.StringSliceVar(&opts.Configs, "tools-files", []string{}, "DEPRECATED: use --configs instead.")
_ = persistentFlags.MarkDeprecated("tools-files", "please use --configs instead")
persistentFlags.StringVar(&opts.ConfigFolder, "tools-folder", "", "DEPRECATED: use --config-folder instead.")
_ = persistentFlags.MarkDeprecated("tools-folder", "please use --config-folder instead")

if (opts.Config != "" && len(opts.Configs) > 0) ||
(opts.Config != "" && opts.ConfigFolder != "") ||
(len(opts.Configs) > 0 && opts.ConfigFolder != "") {
errMsg := fmt.Errorf("--config/--config, --configs/--configs, and --config-folder/--config-folder flags cannot be used simultaneously")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The error message for mutually exclusive flags appears to be malformed. It currently says --config/--config, --configs/--configs, ... which seems to be a copy-paste error. This will also cause the TestMutuallyExclusiveFlags test to fail.

The message should list the flags separated by commas.

Suggested change
errMsg := fmt.Errorf("--config/--config, --configs/--configs, and --config-folder/--config-folder flags cannot be used simultaneously")
errMsg := fmt.Errorf("--config, --configs, and --config-folder flags cannot be used simultaneously")

)

type ToolsFile struct {
type Config struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better maintainability and clarity, consider renaming this file from tools_file.go to config.go. This would align the filename with the Config and ConfigParser types that are now defined within it. This can be done in a follow-up change if it's easier.

@@ -539,9 +539,9 @@ func TestParseToolFile(t *testing.T) {
t.Fatalf("unexpected error: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with the renames in config.go (previously tools_file.go), this test function should be renamed from TestParseToolFile to TestParseConfig.

Additionally, it would improve clarity to rename the test file itself from tools_file_test.go to config_test.go in a follow-up change.

@github-actions
Copy link
Contributor

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.

2 participants