Skip to content

feat: add config merging#5

Merged
mKeRix merged 5 commits into
mainfrom
config-merging
Dec 1, 2025
Merged

feat: add config merging#5
mKeRix merged 5 commits into
mainfrom
config-merging

Conversation

@mKeRix

@mKeRix mKeRix commented Nov 30, 2025

Copy link
Copy Markdown
Owner

This adds merging multiple file to the config mechanism, which allows for shared configs between multiple projects a user is working on. By default, the .toolscript.json files will be loaded from the user home dir and current dir now.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @mKeRix, 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 significantly enhances the configuration management system by introducing the ability to load and merge settings from multiple configuration files. This change provides greater flexibility, allowing users to define global preferences and project-specific overrides seamlessly. The new mechanism supports a familiar hierarchical configuration pattern, similar to other development tools, and ensures that configuration loading is robust with improved path parsing, tilde expansion, and error handling.

Highlights

  • Multi-Config Merging: The system now supports loading and merging configurations from multiple files, specified as a comma-separated list via the --config flag or environment variable.
  • Default Configuration Paths: The default configuration loading now includes both ~/.toolscript.json (user-level) and .toolscript.json (project-level), allowing for hierarchical settings.
  • Tilde Expansion: Paths starting with ~/ are automatically expanded to the user's home directory, enhancing portability across different operating systems.
  • Shallow Merge Strategy: Configuration files are merged left-to-right, with later server definitions completely overriding earlier ones for the same server name, rather than performing a deep merge of properties.
  • CLI and Environment Variable Integration: Both the gateway and auth CLI commands have been updated to accept multiple config paths, and a TOOLSCRIPT_CONFIG environment variable is introduced for specifying paths.
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.

@codecov-commenter

codecov-commenter commented Nov 30, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.07143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.28%. Comparing base (e9bdecb) to head (303b011).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/config/loader.ts 89.36% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   52.61%   53.28%   +0.67%     
==========================================
  Files          33       33              
  Lines        2313     2357      +44     
  Branches      142      156      +14     
==========================================
+ Hits         1217     1256      +39     
- Misses       1096     1101       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Copy link
Copy Markdown

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 well-designed feature for merging multiple configuration files, allowing for both user-level and project-level settings. The implementation is robust, with comprehensive design documents, specifications, and tests. The core logic for path parsing, file loading, and merging is clean and effective. The CLI commands are correctly updated to support the new functionality. I have one point of feedback regarding a discrepancy between the implementation and the specification on when environment variable substitution occurs, which should be addressed to ensure long-term maintainability.

Comment thread src/config/loader.ts
@mKeRix mKeRix merged commit 4d58cb7 into main Dec 1, 2025
1 check passed
@mKeRix mKeRix deleted the config-merging branch December 1, 2025 08:54
github-actions Bot pushed a commit that referenced this pull request Dec 1, 2025
# 1.0.0 (2025-12-01)

### Features

* add config merging ([#5](#5)) ([4d58cb7](4d58cb7))
* add semantic tool search ([#2](#2)) ([cac523b](cac523b))
* allow filtering exposed tools ([#4](#4)) ([bd1d64c](bd1d64c))
* implement code mode ([#1](#1)) ([b3c4646](b3c4646))
* initial commit ([5477138](5477138))
* support oauth2 protected mcp servers ([#3](#3)) ([f5408d1](f5408d1))
github-actions Bot pushed a commit that referenced this pull request Dec 1, 2025
# 1.0.0 (2025-12-01)

### Features

* add config merging ([#5](#5)) ([4d58cb7](4d58cb7))
* add semantic tool search ([#2](#2)) ([cac523b](cac523b))
* allow filtering exposed tools ([#4](#4)) ([bd1d64c](bd1d64c))
* implement code mode ([#1](#1)) ([b3c4646](b3c4646))
* initial commit ([5477138](5477138))
* support oauth2 protected mcp servers ([#3](#3)) ([f5408d1](f5408d1))
@github-actions

github-actions Bot commented Dec 1, 2025

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants