drinkzen-admin-cli 0.2.4__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/PKG-INFO +29 -1
  2. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/README.md +28 -0
  3. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin/__init__.py +1 -1
  4. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin/cli.py +27 -0
  5. drinkzen_admin_cli-0.3.0/drinkzen_admin/skill.py +35 -0
  6. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin_cli.egg-info/PKG-INFO +29 -1
  7. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin_cli.egg-info/SOURCES.txt +1 -0
  8. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/pyproject.toml +1 -1
  9. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin/client.py +0 -0
  10. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin/config.py +0 -0
  11. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin/formatting.py +0 -0
  12. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin/menu_options.py +0 -0
  13. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin_cli.egg-info/dependency_links.txt +0 -0
  14. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin_cli.egg-info/entry_points.txt +0 -0
  15. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/drinkzen_admin_cli.egg-info/top_level.txt +0 -0
  16. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/setup.cfg +0 -0
  17. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/tests/test_config.py +0 -0
  18. {drinkzen_admin_cli-0.2.4 → drinkzen_admin_cli-0.3.0}/tests/test_standalone_cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drinkzen-admin-cli
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
4
  Summary: Standalone CLI client for DrinkZen Admin operations
5
5
  Author: DrinkZen Team
6
6
  License: MIT
@@ -64,6 +64,34 @@ PYTHONPATH=packages/admin-cli python3 -m drinkzen_admin.cli config show
64
64
 
65
65
  ---
66
66
 
67
+ ## Agent Skill 安装
68
+
69
+ `drinkzen-admin` 提供与具体 AI 工具无关的运营使用手册。默认安装到当前项目的 `.agents/skills`:
70
+
71
+ ```bash
72
+ drinkzen-admin skill install
73
+ ```
74
+
75
+ 如需安装到当前用户的全局 Agent Skill 目录:
76
+
77
+ ```bash
78
+ drinkzen-admin skill install --scope global
79
+ ```
80
+
81
+ 查询目标路径或更新已有 Skill:
82
+
83
+ ```bash
84
+ drinkzen-admin skill path --scope project --json
85
+ drinkzen-admin skill path --scope global --json
86
+ drinkzen-admin skill install --force
87
+ ```
88
+
89
+ 项目级安装默认使用当前目录,也可以指定项目目录:
90
+
91
+ ```bash
92
+ drinkzen-admin skill install --scope project --project-dir /path/to/project
93
+ ```
94
+
67
95
  ## 密钥与持久化配置管理 (`config`)
68
96
 
69
97
  `drinkzen-admin` 提供了内置的密钥持久化管理,避免每次在终端手动输入敏感 Token 或将其留在 Bash 历史记录中。
@@ -42,6 +42,34 @@ PYTHONPATH=packages/admin-cli python3 -m drinkzen_admin.cli config show
42
42
 
43
43
  ---
44
44
 
45
+ ## Agent Skill 安装
46
+
47
+ `drinkzen-admin` 提供与具体 AI 工具无关的运营使用手册。默认安装到当前项目的 `.agents/skills`:
48
+
49
+ ```bash
50
+ drinkzen-admin skill install
51
+ ```
52
+
53
+ 如需安装到当前用户的全局 Agent Skill 目录:
54
+
55
+ ```bash
56
+ drinkzen-admin skill install --scope global
57
+ ```
58
+
59
+ 查询目标路径或更新已有 Skill:
60
+
61
+ ```bash
62
+ drinkzen-admin skill path --scope project --json
63
+ drinkzen-admin skill path --scope global --json
64
+ drinkzen-admin skill install --force
65
+ ```
66
+
67
+ 项目级安装默认使用当前目录,也可以指定项目目录:
68
+
69
+ ```bash
70
+ drinkzen-admin skill install --scope project --project-dir /path/to/project
71
+ ```
72
+
45
73
  ## 密钥与持久化配置管理 (`config`)
46
74
 
47
75
  `drinkzen-admin` 提供了内置的密钥持久化管理,避免每次在终端手动输入敏感 Token 或将其留在 Bash 历史记录中。
@@ -1,3 +1,3 @@
1
1
  """DrinkZen Admin CLI package."""
2
2
 
3
- __version__ = "0.2.4"
3
+ __version__ = "0.3.0"
@@ -12,6 +12,7 @@ from .client import AdminCLIClient
12
12
  from .config import cmd_config_path, cmd_config_set, cmd_config_show
13
13
  from .formatting import format_cli_output
14
14
  from .menu_options import normalize_menu_option_config
15
+ from .skill import install_skill, skill_path
15
16
 
16
17
 
17
18
  # ----------------------------------------------------------------------
@@ -404,6 +405,19 @@ def build_parser() -> argparse.ArgumentParser:
404
405
  c_show = config_sub.add_parser("show", help="Show active configuration with masked secrets", parents=[common_parser])
405
406
  c_path = config_sub.add_parser("path", help="Print configuration file path", parents=[common_parser])
406
407
 
408
+ # skill
409
+ skill_parser = subparsers.add_parser("skill", help="Install the agent-neutral DrinkZen Admin Skill")
410
+ skill_sub = skill_parser.add_subparsers(dest="skill_action", required=True)
411
+ s_install = skill_sub.add_parser("install", help="Download the Skill into .agents/skills")
412
+ s_install.add_argument("--scope", choices=["project", "global"], default="project")
413
+ s_install.add_argument("--project-dir", default=None, help="Project directory for project scope (default: current directory)")
414
+ s_install.add_argument("--force", action="store_true", help="Replace an existing Skill")
415
+ s_install.add_argument("--json", action="store_true", help="Output JSON format")
416
+ s_path = skill_sub.add_parser("path", help="Show the target Skill path")
417
+ s_path.add_argument("--scope", choices=["project", "global"], default="project")
418
+ s_path.add_argument("--project-dir", default=None)
419
+ s_path.add_argument("--json", action="store_true", help="Output JSON format")
420
+
407
421
  # brand
408
422
  brand_parser = subparsers.add_parser("brand", help="Brand operations", parents=[common_parser])
409
423
  brand_sub = brand_parser.add_subparsers(dest="brand_action", required=True)
@@ -470,6 +484,19 @@ def main(args: list[str] | None = None) -> int:
470
484
  is_json = getattr(parsed, "json", False)
471
485
  dry_run = getattr(parsed, "dry_run", False)
472
486
 
487
+ if parsed.subcommand == "skill":
488
+ target = skill_path(parsed.scope, parsed.project_dir)
489
+ if parsed.skill_action == "path":
490
+ print(format_cli_output({"path": str(target), "scope": parsed.scope}, parsed.json))
491
+ return 0
492
+ try:
493
+ installed = install_skill(parsed.scope, parsed.project_dir, parsed.force)
494
+ print(format_cli_output({"installed": True, "path": str(installed), "scope": parsed.scope}, parsed.json))
495
+ return 0
496
+ except Exception as exc:
497
+ print(format_cli_output({"installed": False, "error": str(exc), "path": str(target)}, parsed.json))
498
+ return 1
499
+
473
500
  # Config commands
474
501
  if parsed.subcommand == "config":
475
502
  if parsed.config_action == "set":
@@ -0,0 +1,35 @@
1
+ """Install the DrinkZen Admin Agent Skill without binding to a specific agent."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import urllib.request
6
+ from pathlib import Path
7
+
8
+ SKILL_NAME = "drinkzen-admin"
9
+ SKILL_URL = "https://raw.githubusercontent.com/xiaolinstar/drinkzen/main/.agents/skills/drinkzen-admin/SKILL.md"
10
+
11
+
12
+ def skill_path(scope: str = "project", project_dir: str | None = None) -> Path:
13
+ if scope == "global":
14
+ root = Path.home() / ".agents" / "skills"
15
+ else:
16
+ root = Path(project_dir or ".").expanduser().resolve() / ".agents" / "skills"
17
+ return root / SKILL_NAME / "SKILL.md"
18
+
19
+
20
+ def install_skill(
21
+ scope: str = "project",
22
+ project_dir: str | None = None,
23
+ force: bool = False,
24
+ url: str = SKILL_URL,
25
+ ) -> Path:
26
+ destination = skill_path(scope, project_dir)
27
+ if destination.exists() and not force:
28
+ raise FileExistsError(f"Skill already exists: {destination}. Use --force to replace it.")
29
+ destination.parent.mkdir(parents=True, exist_ok=True)
30
+ with urllib.request.urlopen(url, timeout=20) as response:
31
+ content = response.read()
32
+ if not content:
33
+ raise RuntimeError("Downloaded Skill is empty")
34
+ destination.write_bytes(content)
35
+ return destination
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drinkzen-admin-cli
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
4
  Summary: Standalone CLI client for DrinkZen Admin operations
5
5
  Author: DrinkZen Team
6
6
  License: MIT
@@ -64,6 +64,34 @@ PYTHONPATH=packages/admin-cli python3 -m drinkzen_admin.cli config show
64
64
 
65
65
  ---
66
66
 
67
+ ## Agent Skill 安装
68
+
69
+ `drinkzen-admin` 提供与具体 AI 工具无关的运营使用手册。默认安装到当前项目的 `.agents/skills`:
70
+
71
+ ```bash
72
+ drinkzen-admin skill install
73
+ ```
74
+
75
+ 如需安装到当前用户的全局 Agent Skill 目录:
76
+
77
+ ```bash
78
+ drinkzen-admin skill install --scope global
79
+ ```
80
+
81
+ 查询目标路径或更新已有 Skill:
82
+
83
+ ```bash
84
+ drinkzen-admin skill path --scope project --json
85
+ drinkzen-admin skill path --scope global --json
86
+ drinkzen-admin skill install --force
87
+ ```
88
+
89
+ 项目级安装默认使用当前目录,也可以指定项目目录:
90
+
91
+ ```bash
92
+ drinkzen-admin skill install --scope project --project-dir /path/to/project
93
+ ```
94
+
67
95
  ## 密钥与持久化配置管理 (`config`)
68
96
 
69
97
  `drinkzen-admin` 提供了内置的密钥持久化管理,避免每次在终端手动输入敏感 Token 或将其留在 Bash 历史记录中。
@@ -6,6 +6,7 @@ drinkzen_admin/client.py
6
6
  drinkzen_admin/config.py
7
7
  drinkzen_admin/formatting.py
8
8
  drinkzen_admin/menu_options.py
9
+ drinkzen_admin/skill.py
9
10
  drinkzen_admin_cli.egg-info/PKG-INFO
10
11
  drinkzen_admin_cli.egg-info/SOURCES.txt
11
12
  drinkzen_admin_cli.egg-info/dependency_links.txt
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "drinkzen-admin-cli"
7
- version = "0.2.4"
7
+ version = "0.3.0"
8
8
  description = "Standalone CLI client for DrinkZen Admin operations"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"