Skip to content

The agent that turns websites into APIs!

ux: show run info and scripts dir before file picker

kalil03210c0131a8eb6e
diff --git a/src/reverse_api/cli.py b/src/reverse_api/cli.py
index a5aa7f7..95f324a 100644
--- a/src/reverse_api/cli.py
+++ b/src/reverse_api/cli.py
@@ -2097,6 +2097,12 @@ def run_script(ctx, identifier, script_args, file_name, list_scripts):
# Discover scripts (prefer stored path from run metadata, fall back to output_dir)
scripts = discover_scripts(run_id, output_dir, run_metadata=run)
+ # Show run info after resolution
+ prompt_preview = (run.get("prompt") or "")[:80]
+ console.print(f"run {run_id} | {prompt_preview}", style="dim")
+ if scripts:
+ console.print(f" {scripts[0].parent}", style="dim")
+
if not scripts:
console.print(f"[red]No Python scripts found for run {run_id}[/red]")
prompt_preview = (run.get("prompt") or "")[:60]
@@ -2162,9 +2168,6 @@ def run_script(ctx, identifier, script_args, file_name, list_scripts):
python_path = str(venv_python)
# Execute (with retry on missing imports)
- prompt_preview = (run.get("prompt") or "")[:80]
- console.print(f"run {run_id} | {prompt_preview}", style="dim")
- console.print(f" {script}", style="dim")
result = subprocess.run(
[python_path, str(script), *script_args],
capture_output=True, text=True,
diff --git a/tests/test_run_command.py b/tests/test_run_command.py
index b2dceb2..28457eb 100644
--- a/tests/test_run_command.py
+++ b/tests/test_run_command.py
@@ -618,8 +618,8 @@ class TestRunCommandOutputMessages:
with patch("subprocess.run", return_value=MagicMock(returncode=0, stdout="", stderr="")):
result = cli_runner.invoke(main, ["run", "def789ghi012"])
- assert "Running" in result.output
- assert "api_client.py" in result.output
+ assert "run def789ghi012" in result.output
+ assert "hubspot" in result.output
def test_shows_run_id_in_output(self, cli_runner, mock_cli_env):
from reverse_api.cli import main