MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / RunStatus

Function RunStatus

cmd/status.go:34–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32}
33
34func RunStatus() error {
35 client, err := getAuthenticatedClient()
36 if err != nil {
37 return err
38 }
39 monitoring := !noWait
40 interactive := tui.IsInteractive() && !JSONOutput
41
42 // Auto-disable monitoring in non-interactive mode
43 if monitoring && !interactive {
44 monitoring = false
45 }
46
47 var instances []api.Instance
48 if err := tui.RunWithBusySpinner("Fetching instances...", os.Stdout, func() error {
49 var e error
50 instances, e = client.ListInstances()
51 return e
52 }); err != nil {
53 return fmt.Errorf("failed to fetch instances: %w", err)
54 }
55
56 if JSONOutput {
57 printJSON(instances)
58 return nil
59 }
60
61 if !interactive {
62 renderPlainStatusTable(instances, verboseStatus)
63 return nil
64 }
65
66 return tui.RunStatus(client, monitoring, instances, verboseStatus)
67}

Callers 2

status.goFile · 0.70
TestRunStatusFunction · 0.70

Calls 7

IsInteractiveFunction · 0.92
RunWithBusySpinnerFunction · 0.92
RunStatusFunction · 0.92
getAuthenticatedClientFunction · 0.85
printJSONFunction · 0.85
renderPlainStatusTableFunction · 0.85
ListInstancesMethod · 0.65

Tested by 1

TestRunStatusFunction · 0.56