Skip to content

Commit

Permalink
Add CLI version info
Browse files Browse the repository at this point in the history
  • Loading branch information
yoland68 committed May 14, 2024
1 parent 814999a commit a6681d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
21 changes: 18 additions & 3 deletions comfy_cli/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from comfy_cli.config_manager import ConfigManager
from comfy_cli.constants import GPU_OPTION
from comfy_cli.env_checker import EnvChecker, check_comfy_server_running
from comfy_cli.update import check_for_updates
from comfy_cli.update import check_for_updates, get_version_from_pyproject
from comfy_cli.workspace_manager import (
WorkspaceManager,
WorkspaceType,
Expand Down Expand Up @@ -94,9 +94,10 @@ def entry(
skip_prompt: Annotated[
Optional[bool],
typer.Option(
"--skip-prompt",
show_default=False,
is_flag=True,
help="Do not prompt user for input, use default options",
help="Do not prompt user for input, use default options and command line args",
),
] = None,
enable_telemetry: Annotated[
Expand All @@ -108,12 +109,26 @@ def entry(
help="Enable tracking",
),
] = True,
version: Annotated[
Optional[bool],
typer.Option(
"-v",
"--version",
show_default=False,
is_flag=True,
help="Display version",
),
] = False,
):
workspace_manager.setup_workspace_manager(workspace, here, recent, skip_prompt)

tracking.prompt_tracking_consent(skip_prompt, default_value=enable_telemetry)

if ctx.invoked_subcommand is None:
if version:
version = get_version_from_pyproject()
print(f"Comfy CLI version: {version}")

if ctx.invoked_subcommand is None and not version:
print(
"[bold yellow]Welcome to Comfy CLI![/bold yellow]: https://github.com/Comfy-Org/comfy-cli"
)
Expand Down
2 changes: 2 additions & 0 deletions comfy_cli/env_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from rich.table import Table
import requests

from comfy_cli import update
from comfy_cli.utils import singleton
from comfy_cli.config_manager import ConfigManager

Expand Down Expand Up @@ -109,6 +110,7 @@ def fill_print_table(self):
self.virtualenv_path if self.virtualenv_path else "Not Used",
)
table.add_row("Conda Env", self.conda_env if self.conda_env else "Not Used")
table.add_row("Comfy CLI Version", update.get_version_from_pyproject())

ConfigManager().fill_print_env(table)

Expand Down

0 comments on commit a6681d0

Please sign in to comment.