Skip to content

[ENH] CLI - Set Chroma env variables #4711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

itaismith
Copy link
Contributor

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 link

github-actions bot commented Jun 2, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor

propel-code-bot bot commented Jun 2, 2025

Enhance CLI: Add Chroma Environment Variable Commands to db connect

This PR introduces two new options to the chroma db connect CLI command: --env-file and --env-vars. The --env-file flag writes Chroma environment variables (API key, tenant, database) into a .env file in the current directory, creating or updating it as needed without duplicating keys. The --env-vars flag outputs the required environment variables directly to the terminal. Both options are mutually exclusive with language-based code snippet generation, and documentation has been updated to reflect this new functionality.

Key Changes:
• Added --env-file and --env-vars flags for chroma db connect in CLI
• Implementation to write or update a .env file with Chroma environment variables, avoiding duplicate keys
• Ability to print Chroma environment variables to terminal via --env-vars
• Expanded CLI argument parsing to handle flag exclusivity and usage errors
• Updated and expanded CLI documentation for these new options
• Introduced constants for environment variable names to avoid hardcoding

Affected Areas:
• rust/cli/src/commands/db.rs
• rust/cli/src/utils.rs
• docs/docs.trychroma.com/markdoc/content/cli/commands/db.md

This summary was automatically generated by @propel-code-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants