fix(cli): fix critical crashes, improve error messages, UX and validation in Node.js and Python SDKs (#4636)
This commit is contained in:
@@ -281,8 +281,8 @@ def search(
|
||||
# STEP 7: stdin fallback for query
|
||||
if query is None:
|
||||
query = _read_stdin()
|
||||
if query is None:
|
||||
print_error(err_console, "No query provided. Pass a query argument or pipe via stdin.")
|
||||
if not query or not query.strip():
|
||||
print_error(err_console, "Search query cannot be empty.")
|
||||
raise typer.Exit(1)
|
||||
|
||||
backend, config = _get_backend_and_config(api_key, base_url)
|
||||
@@ -1014,6 +1014,13 @@ def help(
|
||||
console.print()
|
||||
|
||||
|
||||
@app.command(rich_help_panel="Utility")
|
||||
def version() -> None:
|
||||
"""Show version and exit."""
|
||||
from mem0_cli.commands.utils import cmd_version
|
||||
cmd_version()
|
||||
|
||||
|
||||
# Register config subgroup here so it appears after help in Management panel
|
||||
app.add_typer(config_app, name="config", rich_help_panel="Management")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user