Skip to content

Commit c807d1d

Browse files
itaismithphilipkiely-baseten
authored andcommitted
[DOC] CLI Docs (chroma-core#4187)
## Description of changes New docs for the CLI
1 parent c87120b commit c807d1d

File tree

7 files changed

+157
-48
lines changed

7 files changed

+157
-48
lines changed

docs/docs.trychroma.com/markdoc/content/cli/install-and-run.md

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Installing the Chroma CLI
2+
3+
The Chroma CLI lets you run a Chroma server locally on your machine, install sample apps, browse your collections, interact with your Chroma Cloud DBs, and much more!
4+
5+
When you install our Python or JavaScript package globally, you will automatically get the Chroma CLI.
6+
7+
If you don't use one of our packages, you can still install the CLI as a standalone program with `cURL` (or `iex` on Windows).
8+
9+
## Python
10+
11+
You can install Chroma in your environment using `pip`:
12+
13+
```terminal
14+
pip install chromadb
15+
```
16+
17+
Or install the Chroma CLI globally with `pipx`
18+
19+
```terminal
20+
pipx install chromadb
21+
```
22+
23+
[//]: # (## JavaScript)
24+
25+
[//]: # ()
26+
[//]: # ({% TabbedUseCaseCodeBlock language="Terminal" %})
27+
28+
[//]: # ()
29+
[//]: # ({% Tab label="yarn" %})
30+
31+
[//]: # (```terminal)
32+
33+
[//]: # (yarn global add chromadb )
34+
35+
[//]: # (```)
36+
37+
[//]: # ({% /Tab %})
38+
39+
[//]: # ()
40+
[//]: # ({% Tab label="npm" %})
41+
42+
[//]: # (```terminal)
43+
44+
[//]: # (npm install -g chromadb)
45+
46+
[//]: # (```)
47+
48+
[//]: # ({% /Tab %})
49+
50+
[//]: # ()
51+
[//]: # ({% Tab label="pnpm" %})
52+
53+
[//]: # (```terminal)
54+
55+
[//]: # (pnpm add -g chromadb )
56+
57+
[//]: # (```)
58+
59+
[//]: # ({% /Tab %})
60+
61+
[//]: # ()
62+
[//]: # ({% Tab label="bun" %})
63+
64+
[//]: # (```terminal)
65+
66+
[//]: # (bun add -g chromadb )
67+
68+
[//]: # (```)
69+
70+
[//]: # ({% /Tab %})
71+
72+
[//]: # ()
73+
[//]: # ({% /TabbedUseCaseCodeBlock %})
74+
75+
## Install Globally
76+
77+
{% TabbedUseCaseCodeBlock language="Terminal" %}
78+
79+
{% Tab label="cURL" %}
80+
```terminal
81+
curl -sSL https://raw.githubusercontent.com/chroma-core/chroma/main/rust/cli/install/install.sh | bash
82+
```
83+
{% /Tab %}
84+
85+
{% Tab label="Windows" %}
86+
```terminal
87+
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/chroma-core/chroma/main/rust/cli/install/install.ps1'))
88+
```
89+
{% /Tab %}
90+
91+
{% /TabbedUseCaseCodeBlock %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Running a Chroma Server
2+
3+
The Chroma CLI lets you run a Chroma server locally with the `chroma run` command:
4+
5+
```terminal
6+
chroma run --path [/path/to/persist/data]
7+
```
8+
9+
Your Chroma server will persist its data in the path you provide after the `path` argument. By default,
10+
it will save data to the `chroma` directory.
11+
12+
You can further customize how your Chroma server runs with these arguments:
13+
* `host` - defines the hostname where your server runs. By default, this is `localhost`.
14+
* `port` - the port your Chroma server will use to listen for requests from clients. By default the port is `8000`.
15+
* `config_path` - instead of providing `path`, `host`, and `port`, you can provide a configuration file with these definitions and more. You can find an example [here](https://github.com/chroma-core/chroma/blob/main/rust/frontend/sample_configs/single_node_full.yaml).
16+
17+
## Connecting to your Chroma Server
18+
19+
With your Chroma server running, you can connect to it with the `HttpClient`:
20+
21+
{% TabbedCodeBlock %}
22+
23+
{% Tab label="python" %}
24+
```python
25+
import chromadb
26+
27+
chroma_client = chromadb.HttpClient(host='localhost', port=8000)
28+
```
29+
{% /Tab %}
30+
31+
{% Tab label="typescript" %}
32+
```typescript
33+
import { ChromaClient } from "chromadb";
34+
35+
const client = new ChromaClient();
36+
```
37+
{% /Tab %}
38+
39+
{% /TabbedCodeBlock %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Sample Apps
2+
3+
The Chroma team regularly releases sample AI applications powered by Chroma, which you can use to learn about retrieval, building with AI, and as a jumping-off board for your own projects.
4+
5+
The CLI makes it easy to install and set up the Chroma sample apps on your local machine with the `chroma install` command.
6+
7+
To install a sample app simply run
8+
9+
```terminal
10+
chroma install [app_name]
11+
```
12+
13+
The CLI will walk you through any particular customization you can make, and setting up your environment.
14+
15+
To see a full list of available sample app, use the `list` argument:
16+
17+
```terminal
18+
chroma install --list
19+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Update
2+
3+
The `chroma update` command wil inform you if you should update your CLI installation.
4+
5+
If you run the CLI via our Python or JavaScript packages, the `update` command will inform you if a new `chromadb` version is availble. When you update your `chromadb` package, you will also get the latest version of the CLI bundled with it.

docs/docs.trychroma.com/markdoc/content/sidebar-config.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ const sidebarConfig: AppSection[] = [
157157
default: "install-and-run",
158158
icon: SquareTerminalIcon,
159159
pages: [
160-
{ id: "install-and-run", name: "Install and run" },
160+
{ id: "install", name: "Installing the CLI" },
161+
{ id: "run", name: "Run a Chroma Server" },
162+
{ id: "sample-apps", name: "Sample Apps" },
161163
{ id: "vacuum", name: "Vacuum" },
162164
],
163165
},
@@ -186,14 +188,6 @@ const sidebarConfig: AppSection[] = [
186188
},
187189
],
188190
},
189-
// {
190-
// id: "guides-and-examples",
191-
// name: "Guides & Examples",
192-
// icon: GraduationCap,
193-
// disable: true,
194-
// tag: "Coming Soon",
195-
// },
196191
];
197192

198193
export default sidebarConfig;
199-

docs/docs.trychroma.com/next-env.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference types="next/navigation-types/compat/navigation" />
43

54
// NOTE: This file should not be edited
65
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

0 commit comments

Comments
 (0)