Skip to content

Commit 6dde453

Browse files
authored
[ENH] CLI install command v1 (#4183)
## Description of changes Add `install` command for the CLI to support installing the generative benchmarking sample app. ## Test plan N/A ## Documentation Changes N/A
1 parent 50167cb commit 6dde453

File tree

9 files changed

+854
-32
lines changed

9 files changed

+854
-32
lines changed

Cargo.lock

+224-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cli/Cargo.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "chroma-cli"
3-
version = "0.1.0"
3+
version = "1.0.0"
44
edition = "2021"
55

66
[dependencies]
@@ -18,7 +18,7 @@ chroma-log = { workspace = true }
1818
colored = "3.0.0"
1919
dialoguer = "0.11.0"
2020
dirs = "6.0.0"
21-
indicatif.workspace = true
21+
indicatif = { workspace = true }
2222
rand = {workspace = true}
2323
reqwest = { workspace = true }
2424
serde = { workspace = true, features = ["derive"] }
@@ -33,8 +33,12 @@ strum = "0.27.1"
3333
strum_macros = "0.27.1"
3434
semver = "1.0.26"
3535
regex = "1.11.1"
36+
futures-util = "0.3.31"
37+
zip-extract = "0.2.1"
3638
urlencoding = "2.1.3"
3739
tower-http = {workspace = true}
40+
crossterm = "0.29.0"
41+
3842

3943
[dev-dependencies]
4044
assert_cmd = "2.0.16"

rust/cli/src/commands/db.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use crate::client::get_chroma_client;
2-
use crate::utils::{copy_to_clipboard, get_current_profile, CliError, Profile, UtilsError};
2+
use crate::utils::{
3+
copy_to_clipboard, get_current_profile, CliError, Profile, UtilsError, SELECTION_LIMIT,
4+
};
35
use chroma_types::Database;
46
use clap::{Args, Subcommand, ValueEnum};
57
use colored::Colorize;
@@ -10,8 +12,6 @@ use strum::IntoEnumIterator;
1012
use strum_macros::EnumIter;
1113
use thiserror::Error;
1214

13-
const LIST_DB_SELECTION_LIMIT: usize = 5;
14-
1515
#[derive(Debug, Error)]
1616
pub enum DbError {
1717
#[error("")]
@@ -285,7 +285,7 @@ fn get_db_name(dbs: &[Database], prompt: &str) -> Result<String, CliError> {
285285

286286
println!("{}", prompt.blue().bold());
287287
let name = match dbs.len() {
288-
0..=LIST_DB_SELECTION_LIMIT => select_db(dbs),
288+
0..=SELECTION_LIMIT => select_db(dbs),
289289
_ => prompt_db_name(prompt),
290290
}?;
291291

@@ -445,6 +445,7 @@ mod tests {
445445
use crate::commands::profile::ProfileError::NoActiveProfile;
446446
use crate::utils::{
447447
get_current_profile, write_config, write_profiles, AddressBook, CliConfig, Profile,
448+
SampleAppsConfig,
448449
};
449450
use assert_cmd::Command;
450451
use predicates::str::contains;
@@ -467,6 +468,7 @@ mod tests {
467468

468469
let config = CliConfig {
469470
current_profile: "profile".to_string(),
471+
sample_apps: SampleAppsConfig::default(),
470472
};
471473

472474
write_profiles(&profiles).unwrap();

0 commit comments

Comments
 (0)