|
35 | 35 | skills_app = typer.Typer(help="Manage Gradio skills for AI assistants.") |
36 | 36 |
|
37 | 37 |
|
38 | | -def _import_hf_skills(): |
39 | | - try: |
40 | | - from huggingface_hub.cli.skills import ( # type: ignore[import-not-found] |
41 | | - CENTRAL_GLOBAL, |
42 | | - CENTRAL_LOCAL, |
43 | | - GLOBAL_TARGETS, |
44 | | - LOCAL_TARGETS, |
45 | | - ) |
46 | | - except (ImportError, ModuleNotFoundError): |
47 | | - raise SystemExit( |
48 | | - "The 'gradio skills' command requires huggingface_hub >= 1.4.0.\n" |
49 | | - "Please upgrade: pip install --upgrade huggingface_hub" |
50 | | - ) from None |
51 | | - return CENTRAL_GLOBAL, CENTRAL_LOCAL, GLOBAL_TARGETS, LOCAL_TARGETS |
| 38 | +def _get_skill_targets(): |
| 39 | + central_local = Path(".agents/skills") |
| 40 | + central_global = Path("~/.agents/skills") |
| 41 | + claude_local = Path(".claude/skills") |
| 42 | + claude_global = Path("~/.claude/skills") |
| 43 | + global_targets = { |
| 44 | + "claude": claude_global, |
| 45 | + "codex": Path("~/.codex/skills"), |
| 46 | + "opencode": Path("~/.opencode/skills"), |
| 47 | + } |
| 48 | + local_targets = { |
| 49 | + "claude": claude_local, |
| 50 | + "codex": Path(".codex/skills"), |
| 51 | + "opencode": Path(".opencode/skills"), |
| 52 | + } |
| 53 | + return central_global, central_local, global_targets, local_targets |
52 | 54 |
|
53 | 55 |
|
54 | 56 | def _download(url: str) -> str: |
@@ -324,7 +326,7 @@ def skills_add( |
324 | 326 | specific Gradio Space with Python, JS, and cURL usage examples. |
325 | 327 | """ |
326 | 328 | central_global, central_local, hf_global_targets, hf_local_targets = ( |
327 | | - _import_hf_skills() |
| 329 | + _get_skill_targets() |
328 | 330 | ) |
329 | 331 |
|
330 | 332 | if not (cursor or claude or codex or opencode or dest): |
|
0 commit comments