look up strings using semantic search, see cosine similarity between strings.
From PyPI:
pip install semanticliFrom source:
pip install .smnti --help
smnti "Search Me" -f text.txt
cat Alice.txt | smnti "Deck of cards"
smnti -cs 0.6 -c 200 -o 10 -s \n -n "Big Ship" -f treasure.txt-V or --version: Print current version.
--debug: Print debug logs.
-cs or --cos-sim: Cosine similarity greater or equal threshold for printing a match (between 0-1), default is 0.8.
-v or --invert-match: Print anything below the cosine similiarity threshold.
-n or --line: Print file name, line numbers, and similarity.
-s sep_str or --separator sep_str: Separation string to divide with, default is \n\n.
-c size or --chunk size: Chunk size number, might be larger if didn't encounter the separator, default is 4000.
-o size or --chunk-overlap size: Overlap size number between chunks, default is 200.
-lm or --list-models: List installed embedding models.
-m model or --model model: Use specified model for this search only, default is Xenova/all-MiniLM-L6-v2.
-im model or --install-model model: Install specified embeddings model from hugging face.
-rm model or --remove-model model: Uninstall specified model.
note:
SemantiCLI is using ONNX runtime for model inference. it can only install models that have "model.onnx" in their repo at hugginface.
- Clone the repository:
git clone https://github.com/yairzaf/semanticli.git
cd semanticli- Set up development environment:
make dev- Activate the virtual environment:
# Linux/Mac:
source venv/bin/activate
# Windows:
.\venv\Scripts\activatemake help- Show available commandsmake venv- Create virtual environmentmake install- Install package and dependenciesmake dev- Set up development environment (venv + install)make clean- Remove virtual environment and build artifactsmake test- Run testsmake lint- Run linter checksmake format- Format code using blackmake binary-linux- Create standalone Linux binarymake binary-windows- Create standalone Windows binary (requires Wine on Linux/WSL)
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch from develop:
git checkout -b feature/amazing-feature develop- Set up development environment:
make dev-
Make your changes and follow these guidelines:
- Write meaningful commit messages following Conventional Commits
- Add tests for new functionality
- Update documentation as needed
- Follow the existing code style
-
Run tests and linting:
make test
make lint- Push to your fork:
git push origin feature/amazing-feature- Create a Pull Request to the
developbranch
feature/*- New featuresbugfix/*- Bug fixesdocs/*- Documentation changesrefactor/*- Code refactoringrelease/*- Release preparation
feat: add new export command
fix: resolve argument parsing error
docs: update installation guide
test: add unit tests for export feature
refactor: restructure command handling
Clean up your branches:
git checkout develop
git pull origin develop
git branch -d feature/amazing-feature
git push origin --delete feature/amazing-featureCreate standalone executable:
For Linux:
make binary-linux
# Binary will be in dist/semanticliFor Windows (from Linux/WSL):
# Install Wine if needed:
sudo apt-get install wine
make binary-windows
# Binary will be in dist/semanticli.exeThis project is licensed under the MIT License - see the LICENSE file for details.