
    tniD                     @   d Z ddlZddlmZ ddlmZmZ  ej        dd          d	             Ze	                    d
          d             Z
e	                    d           ej        ddd           ej        ddd          d                                     ZdS )z
Runpod | CLI | SSH | Commands
    N)PrettyTable   )generate_ssh_key_pairget_user_pub_keyssshz8Manage and configure SSH keys for secure access to pods.)helpc                      dS )zManage and configure SSH keys.N r
       [/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/runpod/cli/groups/ssh/commands.pyssh_clir      s      r   z	list-keysc                      t                      } t          g d          }| D ],}|                    |d         |d         |d         f           -t          j        |           dS )z2
    Lists the SSH keys for the current user.
    )z
Public KeyTypeFingerprintnametypefingerprintN)r   r   add_rowclickecho)key_listtablekeys      r   	list_keysr      ss    
 !""H===>>E F Fs6{CK]1CDEEEE	Jur   zadd-keyz--keyzThe public key to add.)defaultr   z
--key-filez*The file containing the public key to add.c                     | sY|sWt          j        dd           t          j        ddt                    }|                    dd          }t          |           t          j        d	           d
S )zh
    Adds an SSH key to the current user account.
    If no key is provided, one will be generated.
    z1Would you like to add an SSH key to your account?T)abortz Please enter a name for this keyz
RunPod-Key)r   r    -z'The key has been added to your account.N)r   confirmpromptstrreplacer   r   )r   key_filekey_names      r   add_keyr&      s      (x (IQUVVVV<.3
 
 
 ##C--h'''	J899999r   )__doc__r   prettytabler   	functionsr   r   groupr   commandr   optionr&   r
   r   r   <module>r-      s     # # # # # # ? ? ? ? ? ? ? ? USTTT) ) UT) 	   	gt*BCCC$%Q  : :  DC 
: : :r   