Skip to content

Commit 03b8558

Browse files
committed
Add CLI initialization and improve task display name generation
1 parent e924c6e commit 03b8558

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

toolit/create_apps_and_register.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
if TYPE_CHECKING:
1010
from mcp.server.fastmcp import FastMCP
11-
_has_mcp: bool = True
1211
else:
1312
# Make MCP optional
1413
try:
@@ -23,7 +22,10 @@
2322
# Initialize the MCP server with a name, if available
2423
mcp: FastMCP | None = FastMCP("Toolit MCP Server") if _has_mcp else None
2524

26-
25+
@app.callback()
26+
def initialize() -> None:
27+
"""Welcome to the Toolit CLI!"""
28+
2729
def register_command(command_func: Callable[..., Any], name: str | None = None) -> None:
2830
"""Register an external command to the CLI and MCP server if available."""
2931
if not callable(command_func):

toolit/create_tasks_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _create_args_for_tool(self, tool: FunctionType) -> list[str]:
102102
def _create_task_entry(self, tool: FunctionType, args: list[str]) -> None:
103103
"""Create a task entry for a given tool."""
104104
name_as_typer_command: str = _create_typer_command_name(tool)
105-
display_name: str = tool.__name__.replace("_", " ").title()
105+
display_name: str = _create_display_name(tool)
106106
task: dict[str, Any] = {
107107
"label": display_name,
108108
"type": "shell",

0 commit comments

Comments
 (0)