2026-04-24 18:20:22 +02:00
2026-04-23 20:52:15 +02:00
2026-04-24 18:20:22 +02:00
2026-04-23 22:00:45 +02:00
2026-04-21 19:50:48 +02:00
2026-04-21 13:32:09 +02:00
2026-04-23 22:03:16 +02:00
2026-04-23 21:49:46 +02:00
2026-04-22 22:21:14 +02:00
2026-04-23 21:49:46 +02:00

Chromy

A small command-line utility for working with a local Chroma database. It lets you create collections, ingest file contents as chunked embeddings, and run similarity queries against stored documents.

What it does

  • manages local Chroma collections
  • chunks files with semchunk
  • generates embeddings with Chroma's default embedding function
  • stores chunk text plus source file metadata
  • queries collections and prints readable results

Requirements

  • Python 3.12+
  • a local environment able to install the project dependencies in pyproject.toml

Installation

For local development, install the project dependencies with uv:

uv sync

Or with pip:

python -m venv .venv
source .venv/bin/activate
pip install -e .

Build

Build the source distribution and wheel with uv:

uv build

The build artifacts are written to dist/.

Install as a tool with uv

The project exposes a chromy command through the Python packaging entrypoint. Install it as a standalone uv tool from the project directory:

uv tool install .

After installation, run the CLI directly:

chromy --help

To install from a built wheel instead:

uv build
uv tool install dist/chromy-1.0.0-py3-none-any.whl

During development, install the tool in editable mode so changes in the working tree are picked up without reinstalling:

uv tool install --editable .

Running the CLI

The project entrypoint is available as the chromy command after installing the tool:

chromy --help

You can also run it from the source tree without installing the tool:

uv run python -m chromy.main --help

Running Tests

Run the test suite with pytest:

uv run pytest -q

Development Checks

Run Ruff linting:

uv run ruff check .

Check Ruff formatting:

uv run ruff format --check .

Run static type checking with mypy:

uv run mypy .

Commands

list-collections
create-collection <collection>
delete-collection <collection>
count <collection>
add-data <collection> <file>
query <collection> <query_text>
delete <collection> --where <condition>=<value>

Examples

Create a collection:

chromy create-collection notes

Add a file:

chromy add-data notes ./docs/example.txt

Count stored records:

chromy count notes

Search the collection:

chromy query notes "How do I configure this project?"

List collections:

chromy list-collections

Delete a collection:

chromy delete-collection notes

Delete records by metadata:

chromy delete notes --where file_name=example.txt

How ingestion works

When you run add-data, the file is:

  1. read from disk
  2. split into chunks
  3. embedded
  4. inserted into the target collection with the original file path stored as metadata

Query results include the stored document chunk, its id, distance, and file name when available.

Notes

  • collections are stored in a local persistent Chroma database
  • add-data requires the target collection to already exist
  • the CLI prints friendly messages for common errors such as missing collections or missing files
S
Description
No description provided
Readme 2.2 MiB
Languages
Python 100%