o
    i                     @   s  d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ e  eje jeedd d defddZdefddZ ej!ddddddZ"e"# ej$ddeddej$dde ddfd ej%d!ed"efd#d$Z&ee" ee" e"j'e	d%d& e"j'ed%d& e"j'ed%d& e"j'ed%d& e"j'ed%d& ej()e"Z*dS )'    N)logger)console)	agent_cli)auth_cli)create_deploy_command)create_docker_command)organization_cli)regions_cli)secrets_cli)config)ConfigFileErrorcli_log_levelINFO)levelvaluec                 C   s:   | rddl m} tdtj|tjjd  t d S )Nr   )versionu(   ᓚᘏᗢ Pipecat Cloud Client Version: )fg)pipecatcloud.__version__r   typerechostylecolorsGREENExit)r   r    r   P/home/ubuntu/.local/lib/python3.10/site-packages/pipecatcloud/cli/entry_point.pyversion_callback   s   r   c              
   C   s   | rNddl m} ddlm} |t  z| }|r,td tj| d W t W t  t	yM } zt
d|  W Y d }~t d }~ww d S )Nr   )pprint)load_deploy_config_filez+Deploy config [dim](pcc-deploy.toml)[/dim]:)datazBMalformed pcc-deploy.toml - Please correct errors and try again.

)rich.prettyr    pipecatcloud._utils.deploy_utilsr   r   to_dictr   print
print_jsonr   errorr   r   )r   r   r   deploy_configer   r   r   config_callback%   s(   
r(   TFmarkdownz'Deploy and manage bots on Pipecat ClouduD   ᓚᘏᗢ Pipecat Cloud CLI. See website at https://pipecat.daily.co)no_args_is_helpadd_completionrich_markup_mode
short_helphelpz	--versionzCLI version)callbackr.   z--configz
CLI configctx_version_configc                 C   s   d S )Nr   )r0   r1   r2   r   r   r   cliE   s   r3   Commands)rich_help_panel)+sysr   logurur   !pipecatcloud._utils.console_utilsr   pipecatcloud.cli.commands.agentr   pipecatcloud.cli.commands.authr    pipecatcloud.cli.commands.deployr    pipecatcloud.cli.commands.dockerr   'pipecatcloud.cli.commands.organizationsr   !pipecatcloud.cli.commands.regionsr	   !pipecatcloud.cli.commands.secretsr
   pipecatcloud.cli.configr   pipecatcloud.exceptionr   removeaddstderrstrgetupperboolr   r(   Typerentrypoint_cli_typerr/   OptionContextr3   	add_typermainget_commandentrypoint_clir   r   r   r   <module>   sT    
	