feat(cli): show project path in cow status

This commit is contained in:
zhayujie
2026-06-06 19:06:19 +08:00
parent 72847e0711
commit 0e4da1d1c5

View File

@@ -275,7 +275,7 @@ def update(ctx):
def status():
"""Show CowAgent running status."""
from cli import __version__
from cli.utils import load_config_json, get_cli_language
from cli.utils import load_config_json, get_cli_language, get_project_root
# get_cli_language() calls ensure_sys_path(), which adds the project root
# to sys.path. Import `common` only AFTER that, otherwise it fails with
@@ -292,6 +292,11 @@ def status():
click.echo(_t(f" 版本: v{__version__}", f" Version: v{__version__}"))
# Project path bound to this `cow` CLI — disambiguates which checkout the
# command actually controls when the user has multiple clones.
project_root = get_project_root()
click.echo(_t(f" 路径: {project_root}", f" Path: {project_root}"))
cfg = load_config_json()
if cfg:
channel = cfg.get("channel_type", "unknown")