Skip to content

Commit

Permalink
feat: CLI now has host option which defaults to localhost
Browse files Browse the repository at this point in the history
- Also made the initial printout about how to connect to chroma aligned with the host value so users don't get confused how to connect to chroma
- Removed previously committed chroma_data dir
  • Loading branch information
tazarov committed Oct 19, 2023
1 parent ac644a8 commit 19d55cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Binary file removed chroma_data/chroma.sqlite3
Binary file not shown.
10 changes: 7 additions & 3 deletions chromadb/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Annotated, Optional
import typer
import uvicorn
import os
Expand Down Expand Up @@ -26,8 +27,11 @@ def run(
path: str = typer.Option(
"./chroma_data", help="The path to the file or directory."
),
host: Annotated[Optional[str], typer.Option(
help="The host to listen to. Default: localhost")] = "localhost",
port: int = typer.Option(8000, help="The port to run the server on."),
test: bool = typer.Option(False, help="Test mode.", show_envvar=False, hidden=True),
test: bool = typer.Option(False, help="Test mode.",
show_envvar=False, hidden=True),
) -> None:
"""Run a chroma server"""

Expand All @@ -39,7 +43,7 @@ def run(

typer.echo(f"\033[1mSaving data to\033[0m: \033[32m{path}\033[0m")
typer.echo(
f"\033[1mConnect to chroma at\033[0m: \033[32mhttp://localhost:{port}\033[0m"
f"\033[1mConnect to chroma at\033[0m: \033[32mhttp://{host}:{port}\033[0m"
)
typer.echo(
"\033[1mGetting started guide\033[0m: https://docs.trychroma.com/getting-started\n\n"
Expand All @@ -57,7 +61,7 @@ def run(

config = {
"app": "chromadb.app:app",
"host": "0.0.0.0",
"host": host,
"port": port,
"workers": 1,
"log_config": f"{chromadb_path}/log_config.yml",
Expand Down

0 comments on commit 19d55cd

Please sign in to comment.