document the CHROMA_FOLDER env var usage in help
This commit is contained in:
+10
-1
@@ -6,6 +6,7 @@ import typer
|
|||||||
from chromadb.errors import InternalError, NotFoundError
|
from chromadb.errors import InternalError, NotFoundError
|
||||||
from rich import print
|
from rich import print
|
||||||
|
|
||||||
|
from chromy.chroma_functions import CHROMA_FOLDER_ENV_VAR
|
||||||
from chromy.errors import ChromaPathError
|
from chromy.errors import ChromaPathError
|
||||||
from chromy.handlers.count_collection import handle_count_collection
|
from chromy.handlers.count_collection import handle_count_collection
|
||||||
from chromy.handlers.create_collection import handle_create_collection
|
from chromy.handlers.create_collection import handle_create_collection
|
||||||
@@ -17,7 +18,15 @@ from chromy.handlers.import_data import handle_import
|
|||||||
from chromy.handlers.list_collections import handle_list_collections
|
from chromy.handlers.list_collections import handle_list_collections
|
||||||
from chromy.handlers.query import handle_query
|
from chromy.handlers.query import handle_query
|
||||||
|
|
||||||
app = typer.Typer(help="Chromy, local RAG CLI based on Chromadb.")
|
app = typer.Typer(
|
||||||
|
help=(
|
||||||
|
"Chromy, local RAG CLI based on Chromadb.\n\n"
|
||||||
|
"Storage location:\n"
|
||||||
|
"- By default, Chromy uses Chroma's default persistent location behavior.\n"
|
||||||
|
f"- Set {CHROMA_FOLDER_ENV_VAR} to a parent directory to override it.\n"
|
||||||
|
f"- Chromy stores data in <{CHROMA_FOLDER_ENV_VAR}>/chroma."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
ExitCodeHandler = Callable[[], int]
|
ExitCodeHandler = Callable[[], int]
|
||||||
|
|
||||||
|
|||||||
@@ -252,6 +252,14 @@ class CliTests(unittest.TestCase):
|
|||||||
self.assertNotEqual(result.exit_code, 0)
|
self.assertNotEqual(result.exit_code, 0)
|
||||||
self.assertIn("Missing option", result.output)
|
self.assertIn("Missing option", result.output)
|
||||||
|
|
||||||
|
def test_cli_help_documents_chroma_folder_env_var(self) -> None:
|
||||||
|
result = _invoke(["--help"])
|
||||||
|
|
||||||
|
self.assertEqual(result.exit_code, 0)
|
||||||
|
self.assertIn("CHROMA_FOLDER", result.stdout)
|
||||||
|
self.assertIn("parent directory", result.stdout)
|
||||||
|
self.assertIn("<CHROMA_FOLDER>/chroma", result.stdout)
|
||||||
|
|
||||||
def test_cli_surfaces_chroma_path_errors(self) -> None:
|
def test_cli_surfaces_chroma_path_errors(self) -> None:
|
||||||
with patch(
|
with patch(
|
||||||
"chromy.handlers.list_collections.list_collections",
|
"chromy.handlers.list_collections.list_collections",
|
||||||
|
|||||||
Reference in New Issue
Block a user