
    RЦix#                     
   S r SSKrSSKrSSKJr  SSKJrJr  SSKrSSK	J
r
Jr  SSKJr  SSKJr  SS	KJr  S
rSrSr\" S5      r\" S5      r\" S5      \" S5      \" S5      \" S5      S.r\" S5      \" S5      \" S5      \" S5      S.r\" SS9rS\4S jrS\4S jrS\S\SS4S jrS \S\S\4S! jrS"\S#\S\S\4S$ jr \RC                  S%/ S&QS'9       S=S(\\\RD                  " S)S*S94   S+\\\RD                  " S,S-S94   S.\\\RD                  " S/S0S94   S1\\\RD                  " S2S3S94   S4\\\RD                  " S5S6S7S94   S8\\\   \RD                  " S9S94   S\\\RD                  " S:S;S94   SS4S< jj5       r#g)>aK  Contains commands to manage skills for AI assistants.

Usage:
    # install the hf-cli skill for Claude (project-level, in current directory)
    hf skills add --claude

    # install for Cursor (project-level, in current directory)
    hf skills add --cursor

    # install for multiple assistants (project-level)
    hf skills add --claude --codex --opencode --cursor

    # install globally (user-level)
    hf skills add --claude --global

    # install to a custom directory
    hf skills add --dest=~/my-skills

    # overwrite an existing skill
    hf skills add --claude --force
    N)Path)	AnnotatedOptional)ContextGroup)get_command)CLIError   )typer_factoryzhf-clia  ---
name: hf-cli
description: "Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing repositories, models, datasets, and Spaces on the Hugging Face Hub. Replaces now deprecated `huggingface-cli` command."
---

Install: `curl -LsSf https://hf.co/cli/install.sh | bash -s`.

The Hugging Face Hub CLI tool `hf` is available. IMPORTANT: The `hf` command replaces the deprecated `huggingface_cli` command.

Use `hf --help` to view available functions. Note that auth commands are now all under `hf auth` e.g. `hf auth whoami`.
a
  
## Tips

- Use `hf <command> --help` for full options, usage, and real-world examples
- Use `--format json` for machine-readable output on list commands
- Use `-q` / `--quiet` to print only IDs
- Authenticate with `HF_TOKEN` env var (recommended) or with `--token`
z.agents/skillsz~/.agents/skillsz~/.codex/skillsz~/.claude/skillsz~/.cursor/skillsz~/.config/opencode/skills)codexclaudecursoropencodez.codex/skillsz.claude/skillsz.cursor/skillsz.opencode/skillsz Manage skills for AI assistants.)helpreturnc                    / nU R                    He  nUR                  (       d  M  UR                  R                  S5      (       a  M8  UR                  S:w  d  MJ  UR                  UR                  5        Mg     SR                  U5      $ )z?Format required params for a command as uppercase placeholders._z--help )paramsrequiredname
startswithhuman_readable_nameappendjoin)cmdpartsps      Y/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/huggingface_hub/cli/skills.py_format_paramsr    ^   sb    EZZ:::aff//449N9NRZ9ZLL../  88E?    c                      SSK Jn   SSKJn  [	        U5      n[        USS9n[        [        R                  5       5      nUR                  S5        UR                  SU  S35        UR                  S5        UR                  S	5        UR                  S5        / n/ n[        UR                  U5      5       He  nUR	                  X75      nUb  UR                  (       a  M*  [        U[        5      (       a  UR                  Xx45        MS  UR                  Xx45        Mg     U H|  u  pxUR                  =(       d    SR!                  S
5      S   R#                  5       n	[%        U5      n
SU/U
(       a  U
/O/ -   nUR                  SSR'                  U5       SU	 35        M~     U GH4  u  pxUR                  =(       d    SR!                  S
5      S   R#                  5       n	UR                  S5        UR                  SU SU	 35        UR                  S5        [        XUS9nUR                  U5       H  nUR	                  X5      nUb  UR                  (       a  M*  UR                  =(       d    SR!                  S
5      S   R#                  5       n[%        U5      n
SX}/U
(       a  U
/O/ -   nUR                  SSR'                  U5       SU 35        M     GM7     UR)                  [*        R                  5       5        S
R'                  U5      $ )Nr   )__version__)apphf)	info_name z!Generated with `huggingface_hub vz-`. Run `hf skills add --force` to regenerate.z## Commands
z- `r   u   ` — z### `hf )parentr&   )huggingface_hubr#   huggingface_hub.cli.hfr$   r   r   list_SKILL_YAML_PREFIX
splitlinesr   sortedlist_commandshidden
isinstancer   r   splitstripr    r   extend_SKILL_TIPS)r#   r$   	click_appctxlines	top_levelgroupsr   r   	help_textr   r   sub_ctxsub_namesub_cmdsub_helps                   r   build_skill_mdrA   g   s   +*C I
)t
,C .99;<E	LL	LL4[MAnop	LL	LL	LLIFy..s34##C.;#**c5!!MM4+&d[) 5 	XX^**40399;	$tF;s388E?+6)=>	  	XX^**40399;	RxvVI;78R#T:))'2Hoog8G'..*11$7:@@BH#G,F4*&vhbIELL3sxx/vhZ@A 3  
LL'')*99Ur!   pathforcec                 (   U R                  5       (       d  U R                  5       (       d  gU(       d  [        SU  S35      eU R                  5       (       a,  U R                  5       (       d  [        R
                  " U 5        gU R                  5         g)zRRemove existing file/directory/symlink if force is True, otherwise raise an error.NzSkill already exists at z#.
Re-run with --force to overwrite.)exists
is_symlink
SystemExitis_dirshutilrmtreeunlink)rB   rC   s     r   _remove_existingrL      sa    KKMMT__..3D69]^__{{}}T__..dr!   
skills_dirc                     U R                  5       R                  5       n U R                  SSS9  U [        -  n[	        X!5        UR                  5         US-  R                  [        5       SS9  U$ )zYDownload and install the skill files into a skills directory. Returns the installed path.Tparentsexist_okzSKILL.mdzutf-8)encoding)
expanduserresolvemkdirDEFAULT_SKILL_IDrL   
write_textrA   )rM   rC   dests      r   _install_torY      sh    &&(002JTD1((DT!JJL	J"">#3g"FKr!   agent_skills_dircentral_skill_pathc                     U R                  5       R                  5       n U R                  SSS9  U [        -  n[	        X25        UR                  [        R                  R                  X5      5        U$ )zMCreate a relative symlink from agent directory to the central skill location.TrO   )	rS   rT   rU   rV   rL   
symlink_toosrB   relpath)rZ   r[   rC   	link_paths       r   _create_symlinkra      sb    '224<<>4$7 #33IY&);NOr!   add)zhf skills add --claudezhf skills add --cursorzhf skills add --claude --globalz)hf skills add --codex --opencode --cursor)examplesr   z--claudezInstall for Claude.r   z--codexzInstall for Codex.r   z--cursorzInstall for Cursor.r   z
--opencodezInstall for OpenCode.global_z--globalz-gzJInstall globally (user-level) instead of in the current project directory.rX   z=Install into a custom destination (path to skills directory).z--forcez-Overwrite existing skills in the destination.c                    U (       d'  U(       d   U(       d  U(       d  U(       d  [        S5      eU(       ac  U (       d  U(       d  U(       d  U(       d  U(       a  [        S5        [        R                  " SS9e[	        XV5      n[        S[
         SU 35        gU(       a  [        O[        n/ n	U (       a  U	R                  US   5        U(       a  U	R                  US	   5        U(       a  U	R                  US
   5        U(       a  U	R                  US   5        U(       a  [        O[        n
[	        X5      n[        S[
         SU 35        U	 H  n[        XU5      n[        SU 35        M     g)z4Download a skill and install it for an AI assistant.zJPick a destination via --claude, --codex, --cursor, --opencode, or --dest.zT--dest cannot be combined with --claude, --codex, --cursor, --opencode, or --global.r
   )codezInstalled 'z' to Nr   r   r   r   z' to central location: zCreated symlink: )r	   printtyperExitrY   rV   GLOBAL_TARGETSLOCAL_TARGETSr   CENTRAL_GLOBALCENTRAL_LOCALra   )r   r   r   r   rd   rX   rC   
skill_desttargets_dictagent_targetscentral_pathr[   agent_targetr`   s                 r   
skills_addrs      s    J evTcddUfGhi**!$$ -
,-U:,?@%,>-L "M\(34\'23\(34\*56%,>-L$\9	K())@AS@T
UV%#LeL	!)-. &r!   )FFFFFNF)$__doc__r^   rI   pathlibr   typingr   r   rh   clickr   r   
typer.mainr   huggingface_hub.errorsr	   
_cli_utilsr   rV   r-   r6   rm   rl   rj   rk   
skills_clistrr    rA   boolrL   rY   ra   commandOptionrs    r!   r   <module>r      s{  , 
   &    " + %    %&() #$%&%&01	 /"#$#$'(	  BC
3 2 2j	4 	 	 	D  $ 	d 	 	T 	VZ 	 	   UZQVTYZ_ 	 	 	38/dELL:OPPQ8/T5<<	8LMMN8/ dELL:OPPQ8/ ell<>UVVW	8/
 ]	
	8/ P	
	8/& @	
	'8/4 
58/8/r!   