sem 🧰
sem (distributed as the sempropos package) is an open-source, local,
offline-first CLI tool that turns a natural-language task description into a
shell command. It retrieves relevant context from your system's local man pages
and synthesizes the output using a local model.
Say goodbye to complex web searches just to find the right flag — sem keeps it
entirely on your machine.
✨ Features
- Privacy First, Offline First: No API keys, no telemetry, no cloud backend required. Run entirely on your machine.
- Local SQLite Index: Fast retrieval of man pages (sections 1 and 8).
- Semantic Retrieval: BM25-primary hybrid ranking with an exact-tool-name boost. Embedding similarity adds recall and breaks exact ties, so a weak embedding match can never outrank a confident lexical one.
- Fast local inference: Uses Ollama (with reasoning disabled and the model kept warm) for near-instant answers, and falls back to showing matched man pages when no model is available.
- Pluggable providers: Ollama out of the box, plus any OpenAI-compatible endpoint (vLLM, LM Studio, llama.cpp server, a gateway…). More providers are on the way.
- Shell integration: Press
Ctrl+Sto turn the natural-language sentence you just typed into a command, in place. - Smart staleness checks: Detects when your package manager updates software and gently prompts an index refresh.
🚀 Quick Start
Install with uv (recommended)
uv tool install sempropos
sem install # check requirements, download the embedding model, build the index
Install from source
git clone https://github.com/ADPer0705/sempropos.git
cd sempropos
uv venv && uv sync
uv run sem install
sem install writes a default configuration, downloads the embedding model into
the local data directory (so it works offline afterwards), and builds the index.
If Ollama is running it is selected as the synthesis backend; otherwise sem
still works and falls back to showing matched man pages.
📖 Usage
The Main Query
Describe what you want to do in natural language. A bare query works, and ask
is available when you want to be explicit:
sem "list files in archive.7z"
sem ask "find all files larger than 100MB"
sem ask "monitor network traffic on eth0"
If it succeeds, you'll be handed the correct shell invocation instantly.
Commands
Management is done with subcommands, not flags:
sem install # First-time setup: check requirements, write config, build the index
sem update # Refresh the index with newly installed tools (incremental)
sem check # Check index freshness and completeness
sem configure # Choose synthesis/embedding providers interactively
sem providers # List providers and whether they are available
sem init zsh # Print shell integration for zsh (also: bash, fish)
sem version # Print the version
🐚 Shell integration (Ctrl+S)
Add one line to your shell rc, then reload it:
# ~/.zshrc (or ~/.bashrc; use `sem init fish` for fish)
eval "$(sem init zsh)"
Now, instead of running sem as a separate command, type the natural-language
task directly on your prompt and press Ctrl+S. The line is replaced in place
with the generated command, ready to review and run:
❯ find all files larger than 100MB # press Ctrl+S
❯ find . -type f -size +100M
Notes:
- The snippet runs
stty -ixon, which freesCtrl+Sfrom the terminal's XOFF/flow-control behavior. If your terminal still intercepts it, you can re-bind a different key (for example^G) by editing thebindkey/bindline. Ctrl+R(history) andCtrl+T(files) are left to fzf;semonly addsCtrl+S.- The command is inserted, never executed — you always get the final say.
🧠 Backend behavior
Synthesis backend selection order per query:
- Ollama if the daemon is reachable, using the configured model.
- OpenAI-compatible endpoint if one is configured (
base_url). - tier0 fallback: retrieved tools, key flags, and examples, with no LLM.
To keep queries fast, Ollama is called with reasoning/thinking disabled, a
temperature of 0, a bounded output length, and a long keep_alive so the
model stays warm between invocations. sem install / update warm the model
once so your first real query is not the one paying the load cost.
The default recommendation is a small instruct model (see
RECOMMENDED_SYNTHESIS_MODEL) that stays fast on most consumer hardware while
remaining capable when grounded by retrieved man-page context. sem configure
lets you opt into a larger model or a remote endpoint.
When your package database changes since the last index, sem prints a
non-blocking warning so you know it's time to run sem update.
📁 Data Layout
Default location for data assets:
~/.local/share/sempropos/
index.db
tool_embeddings.npy
tool_embedding_ids.npy
index.meta
last_indexed
embeddings/ # pinned embedding-model cache (kept for offline use)
Flag ranking uses the SQLite FTS5 index, so no flag embedding files are needed.
Override the data location with:
export SEMPROPOS_DATA_DIR=/path/to/sempropos-data
🤝 Contributing
We welcome contributions from everyone! Whether you're fixing bugs, adding new
features, or improving documentation, your help makes sem better for the
entire community.
Please read our CONTRIBUTING.md for conventions on pull requests, code style, and reporting issues.
🗺️ Roadmap
Known gaps and planned work live in ROADMAP.md. It is kept short and concrete — a good place to find a first contribution.
🧪 Testing & Quality
Tests are being rebuilt. Until the suite returns, CI installs the package and verifies that every module imports cleanly on Python 3.11–3.13.
The quality policy for this repository remains:
- Running the tool must never require an API key.
- Provider integration tests are mocked/offline by default for deterministic CI runs.
- Optional live provider smoke checks are local-only and guarded by explicit env vars/markers.
Local checks:
make lint # ruff (when development dependencies are installed)
make format # ruff format + autofix
📄 License
This project is licensed under the MIT License.
💬 Community & Support
- If you found a bug or have a feature request, please open an issue.
- Want to chat or ask a question? Join the discussion on GitHub Discussions.
Metadata
Release files for sempropos 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sempropos-0.3.0.tar.gz | 49.3 kB | With provenance | Details for sempropos-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sempropos-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for sempropos-0.3.0-py3-none-any.whl |
Total release size: 104.6 kB
Release files / sempropos-0.3.0.tar.gz
| Download URL | sempropos-0.3.0.tar.gz |
|---|---|
| Size | 49.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68824bcb691c59e1f2e7c6423dd22667d11943cdd4df98259bbb7b29349cbdeb
|
|
BLAKE2b-256 checksum How to use checksums |
99f6844c0ac0e6ff23756c0d04c9fde482550622342c4641eb785d3496c6716f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / sempropos-0.3.0-py3-none-any.whl
| Download URL | sempropos-0.3.0-py3-none-any.whl |
|---|---|
| Size | 55.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
344343f0946d3183d6b23ed0ff57e01202108591f36721ba147c975ef28da02f
|
|
BLAKE2b-256 checksum How to use checksums |
948d33a623f6501e1b171b286cba34e1c1a2bf200cc2961ba5a8528131b80b73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logSecurity for sempropos 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sempropos-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.