sempropos
Instant offline CLI replacement for apropos, --help, and man pages
Downloads & Community Adoption
Health & Engineering Analysis (5 Pillars)
1. Governance & Community100 / 200 ▾
2. PEP Metadata & Packaging200 / 200 ▾
3. Security & Supply Chain200 / 200 ▾
4. Documentation, SEO & Ecosystem105 / 200 ▾
5. Engineering, CI & Quality200 / 200 ▾
Official Documentation & Usage Guide — sempropos
Show full original documentation (English README) ▾
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.