mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 16:15:29 +00:00
Set new default config file location to ~/.serena/serena_config.yml,
using the Serena installation directory as an alternative secondary location
This commit is contained in:
1 parent
c771293a95
commit
ea3daf6408
2 files changed
+21
-3
No files matched your search
@@ -202,6 +202,8 @@ This and other settings can be adjusted in the [configuration](#configuration) a
|
||||
cd serena
|
||||
```
|
||||
2. Optionally create a config file from the template and adjust it according to your preferences.
|
||||
You can either place it in your user directory (`~/.serena/serena_config.yml`) or into
|
||||
the Serena installation directory:
|
||||
```shell
|
||||
cp src/serena/resources/serena_config.template.yml serena_config.yml
|
||||
```
|
||||
@@ -279,7 +281,11 @@ Run with parameter `--help` to get a list of available options.
|
||||
|
||||
Serena's behavior (active tools and prompts as well as logging configuration, etc.) is configured in four places:
|
||||
|
||||
1. The `serena_config.yml` for general settings that apply to all clients and projects
|
||||
1. The `serena_config.yml` for general settings that apply to all clients and projects.
|
||||
Serena will look for this file in your user directory under `.serena/serena_config.yml`
|
||||
or within the Serena installation directory.
|
||||
If you do not explicitly create the file, it will be auto-generated in the former location
|
||||
when you first run Serena.
|
||||
2. In the arguments passed to the `serena-mcp-server` in your client's config (see below),
|
||||
which will apply to all sessions started by the respective client. In particular, the [context](#contexts) parameter
|
||||
should be set appropriately for Serena to be best adjusted to existing tools and capabilities of your client.
|
||||
|
||||
+14
-2
@@ -287,8 +287,20 @@ class SerenaConfig:
|
||||
|
||||
@classmethod
|
||||
def _determine_config_file_path(cls) -> str:
|
||||
config_file = cls.CONFIG_FILE_DOCKER if is_running_in_docker() else cls.CONFIG_FILE
|
||||
return os.path.join(REPO_ROOT, config_file)
|
||||
"""
|
||||
:return: the location where the Serena configuration file is stored/should be stored
|
||||
"""
|
||||
if is_running_in_docker():
|
||||
return os.path.join(REPO_ROOT, cls.CONFIG_FILE_DOCKER)
|
||||
else:
|
||||
candidates = [
|
||||
str(Path.home() / SERENA_MANAGED_DIR_NAME / cls.CONFIG_FILE),
|
||||
os.path.join(REPO_ROOT, cls.CONFIG_FILE),
|
||||
]
|
||||
for candidate in candidates:
|
||||
if os.path.exists(candidate):
|
||||
return candidate
|
||||
return candidates[0]
|
||||
|
||||
@classmethod
|
||||
def _load_commented_yaml(cls, config_file: str, generate_if_missing: bool = True) -> CommentedMap:
|
||||
|
||||
Reference in new issue
Block a user