sem 🧰
sem (distributed as the sempropos package) is an instant, offline-first CLI replacement for apropos, --help, and man. It indexes every command installed on your machine into a canonical structured ToolSpec representation and gives you fast answers in three modes:
- Synthesize (
sem "..."/Ctrl+S): Turn plain English into a grounded, safety-checked shell command with optional flag-by-flag breakdowns. - Inspect (
sem show <tool> [subcommand]): Instant 0ms-LLM structured cheat-sheet cards replacingmanand--help(usage, subcommands, searchable flags, verified examples). - Discover (
sem search <query>): Instant 0ms-LLM ranked tool search replacingapropos.
✨ Key Features
- Canonical Structured
ToolSpecPipeline: Merges four complementary local sources into one typed, content-hashed SQLite v3 index:- Direct
man(7)/mdoc(7)macro parser (reads compressed.gz/.xz/.bz2/.zstman pages directly from disk, capturing GNU coreutils flags insideDESCRIPTIONand filtering out prose fromEXAMPLES). - Offline
tldr-pagescache/snapshot (task-focused summaries, verified examples, and hyphenated subcommands likegit-commit,docker-run). - Static Fish & Zsh shell completion parsers (zero code execution).
- Safe
--helpprobe for non-man$PATHbinaries (7z,uv,ruff,cargo, custom CLIs) with strict denylist, setuid exclusion, headless env, and hard timeouts.
- Direct
- High-Precision Local Retrieval: Porter-stemmed multi-column SQLite FTS5 (
name,aliases,summary,tags,subcommands,examples,flags), file-extension/artifact hints (.7z,.tar.gz,.json,.service), compound intent matching, and confidence-gated vector recall (fastembed). - Task-Tailored Local Models + Clean External Providers:
- Built-in managed GGUF (
local_gguf): Curated small CLI-tuned models (tiny0.5B,balanced1.5B,quality3B) with JSON-schema grammar constraints viasempropos[local-llm](llama-cpp-python) or standalonellama-server. - Pure-HTTP Ollama & OpenAI-compatible: Zero extra SDKs, structured JSON output, configurable endpoints.
- Tier-0 deterministic mode: Instant zero-LLM example matching and structured ToolSpec cards when offline or unconfigured.
- Built-in managed GGUF (
- Auto-Managed Warm Daemon: Lightweight Unix-domain-socket daemon (
0600private socket) with automatic idle shutdown (15m default) keeps SQLite, embeddings, and local models hot for sub-200ms queries andCtrl+Stransforms—with transparent in-process fallback. - Command Grounding & Safety Warnings: Verifies the executable exists on
$PATH, cross-checks generated flags againstToolSpecto power--explain, and warns clearly oncaution/destructiveoperations (rm -rf,find -delete,dd of=/dev/...,git reset --hard,curl | bash, etc.).
🚀 Quick Start
uv tool install sempropos
sem install # build structured v3 index (man + tldr + completions + safe --help)
Optional: enable built-in local GGUF synthesis without Ollama:
uv tool install "sempropos[local-llm]" # or install llama-server on PATH
sem model install balanced # downloads Qwen2.5-Coder-1.5B (~1 GB) & activates it
📖 Usage
1. Command Synthesis (ask / bare query)
sem "find files larger than 100MB"
sem -e "delete files older than 30 days" # includes flag-by-flag breakdown + safety warning
sem -t tar "extract archive to /tmp" # scope to a single tool
sem -n 3 "sync directory over ssh" # request alternative commands
sem --porcelain "list open listening ports" # raw command only (for scripts/widgets)
sem --json "show disk usage by folder" # full machine-readable output
2. Instant Tool Reference Card (show — replaces man & --help)
sem show du # summary, usage, examples, top flags
sem show du --flags depth # filter flags by keyword
sem show git commit # inspect a specific subcommand
sem show 7z --examples # verified usage examples only
sem show tar --json # export canonical ToolSpec JSON
3. Instant Tool Discovery (search — replaces apropos)
sem search "disk usage by folder"
sem search "listening tcp ports"
sem search "archive" --category archive --limit 15
4. Management & Diagnostics
sem doctor # index health, parse coverage %, unindexed PATH bins, daemon, providers
sem update # incremental content-hash refresh + prune uninstalled binaries
sem model list # list curated GGUF tiers and local runtime status
sem model install tiny # download & activate tiny 0.5B GGUF model
sem daemon status # inspect warm background daemon (start|stop|restart|status)
sem config show # view resolved config.toml (also: config get/set/wizard)
sem providers # check availability of synthesis and embedding backends
sem init zsh # print Ctrl+S integration + tab completions (zsh, bash, fish)
🐚 Shell Integration (Ctrl+S + Tab Completion)
Add one line to your shell startup file:
# ~/.zshrc
eval "$(sem init zsh)"
# ~/.bashrc
eval "$(sem init bash)"
# ~/.config/fish/config.fish
sem init fish | source
Type a plain-English task on your prompt and press Ctrl+S — the line is replaced in place with the generated command (never auto-executed). Tab completion also completes sem subcommands and indexed tool names for sem show <TAB>.
📁 Data & Configuration Layout
- Config:
~/.config/sempropos/config.toml(overridable viaSEMPROPOS_CONFIG_DIR; automatically reads legacyintelligence.toml) - Data:
~/.local/share/sempropos/(overridable viaSEMPROPOS_DATA_DIR)index.db— SQLite v3 + Porter-stemmed FTS5tool_embeddings.npy,tool_embedding_ids.npy—tool_id-keyed L2-normalized tool-card embeddingsindex.meta,last_indexed— atomic revision and staleness markerstldr/— offlinetldr-pagessnapshotmodels/— downloaded local GGUF modelsembeddings/— pinned FastEmbed ONNX model cache
- Runtime socket:
$XDG_RUNTIME_DIR/sempropos/sem.sock(0600, auto-cleaned on idle shutdown)
🧪 Development & Testing
uv sync --group dev
make check-all # ruff lint + format check + strict mypy + pytest (unit, integration, 37-query eval)
All default tests run 100% offline with zero API keys required.
📄 License
MIT License — see LICENSE.
Metadata
Release files for sempropos 1.0.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-1.0.0.tar.gz | 108.6 kB | With provenance | Details for sempropos-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sempropos-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for sempropos-1.0.0-py3-none-any.whl |
Total release size: 233.8 kB
Release files / sempropos-1.0.0.tar.gz
| Download URL | sempropos-1.0.0.tar.gz |
|---|---|
| Size | 108.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4aadd23e4e9af770624636b2259319faf9a22097ea7c4c5bade8ee91b822e998
|
|
BLAKE2b-256 checksum How to use checksums |
83843ae344ffb63c7531f3dcc862b3dc1f28e75212eb439a519bd3428e9ca9b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 23, 2026.
Transparency logRelease files / sempropos-1.0.0-py3-none-any.whl
| Download URL | sempropos-1.0.0-py3-none-any.whl |
|---|---|
| Size | 125.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a08a7358e6ad48b640bfa5cc87647f8de1334c42a3341272cb90df9489665f0
|
|
BLAKE2b-256 checksum How to use checksums |
fb02fd8184c34d096f3f9f4c432e0667b600bdff29f44db553996a5acd1bd400
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 23, 2026.
Transparency logSecurity for sempropos 1.0.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-1.0.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 Nov 23, 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.