From 1e72f44f28b97ef3f28627421bedca379d136a76 Mon Sep 17 00:00:00 2001 From: twells46 <173561638+twells46@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:40:57 -0500 Subject: Long-running --- README.md | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 534001e..65f5a36 100644 --- a/README.md +++ b/README.md @@ -7,22 +7,48 @@ Local command-helper retrieval system using JSONL, SQLite, and sentence-transfor ```sh export HF_HOME="$PWD/models/hf" export SENTENCE_TRANSFORMERS_HOME="$PWD/models/hf" -python -m venv venv +python -m venv .venv source .venv/bin/activate pip install -U pip pip install -r requirements.txt -python scripts/init_db.py -python scripts/build_index.py +python init_db.py +python build_index.py ``` Then run a query like this: ```sh -python scripts/query_index.py "get free disk space" +python query_index.py "get free disk space" ``` To add commands, add to `./cards.jsonl` and rebuild the index: ```sh -python scripts/build_index.py +python build_index.py +``` + +For fast repeated queries, start the Unix-socket server once in another terminal: + +```sh +python query_index.py --serve +``` + +Then keep using the same query command: + +```sh +python query_index.py "get free disk space" +``` + +To run the server in the background: + +```sh +nohup python query_index.py --serve >/tmp/cheat.log 2>&1 & +``` + +Useful controls: + +```sh +python query_index.py --status +python query_index.py --reload +python query_index.py --stop ``` -- cgit v1.2.3