2.1 KiB
2.1 KiB
SEC - Quick CLI Cheat Sheet & Code Snippet Assistant
Project Purpose
A lightweight, lightning-fast CLI cheat sheet and code snippet assistant powered by the cheat.sh engine, ergonomic sol-el keyboard layout, smart query routing, and optional clipboard integration.
Architectural Decisions
- Name & Ergonomics:
sec(optimized for left-hand QWERTY reachability in dropdown/Quake terminals). - Backend & Engine: Direct live queries to the
cheat.shAPI with smart multi-token routing. - Smart Query Router:
- Strategy 1: Targeted language/tool lookup (
cht.sh/<target>/<query>). - Strategy 2: Global semantic fallback search (
cht.sh/~<query>).
- Strategy 1: Targeted language/tool lookup (
- Offline Exact-Query Cache: Lightweight SQLite or file-based cache for previously fetched queries so repeated lookups work offline.
- Clipboard Integration: Optional
-c/--copyflag to automatically extract and copy executable code blocks to the clipboard. - Centralized UI/String Catalog: Centralized JSON string catalog (
catalog/strings.json). No hardcoded UI strings in code. - Code Standards: Professional English in all code, comments, catalogs, and documentation. No emojis in terminal UI or codebase.
- Manifest & Versioning:
manifest.jsontracking semver, dependencies, and changelog, wired to-V/--version.
Pending Topics & Decisions
- 1. Live API Client & Multi-token Routing: Tilde-based search, candidates fallback chain, error/index suppression.
- 2. Clipboard Dual Mode:
-cfor executable code only,-c afor full response. - 3. Offline SQLite Cache: Automatic caching of valid queries in
data/cache.db. - 4. Deterministic Non-AI Keyword & Intent Engine: Build a purely offline, algorithmic keyword classifier (trie/inverted-index/alias table) that parses freeform user prompts into exact
cheat.shcanonical topics and flags without external AI APIs. - 5. ANSI Rendering & Paging: Optional terminal paging for multi-page cheat sheets.
- 6. Cache Expiration & Invalidation: TTL or explicit cache refresh flags (
--refresh).