Skip to content

Commit 8b81e69

Browse files
Always supress and disable suppression at end
1 parent e9d5ddd commit 8b81e69

File tree

5 files changed

+36
-51
lines changed

5 files changed

+36
-51
lines changed

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,7 @@ curl -fsSL https://raw.githubusercontent.com/Edison-Watch/open-edison/main/curl_
4747
```
4848

4949
Run locally with uvx: `uvx open-edison`
50-
51-
Optionally, run the setup wizard to import/configure MCP:
52-
53-
```bash
54-
uv run python -m src.setup_tui.main
55-
# add --dry-run to preview without writing
56-
```
50+
That will run the setup wizard if necessary.
5751

5852
<details>
5953
<summary>⬇️ Install Node.js/npm (optional for MCP tools)</summary>
@@ -104,19 +98,6 @@ OPEN_EDISON_CONFIG_DIR=~/edison-config open-edison run
10498

10599
</details>
106100

107-
<details>
108-
<summary>🔄 Import from Cursor/VS Code/Claude Code</summary>
109-
110-
Run the interactive setup wizard to detect clients, import servers, and configure your editor:
111-
112-
```bash
113-
uv run python -m src.setup_tui.main
114-
```
115-
116-
Use `--dry-run` to preview without writing.
117-
118-
</details>
119-
120101
<details>
121102
<summary><img src="https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge&logo=docker&logoColor=white" alt="Docker"> Run with Docker</summary>
122103

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "open-edison"
3-
version = "0.1.58"
3+
version = "0.1.59"
44
description = "Open-source MCP security, aggregation, and monitoring. Single-user, self-hosted MCP proxy."
55
readme = "README.md"
66
authors = [

src/mcp_importer/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ async def _list_tools_only() -> Any:
238238
# NOT_REQUIRED: quick unauthenticated ping
239239
# TODO: In debug mode, do not suppress child process output.
240240
questionary.print(
241-
f"Testing connection to '{server.name}'...", style="bold fg:ansigreen"
241+
f"Testing connection to '{server.name}'... (timeout: {connection_timeout}s)",
242+
style="bold fg:ansigreen",
242243
)
243244
log.debug(f"Establishing contact with remote server '{server.name}'")
244245
async with asyncio.timeout(connection_timeout):

src/setup_tui/main.py

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -173,42 +173,45 @@ def show_manual_setup_screen() -> None:
173173
print(after_text)
174174

175175

176+
class _TuiLogger:
177+
def _fmt(self, msg: object, *args: object) -> str:
178+
try:
179+
if isinstance(msg, str) and args:
180+
return msg.format(*args)
181+
except Exception:
182+
pass
183+
return str(msg)
184+
185+
def info(self, msg: object, *args: object, **kwargs: object) -> None:
186+
questionary.print(self._fmt(msg, *args), style="fg:ansiblue")
187+
188+
def debug(self, msg: object, *args: object, **kwargs: object) -> None:
189+
questionary.print(self._fmt(msg, *args), style="fg:ansiblack")
190+
191+
def warning(self, msg: object, *args: object, **kwargs: object) -> None:
192+
questionary.print(self._fmt(msg, *args), style="bold fg:ansiyellow")
193+
194+
def error(self, msg: object, *args: object, **kwargs: object) -> None:
195+
questionary.print(self._fmt(msg, *args), style="bold fg:ansired")
196+
197+
176198
@contextlib.contextmanager
177199
def suppress_loguru_output() -> Generator[None, None, None]:
178200
"""Suppress loguru output."""
179201
with contextlib.suppress(Exception):
180202
log.remove()
203+
204+
old_logger = oauth_mod.log
205+
# Route oauth_manager's log calls to questionary for TUI output
206+
oauth_mod.log = _TuiLogger() # type: ignore[attr-defined]
181207
yield
208+
oauth_mod.log = old_logger
182209
log.add(sys.stdout, level="INFO")
183210

184211

185212
@suppress_loguru_output()
186213
def run(*, dry_run: bool = False, skip_oauth: bool = False) -> None: # noqa: C901
187214
"""Run the complete setup process."""
188-
189-
# Route oauth_manager's log calls to questionary for TUI output
190-
class _TuiLogger:
191-
def _fmt(self, msg: object, *args: object) -> str:
192-
try:
193-
if isinstance(msg, str) and args:
194-
return msg.format(*args)
195-
except Exception:
196-
pass
197-
return str(msg)
198-
199-
def info(self, msg: object, *args: object, **kwargs: object) -> None:
200-
questionary.print(self._fmt(msg, *args), style="fg:ansiblue")
201-
202-
def debug(self, msg: object, *args: object, **kwargs: object) -> None:
203-
questionary.print(self._fmt(msg, *args), style="fg:ansiblack")
204-
205-
def warning(self, msg: object, *args: object, **kwargs: object) -> None:
206-
questionary.print(self._fmt(msg, *args), style="bold fg:ansiyellow")
207-
208-
def error(self, msg: object, *args: object, **kwargs: object) -> None:
209-
questionary.print(self._fmt(msg, *args), style="bold fg:ansired")
210-
211-
oauth_mod.log = _TuiLogger() # type: ignore[attr-defined]
212215
show_welcome_screen(dry_run=dry_run)
213216
# Additional setup steps will be added here
214217

@@ -244,15 +247,15 @@ def error(self, msg: object, *args: object, **kwargs: object) -> None:
244247
# Triggered from cli.py
245248
def run_import_tui(args: argparse.Namespace, force: bool = False) -> None:
246249
"""Run the import TUI, if necessary."""
247-
# Find config dir, check if ".setup_tui_run" exists
250+
# Find config dir, check if ".setup_tui_ran" exists
248251
config_dir = get_config_dir()
249252
config_dir.mkdir(parents=True, exist_ok=True)
250253

251-
setup_tui_run_file = config_dir / ".setup_tui_run"
252-
if not setup_tui_run_file.exists() or force:
254+
setup_tui_ran_file = config_dir / ".setup_tui_ran"
255+
if not setup_tui_ran_file.exists() or force:
253256
run(dry_run=args.wizard_dry_run, skip_oauth=args.wizard_skip_oauth)
254257

255-
setup_tui_run_file.touch()
258+
setup_tui_ran_file.touch()
256259

257260

258261
def main(argv: list[str] | None = None) -> int:

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)