@zentao-hub/cli 0.1.1 → 0.1.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zentao-hub/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Helper CLI for @zentao-hub/mcp — registers the MCP server, installs slash commands / prompts (Claude Code, GitHub Copilot, Codex CLI), installs a commit-msg hook, and manages the bug hub + repos.yaml registry.",
5
5
  "license": "MIT",
6
6
  "author": "Deven Liu <iliudonghui@gmail.com>",
@@ -85,7 +85,8 @@ Write the analysis to `$BUG_DIR/analysis.md`.
85
85
  python3 -c "
86
86
  import yaml, sys
87
87
  with open('$REGISTRY') as f: data = yaml.safe_load(f) or {}
88
- entries = (data.get('products') or {}).get($1) or []
88
+ # CLI 'zentao-hub register' writes product keys as strings; coerce $1 to match.
89
+ entries = (data.get('products') or {}).get(str($1)) or []
89
90
  for e in entries: print(e.get('name', ''), e.get('path', ''), ','.join(e.get('tags', [])))
90
91
  "
91
92
  ```
@@ -103,12 +104,14 @@ Write the analysis to `$BUG_DIR/analysis.md`.
103
104
  python3 << 'PYEOF'
104
105
  import yaml
105
106
  with open('$REGISTRY') as f: data = yaml.safe_load(f) or {}
106
- data.setdefault('products', {}).setdefault($1, [])
107
+ # Use a string key to match what 'zentao-hub register' writes.
108
+ pid = str($1)
109
+ data.setdefault('products', {}).setdefault(pid, [])
107
110
  # Append entries, dedup by path
108
- existing = {e['path'] for e in data['products'][$1]}
111
+ existing = {e['path'] for e in data['products'][pid]}
109
112
  for new_path in [...]: # user-supplied
110
113
  if new_path not in existing:
111
- data['products'][$1].append({'path': new_path})
114
+ data['products'][pid].append({'path': new_path})
112
115
  with open('$REGISTRY', 'w') as f: yaml.safe_dump(data, f, allow_unicode=True, sort_keys=False)
113
116
  PYEOF
114
117
  ```