You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description of changes
Adding `chroma db connect --env-file` which sets environment variables
required for connecting to ChromaCloud in the `.env` file in the current
directory (or create it). The `chroma db connect --env-vars` option will
output to the terminal.
## Test plan
Manual testing.
## Documentation Changes
Included in this PR under CLI docs.
Copy file name to clipboardExpand all lines: docs/docs.trychroma.com/markdoc/content/cli/commands/db.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,20 @@ The output code snippet will already have the API key of your profile set for th
12
12
chroma db connect [db_name] [--language python/JS/TS]
13
13
```
14
14
15
+
The `connect` command can also add Chroma environment variables (`CHROMA_API_KEY`, `CHROMA_TENANT`, and `CHROMA_DATABASE`) to a `.env` file in your current working directory. It will create a `.env` file for you if it doesn't exist:
16
+
17
+
```terminal
18
+
chroma db connect [db_name] --env-file
19
+
```
20
+
21
+
If you prefer to simply output these variables to your terminal use:
22
+
23
+
```terminal
24
+
chroma db connect [db_name] --env-vars
25
+
```
26
+
27
+
Setting these environment variables will allow you to concisely instantiate the `CloudClient` with no arguments.
28
+
15
29
### Create
16
30
17
31
The `create` command lets you create a database on Chroma Cloud. It has the `name` argument, which is the name of the DB you want to create. If you don't provide it, the CLI will prompt you to choose a name.
#[error("Failed to create or update .env file with Chroma environment variables")]
32
+
EnvFile,
26
33
}
27
34
28
35
#[derive(Debug,Clone,ValueEnum,EnumIter)]
@@ -98,6 +105,10 @@ pub struct ConnectArgs {
98
105
help = "The programming language to use for the connection snippet"
99
106
)]
100
107
language:Option<Language>,
108
+
#[clap(long = "env-file", default_value_t = false, conflicts_with_all = ["language","env_vars"], help = "Add Chroma environment variables to a .env file in the current directory")]
0 commit comments