Skip to content

Commit 0d085fe

Browse files
authored
add run url to deploy output (#33)
1 parent dee6828 commit 0d085fe

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

dreadnode_cli/agent/cli.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ def deploy(
334334
agent_config = AgentConfig.read(directory)
335335
ensure_profile(agent_config)
336336

337+
user_config = UserConfig.read()
338+
server_config = user_config.get_server_config()
339+
337340
active_link = agent_config.active_link
338341

339342
client = api.create_client()
@@ -375,7 +378,7 @@ def deploy(
375378

376379
run = client.start_strike_run(agent.latest_version.id, strike=strike, model=model, user_model=user_model)
377380
agent_config.add_run(run.id).write(directory)
378-
formatted = format_run(run)
381+
formatted = format_run(run, server_url=server_config.url)
379382

380383
if not watch:
381384
print(formatted)
@@ -385,7 +388,7 @@ def deploy(
385388
while run.is_running():
386389
time.sleep(1)
387390
run = client.get_strike_run(run.id)
388-
live.update(format_run(run))
391+
live.update(format_run(run, server_url=server_config.url))
389392

390393

391394
@cli.command(help="List available models for the current (or specified) strike")
@@ -440,6 +443,9 @@ def latest(
440443
agent_config = AgentConfig.read(directory)
441444
ensure_profile(agent_config)
442445

446+
user_config = UserConfig.read()
447+
server_config = user_config.get_server_config()
448+
443449
active_link = agent_config.active_link
444450
if not active_link.runs:
445451
print(":exclamation: No runs yet, use [bold]dreadnode agent deploy[/]")
@@ -451,7 +457,7 @@ def latest(
451457
if raw:
452458
print(run.model_dump(mode="json"))
453459
else:
454-
print(format_run(run, verbose=verbose, include_logs=logs))
460+
print(format_run(run, verbose=verbose, include_logs=logs, server_url=server_config.url))
455461

456462

457463
@cli.command(help="Show the status of the active agent")

dreadnode_cli/agent/format.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ def format_zones_verbose(zones: list[api.Client.StrikeRunZone], *, include_logs:
259259
return Group(*components)
260260

261261

262-
def format_run(run: api.Client.StrikeRunResponse, *, verbose: bool = False, include_logs: bool = False) -> Panel:
262+
def format_run(
263+
run: api.Client.StrikeRunResponse, *, verbose: bool = False, include_logs: bool = False, server_url: str = ""
264+
) -> Panel:
263265
# Main run information
264266
table = Table(show_header=False, box=box.SIMPLE)
265267
table.add_column("Property", style="dim")
@@ -278,6 +280,10 @@ def format_run(run: api.Client.StrikeRunResponse, *, verbose: bool = False, incl
278280
table.add_row("model", run.model.replace(USER_MODEL_PREFIX, "") if run.model else "<default>")
279281
table.add_row("agent", f"{agent_name} ([dim]rev[/] [yellow]{run.agent_revision}[/])")
280282
table.add_row("image", Text(run.agent_version.container.image, style="cyan"))
283+
if server_url != "":
284+
table.add_row(
285+
"run url", Text(f"{server_url.rstrip('/')}/strikes/agents/{run.agent_key}/runs/{run.id}", style="cyan")
286+
)
281287
table.add_row("notes", run.agent_version.notes or "-")
282288

283289
table.add_row("", "")

0 commit comments

Comments
 (0)