Skip to content

Commit

Permalink
Merge pull request #254 from bogdant36/CTX-6562
Browse files Browse the repository at this point in the history
CTX-6562: Implement coretex node status command.
  • Loading branch information
dule1322 authored Aug 21, 2024
2 parents e04cf1d + af13cbd commit 0067e65
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions coretex/cli/commands/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,20 @@ def config(advanced: bool) -> None:
activateAutoUpdate()


@click.command()
def status() -> None:
nodeStatus = getNodeStatus()
statusColors = {
"inactive": "red",
"active": 'green',
"busy": "cyan",
"reconnecting": "yellow"
}

statusEcho = click.style(nodeStatus.name, fg = statusColors[nodeStatus.name])
ui.stdEcho(f"Current status of node is {statusEcho}.")


@click.group()
@onBeforeCommandExecute(docker.isDockerAvailable)
@onBeforeCommandExecute(initializeUserSession)
Expand All @@ -192,3 +206,4 @@ def node() -> None:
node.add_command(stop, "stop")
node.add_command(update, "update")
node.add_command(config, "config")
node.add_command(status, "status")

0 comments on commit 0067e65

Please sign in to comment.