fix: suppress loguru noise in CLI, fix birdx text parser
- CLI now suppresses loguru INFO logs by default (use -v/--verbose to show) - Fixed birdx output parser to correctly extract author, url, date, text - birdx search now uses plain text output (--json returns empty arrays)
This commit is contained in:
parent
d891af5b7d
commit
e7cd04655e
2 changed files with 63 additions and 22 deletions
|
|
@ -17,15 +17,25 @@ import sys
|
|||
import asyncio
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
|
||||
from agent_eyes import __version__
|
||||
|
||||
|
||||
def _configure_logging(verbose: bool = False):
|
||||
"""Suppress loguru output unless --verbose is set."""
|
||||
from loguru import logger
|
||||
logger.remove() # Remove default stderr handler
|
||||
if verbose:
|
||||
logger.add(sys.stderr, level="INFO")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="agent-eyes",
|
||||
description="👁️ Give your AI Agent eyes to see the entire internet",
|
||||
)
|
||||
parser.add_argument("-v", "--verbose", action="store_true", help="Show debug logs")
|
||||
sub = parser.add_subparsers(dest="command", help="Available commands")
|
||||
|
||||
# ── read ──
|
||||
|
|
@ -66,6 +76,9 @@ def main():
|
|||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Suppress loguru noise unless --verbose
|
||||
_configure_logging(getattr(args, "verbose", False))
|
||||
|
||||
if not args.command:
|
||||
parser.print_help()
|
||||
sys.exit(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue