langchain done cli

This commit is contained in:
2026-02-03 19:51:35 +03:00
parent 351fe27cca
commit d99433d087
5 changed files with 159 additions and 2 deletions

View File

@@ -0,0 +1,32 @@
import click
from loguru import logger
import os
from pathlib import Path
# Configure logging to output to both file and stdout as specified in requirements
def setup_logging():
# Create logs directory if it doesn't exist
logs_dir = Path("logs")
logs_dir.mkdir(exist_ok=True)
# Add file logging with rotation
logger.add("logs/dev.log", rotation="10 MB", retention="10 days")
@click.group()
def cli():
"""Main CLI group"""
setup_logging()
pass
@cli.command(name="ping", help="Ping command that outputs pong")
def ping():
"""Ping command that outputs pong"""
logger.info("Ping command executed")
click.echo("pong")
if __name__ == "__main__":
cli()