Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions dreadnode_cli/agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,18 @@ def deploy(
print(formatted)
return

with Live(formatted, refresh_per_second=2) as live:
while run.is_running():
time.sleep(1)
run = client.get_strike_run(run.id)
live.update(format_run(run))
try:
with Live(formatted, refresh_per_second=2) as live:
while run.is_running():
time.sleep(1)
run = client.get_strike_run(run.id)
live.update(format_run(run))
except KeyboardInterrupt:
print("\n:warning: Terminating run...")
client.terminate_strike_run(run.id)
run = client.get_strike_run(run.id)
print(format_run(run))
return


@cli.command(help="List available models for the current (or specified) strike")
Expand Down
5 changes: 5 additions & 0 deletions dreadnode_cli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,11 @@ def get_strike_run(self, run: UUID | str) -> StrikeRunResponse:
response = self.request("GET", f"/api/strikes/runs/{run}")
return self.StrikeRunResponse(**response.json())

def terminate_strike_run(self, run: UUID | str) -> StrikeRunResponse:
"""Terminate a running strike."""
response = self.request("POST", f"/api/strikes/runs/{run}/terminate")
return self.StrikeRunResponse(**response.json())

def list_strike_runs(self, *, strike_id: UUID | str | None = None) -> list[StrikeRunSummaryResponse]:
response = self.request(
"GET", "/api/strikes/runs", query_params={"strike_id": str(strike_id)} if strike_id else None
Expand Down
Loading