
    j                         d Z ddlZddlZddlZddlZddlmZmZ ddlm	Z	m
Z
 ddlmZmZ ddlmZ dd	lmZmZ ddZddZddZd
ee   fdZy)zIContains commands to print information about the environment and version.    N)__version__	constants   )dump_environment_infoinstallation_method   )_fetch_latest_pypi_version
run_update)out)DEFAULT_SKILL_ID_installed_hf_cli_dirsreturnc                      t                y)z(Print information about the environment.N)r        /home/vela/workspace/domain/tn-silver/web/tn-site/.runtime/depth-eval/venv/lib/python3.12/site-packages/huggingface_hub/cli/system.pyenvr      s    r   c                  :    t        j                  dt               y)z'Print information about the hf version.z
hf version)versionN)r   resultr   r   r   r   r   r   #   s    JJ|[1r   c                  X   t        j                  dt                t        j                  d       t        d      } | 't        | k(  rt        j                  dt         d       yt	        t        t        j                  t        j                              }t        |       }|dk7  r t        j                  j                  |	      |st        j                  d
       yt        j                  dt         d       t        j                   g t#               ddt        dd       y)z*Update the `hf` CLI to the latest version.zCurrent version: z)Checking for updates to latest version...huggingface_hubNzhf is up to date ())exclude_skillr   )codezPRun `hf skills add -g --claude` to teach your AI agents how to use the `hf` CLI.zUpdating the `z
` skill...skillsupdatez-gz--claude)r   textr   r	   boolr   r   AGENTS_SKILLS_GLOBAL_PATHCLAUDE_SKILLS_GLOBAL_PATHr
   click
exceptionsExithintr   
subprocesscall_hf_argv)latest_versionskill_installed
returncodes      r   r   r   (   s    HH ./HH89/0ABN!k^&C%k]!45
 yBBIDgDghO o*=>JQ###44cd
 HH~./z:;OOYhjY(YHY6FYYjYZr   c                  v    t               dk(  rt        j                  d      } | | gS t        j                  ddgS )z3argv prefix to invoke the freshly updated `hf` CLI.brewhfz-mzhuggingface_hub.cli.hf)r   shutilwhichsys
executable)hf_bins    r   r(   r(   G   s:    &d#8ONND":;;r   )r   N)__doc__r/   r&   r1   r"   r   r   r   utilsr   r   
_cli_utilsr	   r
   _outputr   _skillsr   r   r   r   r   liststrr(   r   r   r   <module>r;      sF    P   
  2 > >  =
2
[><$s) <r   