From 38f33b8f868b2f45a4a341f45e61d2942dc60358 Mon Sep 17 00:00:00 2001 From: Michael Panchenko Date: Mon, 2 Jun 2025 21:49:37 +0200 Subject: [PATCH] Readme, format --- README.md | 36 +++++++++++++++++++++++++++++------- src/serena/__init__.py | 1 + src/serena/agent.py | 2 +- src/serena/agno.py | 2 +- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c8948dcf..6d48de76 100644 --- a/README.md +++ b/README.md @@ -173,19 +173,31 @@ Serena can be used in various ways, below you will find instructions for selecte ### Setup -1. Install `uv` (instructions [here](https://docs.astral.sh/uv/getting-started/installation/)) -2. Clone the repository. -3. Copy `serena_config.template.yml` to `serena_config.yml` +Serena is managed by `uv`, so you will need to [install it](https://docs.astral.sh/uv/getting-started/installation/)). + +Then you can either + +1. Clone the repository and cd into it. +2. Optionally create a config file from the template and adjust it according to your preferences. ```shell - cp serena_config.template.yml serena_config.yml + cp src/serena/resources/serena_config.template.yml serena_config.yml ``` - + If you just want the default config, you can skip this part, and a config file will be created when you first run Serena. + +or use `uvx` to run Serena directly by relying on + +```shell +uvx --from git+https://github.com/oraios/serena serena-mcp-server.exe +``` + +in your MCP config (delete the `.exe` on macOS or Linux). + You can now add Serena to your MCP client as described below for various clients and [activate your first project](#project-activation). > In the default configuration, Serena will start a small dashboard on localhost that will display logs and allow shutting down the > MCP server (since many clients fail to cleanup processes, leaving zombies behind). If you don't want that, simply set `web_dashboard` to `False` -> in your `serena_config.yml`. +> in your `serena_config.yml` or pass ### Configuration @@ -195,7 +207,7 @@ Serena's behavior (like available projects, active tools and prompts) is configu 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. - See for a detailed explanation. + See for a detailed explanation. You can override all entries from the `serena_config.yml` through command line arguments. 3. In the `.serena/project.yml` file within your project. This will hold project-level configuration that is used whenever that project is activated. 4. Through the currently active set of [modes](#modes). @@ -253,6 +265,16 @@ That's it! Save the config and then restart Claude Desktop. You are ready for ac uv run serena-mcp-server --help ``` +ℹ️ You can use Serena without cloning or configuring it explicitly by + +{ + "mcpServers": { + "serena": { + "command": "/abs/path/to/uv", + "args": ["run", "--directory", "/abs/path/to/serena", "serena-mcp-server"] + } + } +} #### Troubleshooting diff --git a/src/serena/__init__.py b/src/serena/__init__.py index 85f7b173..1a6b2383 100644 --- a/src/serena/__init__.py +++ b/src/serena/__init__.py @@ -1,5 +1,6 @@ __version__ = "2025-05-21" + def serena_version() -> str: """ :return: the version of the package, including git status if available. diff --git a/src/serena/agent.py b/src/serena/agent.py index a937cac5..039174c7 100644 --- a/src/serena/agent.py +++ b/src/serena/agent.py @@ -36,7 +36,7 @@ from multilspy.multilspy_logger import MultilspyLogger from multilspy.multilspy_types import SymbolKind from serena import serena_version from serena.config import SerenaAgentContext, SerenaAgentMode -from serena.constants import PROJECT_TEMPLATE_FILE, SELENA_CONFIG_TEMPLATE_FILE, SERENA_MANAGED_DIR_NAME, REPO_ROOT +from serena.constants import PROJECT_TEMPLATE_FILE, REPO_ROOT, SELENA_CONFIG_TEMPLATE_FILE, SERENA_MANAGED_DIR_NAME from serena.dashboard import MemoryLogHandler, SerenaDashboardAPI from serena.prompt_factory import PromptFactory, SerenaPromptFactory from serena.symbol import SymbolManager diff --git a/src/serena/agno.py b/src/serena/agno.py index 1248d1a2..c9150693 100644 --- a/src/serena/agno.py +++ b/src/serena/agno.py @@ -14,9 +14,9 @@ from agno.tools.toolkit import Toolkit from dotenv import load_dotenv from sensai.util.logging import LogTime -from serena.constants import REPO_ROOT from serena.agent import SerenaAgent, Tool, show_fatal_exception_safe from serena.config import SerenaAgentContext +from serena.constants import REPO_ROOT log = logging.getLogger(__name__)