def config_prompts()

in devai-cli/src/devai/commands/prompts.py [0:0]


def config_prompts(set_path: Optional[str], show: bool, reset: bool):
    """Configure prompts directory settings."""
    if reset:
        config = get_config()
        if 'prompts_dir' in config:
            del config['prompts_dir']
            save_config(config)
        click.echo("Reset to use package prompts")
        return
    
    if show:
        user_dir = get_user_prompts_dir()
        if user_dir:
            click.echo(f"Using custom prompts directory: {user_dir}")
        else:
            click.echo(f"Using package prompts directory: {get_package_prompts_dir()}")
        return
    
    if set_path:
        try:
            new_path = set_prompts_dir(set_path)
            click.echo(f"Custom prompts directory set to: {new_path}")
            click.echo("You can override package prompts by creating files with the same names in this directory")
        except Exception as e:
            click.echo(f"Error setting prompts directory: {str(e)}", err=True)
        return
    
    click.echo("Please specify either --set-path, --show, or --reset")