diff --git a/dreadnode_cli/agent/cli.py b/dreadnode_cli/agent/cli.py index c22dc8e..b42c3a4 100644 --- a/dreadnode_cli/agent/cli.py +++ b/dreadnode_cli/agent/cli.py @@ -334,6 +334,9 @@ def deploy( agent_config = AgentConfig.read(directory) ensure_profile(agent_config) + user_config = UserConfig.read() + server_config = user_config.get_server_config() + active_link = agent_config.active_link client = api.create_client() @@ -375,7 +378,7 @@ def deploy( run = client.start_strike_run(agent.latest_version.id, strike=strike, model=model, user_model=user_model) agent_config.add_run(run.id).write(directory) - formatted = format_run(run) + formatted = format_run(run, server_url=server_config.url) if not watch: print(formatted) @@ -385,7 +388,7 @@ def deploy( while run.is_running(): time.sleep(1) run = client.get_strike_run(run.id) - live.update(format_run(run)) + live.update(format_run(run, server_url=server_config.url)) @cli.command(help="List available models for the current (or specified) strike") @@ -440,6 +443,9 @@ def latest( agent_config = AgentConfig.read(directory) ensure_profile(agent_config) + user_config = UserConfig.read() + server_config = user_config.get_server_config() + active_link = agent_config.active_link if not active_link.runs: print(":exclamation: No runs yet, use [bold]dreadnode agent deploy[/]") @@ -451,7 +457,7 @@ def latest( if raw: print(run.model_dump(mode="json")) else: - print(format_run(run, verbose=verbose, include_logs=logs)) + print(format_run(run, verbose=verbose, include_logs=logs, server_url=server_config.url)) @cli.command(help="Show the status of the active agent") diff --git a/dreadnode_cli/agent/format.py b/dreadnode_cli/agent/format.py index 3d6da46..9ab9524 100644 --- a/dreadnode_cli/agent/format.py +++ b/dreadnode_cli/agent/format.py @@ -259,7 +259,9 @@ def format_zones_verbose(zones: list[api.Client.StrikeRunZone], *, include_logs: return Group(*components) -def format_run(run: api.Client.StrikeRunResponse, *, verbose: bool = False, include_logs: bool = False) -> Panel: +def format_run( + run: api.Client.StrikeRunResponse, *, verbose: bool = False, include_logs: bool = False, server_url: str = "" +) -> Panel: # Main run information table = Table(show_header=False, box=box.SIMPLE) table.add_column("Property", style="dim") @@ -278,6 +280,10 @@ def format_run(run: api.Client.StrikeRunResponse, *, verbose: bool = False, incl table.add_row("model", run.model.replace(USER_MODEL_PREFIX, "") if run.model else "") table.add_row("agent", f"{agent_name} ([dim]rev[/] [yellow]{run.agent_revision}[/])") table.add_row("image", Text(run.agent_version.container.image, style="cyan")) + if server_url != "": + table.add_row( + "run url", Text(f"{server_url.rstrip('/')}/strikes/agents/{run.agent_key}/runs/{run.id}", style="cyan") + ) table.add_row("notes", run.agent_version.notes or "-") table.add_row("", "")