From fb5d0f7c0cf41d7ade7b7a13fc88bd1e3ab4e449 Mon Sep 17 00:00:00 2001 From: Matteo Rosati Date: Thu, 23 Apr 2026 19:37:13 +0200 Subject: [PATCH] add comments --- chromy/cli.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/chromy/cli.py b/chromy/cli.py index 8daa6a5..50241b5 100644 --- a/chromy/cli.py +++ b/chromy/cli.py @@ -31,6 +31,9 @@ def _fail(message: str) -> None: raise typer.Exit(1) +# ------------------------------------------------------------------------------ +# LIST COLLECTIONS +# ------------------------------------------------------------------------------ @app.command( "list-collections", help="List all collections stored in the local Chroma database.", @@ -39,6 +42,9 @@ def list_collections() -> None: _run(handle_list_collections) +# ------------------------------------------------------------------------------ +# CREATE A COLLECTION +# ------------------------------------------------------------------------------ @app.command( "create-collection", help="Create a collection in the local Chroma database.", @@ -55,6 +61,9 @@ def create_collection( _fail(f"Collection '{collection}' already exists.") +# ------------------------------------------------------------------------------ +# DELETE A COLLECTION +# ------------------------------------------------------------------------------ @app.command( "delete-collection", help="Delete a collection from the local Chroma database.", @@ -71,6 +80,9 @@ def delete_collection( _fail(f"Collection '{collection}' does not exist.") +# ------------------------------------------------------------------------------ +# COUNT RECORDS +# ------------------------------------------------------------------------------ @app.command( "count", help="Count records in a collection from the local Chroma database.", @@ -87,6 +99,9 @@ def count( _fail(f"Collection '{collection}' does not exist.") +# ------------------------------------------------------------------------------ +# IMPORT DATA +# ------------------------------------------------------------------------------ @app.command( "import", help="Chunk, embed, and add a file to a collection in the local Chroma database.", @@ -109,6 +124,9 @@ def import_data( _fail(f"The file {file} was not found.") +# ------------------------------------------------------------------------------ +# QUERY +# ------------------------------------------------------------------------------ @app.command("query", help="Query a collection with the provided text.") def query( collection: Annotated[ @@ -126,6 +144,9 @@ def query( _fail(f"Collection '{collection}' does not exist.") +# ------------------------------------------------------------------------------ +# DELETE DATA +# ------------------------------------------------------------------------------ @app.command("delete", help="Delete records from a collection using a metadata filter.") def delete_records( collection: Annotated[