Skip to content

Commit d165272

Browse files
committed
Improve init command: Report version, add final success message
Improve README: * Move LS deps back to prerequisites * Remove incorrect config path (redundant anyway, because user sees it upon init) * Some wording changes
1 parent 33a246a commit d165272

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,24 +176,21 @@ https://github.com/user-attachments/assets/6eaa9aa1-610d-4723-a2d6-bf1e487ba753
176176

177177
## Quick Start
178178

179-
**Prerequisites**. Serena is managed by *uv*. If you don’t already have it, you need to [install uv](https://docs.astral.sh/uv/getting-started/installation/) before proceeding.
179+
**Prerequisites**. Serena is managed by *uv*, and [installing uv](https://docs.astral.sh/uv/getting-started/installation/) is the only required prerequisite for running Serena.
180180

181-
**Initialize Serena**. To initialize Serena, simply run:
181+
> [!NOTE]
182+
> When using the language server backend, some additional dependencies may need to be installed to support certain languages;
183+
> see the [Language Support](https://oraios.github.io/serena/01-about/020_programming-languages.html) page for details.
184+
185+
**Initialise Serena**. To initialise Serena and verify that your setup works correctly, simply run:
182186

183187
```bash
184188
uvx -p 3.13 --from git+https://github.com/oraios/serena serena init
185189
```
186190

187-
This will create the global configuration file `~/.serena/config.yaml`.
188-
189-
The default code intelligence backend for Serena is the free LSP backend. You can add `-b JetBrains` to the `init` command
190-
to set up the JetBrains as the default code intelligence backend instead, see [JetBrains Plugin page](https://oraios.github.io/serena/02-usage/025_jetbrains_plugin.html) for more details.
191-
192-
193-
> [!NOTE]
194-
> When using the language server backend, some additional dependencies to be installed for certain languages;
195-
> see the [Language Support](https://oraios.github.io/serena/01-about/020_programming-languages.html) page for details.
196-
191+
By default, this will set up Serena to use the language server backend. To use the JetBrains backend instead, add the parameters `-b JetBrains`
192+
(see the [JetBrains Plugin documentation page](https://oraios.github.io/serena/02-usage/025_jetbrains_plugin.html) for additional usage details).
193+
Either way, you should receive a success message indicating that Serena has been initialised successfully.
197194

198195
**Configuring Your Client**. To connect Serena to your preferred MCP client, you typically need to [configure a launch command in your client](https://oraios.github.io/serena/02-usage/030_clients.html).
199196
Follow the link for specific instructions on how to set up Serena for Claude Code, Codex, Claude Desktop, MCP-enabled IDEs and other clients (such as local and web-based GUIs).

src/serena/cli.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from sensai.util.string import dict_string
1818
from tqdm import tqdm
1919

20+
from serena import serena_version
2021
from serena.agent import SerenaAgent
2122
from serena.config.context_mode import SerenaAgentContext, SerenaAgentMode
2223
from serena.config.serena_config import (
@@ -90,9 +91,6 @@ def ancestors() -> Iterator[Path]:
9091
return None
9192

9293

93-
# --------------------- Utilities -------------------------------------
94-
95-
9694
def _open_in_editor(path: str) -> None:
9795
"""Open the given file in the system's default editor or viewer."""
9896
editor = os.environ.get("EDITOR")
@@ -169,13 +167,14 @@ def __init__(self) -> None:
169167
show_default=True,
170168
help="Default code intelligence backend (can be overridden in the project config).",
171169
)
172-
def init(language_backend: Literal["LSP", "JetBrains"] = "LSP"):
170+
def init(language_backend: Literal["LSP", "JetBrains"] = "LSP") -> None:
171+
click.echo(f"\nSerena version: {serena_version()}\n")
173172
serena_config = SerenaConfig.from_config_file()
174173
serena_config.language_backend = LanguageBackend(language_backend)
175174
serena_config.save()
176-
click.echo(
177-
f"Initialized Serena with default backend: {language_backend}.\nFind the global Serena config in:\n {serena_config.config_file_path}"
178-
)
175+
click.echo(f"Configuration file: {serena_config.config_file_path}")
176+
click.echo(f"Language backend: {language_backend}")
177+
click.echo("\nSerena has been initialised successfully.\n")
179178

180179
@staticmethod
181180
@click.command("start-mcp-server", help="Starts the Serena MCP server.", context_settings={"max_content_width": _MAX_CONTENT_WIDTH})

0 commit comments

Comments
 (0)