v2.0.5 · Go · MIT License

Search commands.
Ask AI.
Ship faster.

An AI-powered command knowledge base with interactive CLI, web UI, and semantic vector search. Store, find, and understand commands — your way.

Download Binary Quick Start →
scmd --cli
scmd> show me postgresql replication examples
⟳ Extracting keywords: postgresql replication
⟳ Searching database... found 3 results (score: 85%)
━━━ AI-Enhanced Results ━━━━━━━━━━━━━━━━━━━━━━━━━
ID:42 - PostgreSQL streaming replication setup
pg_basebackup -h master -D /var/lib/postgresql/data -U replicator -Fp -Xs -P
scmd>
3
Interfaces
2
AI Providers
2
Database Backends
13
Slash Commands
5
Platforms
1
Single Binary

Why SCMD?

A single binary that replaces bookmarks, wikis, and scattered notes for your command-line knowledge.

🔍

Smart Search Pipeline

Keyword search → intelligent scoring → vector similarity → AI fallback. Always finds what you need, even with vague queries.

🤖

Dual AI Providers

Ollama for local/private inference, Google Gemini for cloud power. Automatic fallback between providers. Separate chat and embedding models.

🧠

Semantic Vector Search

pgvector embeddings for PostgreSQL, cosine similarity for SQLite. Understands meaning, not just keywords. Configurable dimensions (384, 768+).

💻

Three Interfaces

Interactive CLI with slash commands, traditional scriptable CLI with JSON output, and a full web UI with syntax highlighting and auth.

🗄️

PostgreSQL + SQLite

Enterprise PostgreSQL with pgvector for teams, or lightweight SQLite for personal use. Interactive setup wizards for both.

🔒

Secure by Default

SSL/TLS, session-based auth with 24h expiry, HTTP-only cookies, read-only mode, and SameSite protection for the web UI.

AI-Powered Search Pipeline

Every query flows through an intelligent multi-stage pipeline that always finds the best answer.

01 User Query ───────────────────────────────────
02 → NLP Keyword Extraction (stop-word removal)
03 → PostgreSQL ILIKE Search (AND/OR pattern matching)
04 → Score & Rank Results (word-match percentage)
05 → Score ≥ 60%? ✓ Return ranked results
06 → Score < 60%? → Vector Similarity Search (pgvector/cosine)
07 → Still low? → Pure AI Chat Response (Ollama/Gemini)
🦙

Ollama

LOCAL
  • ✦ Self-hosted, privacy-first
  • ✦ No API costs
  • ✦ Chat + embedding models
  • ✦ Configurable host & port

Google Gemini

CLOUD
  • ✦ High-quality responses
  • ✦ Free tier: 1,500 req/day
  • ✦ Chat + embedding models
  • ✦ Automatic fallback

Three Ways to Search

Pick the interface that fits your workflow.

01

Interactive CLI

scmd --cli
# Natural language queries
scmd> show me docker compose examples
# Slash commands
scmd> /search kubernetes deployment
scmd> /add "git stash pop" "Restore stashed changes"
scmd> /ai
✓ Ollama (host: localhost, model: ministral-3:3b)
scmd> /import ./runbook.md
✓ Imported: "Production Runbook" (with embeddings)
/search /add /list /count /delete /show /help /import /run /ai /config /embeddings /generate
02

Traditional CLI

scmd --search
# AND logic — all words must match
$ scmd --search "postgresql replication slave"
# OR logic — any pattern matches
$ scmd --search "docker,kubernetes,terraform"
# Save a new command
$ scmd --save "docker ps -a" "List all containers"
# Import markdown docs
$ scmd --import ./disaster-recovery.md
# Export to JSON
$ scmd --copydb backup.json
03

Web UI

scmd --web
$ scmd --web # port 3333, opens browser
$ scmd --web -port 8080 # custom port
$ scmd --web -port 8080 -service # headless mode
$ scmd --web -block # read-only mode
$ scmd --ssl cert.pem key.pem # HTTPS

Real-time search, syntax highlighting, AI explanations, session auth, duplicate detection, and markdown rendering — all in the browser.

Pick Your Database

🐘 PostgreSQL

TypeClient-server
Vector Searchpgvector
Multi-user✓ Yes
Setup--create-db-postgresql
Best forTeams & enterprise

📦 SQLite

TypeFile-based
Vector SearchGo cosine sim
Multi-user✗ Single
Setup--create-db-sqlite
Best forPersonal & offline

Built For Real Workflows

devops
Command Library
Docker, K8s, Terraform, Ansible — all searchable in one place.
team
Knowledge Base
Shared PostgreSQL backend for team-wide command reference and onboarding.
docs
Documentation Hub
Import markdown runbooks and SOPs, search with natural language.
ai
AI-Assisted Learning
Ask natural language questions, get AI explanations with real command context.
incident
Incident Response
Quickly find recovery commands during outages. Seconds matter.
offline
Air-Gapped Environments
SQLite + Ollama for fully offline, private, zero-dependency operation.
automation
CI/CD Integration
Script-friendly CLI with JSON output for pipeline automation.
snippets
Code Snippet Manager
Store reusable code blocks for any language with syntax highlighting.

Get Started in 60 Seconds

1

Download or build

# Download pre-built binary (Linux example)
$ curl -LO https://github.com/gcclinux/scmd/releases/latest/download/scmd-Linux-x86_64
$ chmod +x scmd-Linux-x86_64
# Or build from source
$ git clone https://github.com/gcclinux/scmd.git && cd scmd
$ go build -o scmd ./cmd/scmd/
# Or use Docker
$ docker run -p 8080:8080 gcclinux/scmd:latest --web -port 8080 -service
2

Configure

$ mkdir -p ~/.scmd
$ cp config.json.example ~/.scmd/config.json
# Or use the interactive setup wizards:
$ scmd --create-db-postgresql # or --create-db-sqlite
$ scmd --server-ollama # or --server-gemini
3

Search

$ scmd --cli # interactive mode
$ scmd --search "docker,kubernetes" # quick search
$ scmd --web # web UI

Available Platforms

🪟 Windows AMD64
🐧 Linux AMD64
🐧 Linux ARM64
🍎 macOS Intel
🍎 macOS ARM64
🐳 Docker

Architecture

┌─────────────────────────────────────────────────┐
                 SCMD v2.0.5                   
├─────────────┬──────────────┬────────────────────┤
 Interactive   Traditional       Web UI         
 CLI           CLI            (HTTP/HTTPS)      
├─────────────┴──────────────┴────────────────────┤
              Core Engine                        
  ┌──────────┐ ┌──────────┐ ┌──────────────────┐ 
   Search   │ │ Scoring  │ │ Keyword Extract   
   Engine   │ │ System   │ │ (NLP)             
  └──────────┘ └──────────┘ └──────────────────┘ 
├──────────────────────────────────────────────────┤
              AI Layer                           
  ┌──────────────────┐ ┌───────────────────────┐ 
   Ollama (Local)   │ │ Gemini (Cloud)         
   Chat + Embedding │ │ Chat + Embedding       
  └──────────────────┘ └───────────────────────┘ 
├──────────────────────────────────────────────────┤
              Data Layer                         
  ┌──────────────────┐ ┌───────────────────────┐ 
   PostgreSQL       │ │ SQLite                 
   + pgvector       │ │ + cosine similarity    
  └──────────────────┘ └───────────────────────┘ 
└──────────────────────────────────────────────────┘