β‘ Lightning-fast offline knowledge engine for developers.
Store commands, snippets, SQL queries, troubleshooting notes, and engineering knowledge in a local SQLite database with blazing-fast Full-Text Search.
Every developer builds a personal knowledge base over time.
Git commands.
Docker snippets.
SQL queries.
Terraform modules.
AWS CLI commands.
Kubernetes manifests.
Debugging notes.
Configuration snippets.
Unfortunately, that knowledge usually ends up scattered across multiple places:
- Markdown files
- Notion
- Obsidian
- Browser bookmarks
- GitHub Gists
- Terminal history
- Sticky notes
Finding something later often means opening multiple files and repeatedly pressing Ctrl + F.
kb replaces that workflow with a fast, offline knowledge engine powered by SQLite FTS5, giving you instant full-text search across everything you've saved.
No cloud. No subscriptions. Just your knowledge, indexed locally.
kb is designed to be a fast, keyboard-first knowledge engine that lives entirely on your machine.
| Feature | Description |
|---|---|
| β‘ SQLite FTS5 Search | Lightning-fast full-text search across all knowledge |
| π· Categories & Tags | Organize snippets by category and searchable tags |
| β Favorites | Mark frequently used snippets for quick access |
| π Interactive Fuzzy Search | Browse your knowledge base with an fzf powered interface |
| π₯ Interactive Shell | Persistent history, tab completion, aliases and REPL mode |
| π Clipboard Support | Copy snippets directly to your clipboard |
| π Import & Export | Import Markdown/TXT and export to Markdown or JSON |
| π Statistics | View usage statistics and most accessed snippets |
| π¨ Rich Terminal Output | Colorized output for a better CLI experience |
| πΎ Offline First | No cloud account, internet connection or external services required |
| π§ Cross Platform | Works on macOS and Linux |
- Python 3.10+
- SQLite (included with Python)
fzf(optional but recommended for the interactive search interface)
pip install kb-cliVerify the installation
kb --versionExample output
kb version 0.2.0
brew install fzfsudo apt install fzfbat provides syntax highlighted previews inside the interactive search interface.
brew install batsudo apt install batπ§ Homebrew support is planned for a future release.
Initialize your local knowledge database
kb initSave your first snippet
kb add git "git status" \
-t "Git Status" \
--tags git,statusSearch your knowledge
kb find gitBrowse everything interactively
kb fzfLaunch the interactive shell
kbView statistics
kb statsYou're ready to start building your personal offline knowledge base.
| Command | Description |
|---|---|
kb init |
Initialize the local knowledge database |
kb add |
Add a new knowledge entry |
kb list |
List stored entries |
kb find |
Perform full-text search using SQLite FTS5 |
kb get |
Retrieve a snippet by ID |
kb edit |
Edit an existing entry |
kb delete |
Delete an entry |
kb favorite |
Mark or unmark an entry as a favorite |
kb recent |
Show recently accessed entries |
kb stats |
Display database statistics |
kb import |
Import Markdown or TXT files |
kb export |
Export the knowledge base to Markdown or JSON |
kb copy |
Copy a snippet directly to the clipboard |
kb fzf |
Launch the interactive fuzzy finder |
Save a useful Git command
kb add git \
"git rebase -i HEAD~3" \
-t "Interactive Rebase" \
--tags git,rebaseSearch it later
kb find rebaseStore Docker Compose commands
kb add docker \
"docker compose up -d" \
-t "Start Containers" \
--tags docker,composeSave frequently used SQL queries
kb add sql \
"SELECT * FROM users WHERE active = TRUE;" \
-t "Active Users" \
--tags postgres,sqlSave AWS commands
kb add aws \
"aws s3 sync ./dist s3://my-bucket" \
-t "Upload Build Artifacts"Store kubectl commands
kb add kubernetes \
"kubectl logs deployment/api -f" \
-t "Follow Deployment Logs"Save infrastructure commands
kb add terraform \
"terraform state list" \
-t "List Terraform Resources"SQLite FTS5 searches titles, content and tags.
kb find terraform
kb find docker compose
kb find postgres
kb find eksLaunch the interactive fuzzy finder
kb fzfFeatures include:
- Live fuzzy filtering
- Instant preview
- Clipboard copy
- Keyboard-first workflow
- tmux popup support
- Optional syntax-highlighted previews with
bat
Launch the built-in REPL
kbExample session
kb β― add
kb β― find docker
kb β― get 12
kb β― favorite 12
kb β― recent
kb β― stats
kb β― exit
The interactive shell supports:
- Persistent command history
- Tab completion
- Command aliases
- Colored prompt
- Keyboard-first workflow
Export everything as Markdown
kb export markdown notes.mdExport as JSON
kb export json knowledge.jsonImport a Markdown document
kb import notes.mdImport a plain text file
kb import commands.txtkb follows a simple layered architecture to keep the codebase modular, maintainable, and easy to extend.
User
β
βΌ
kb CLI Interface
β
βΌ
Command Layer (CLI Commands)
β
βΌ
Service / Business Logic
β
βΌ
Repository (SQLite)
β
βΌ
SQLite Database (FTS5)
β
βΌ
Local File System
kb-cli/
βββ kb/
β βββ commands/ # CLI commands
β βββ repositories/ # SQLite queries
β βββ services/ # Business logic
β βββ models/ # Data models
β βββ utils/ # Helpers & formatting
β βββ shell.py # Interactive shell
β βββ shell_commands.py # Interactive shell commands
β βββ database.py
β βββ config.py
β βββ cli.py
β
βββ tests/
βββ assets/
βββ README.md
βββ pyproject.toml
βββ LICENSE
| Component | Technology |
|---|---|
| Language | Python 3.10+ |
| Database | SQLite |
| Search Engine | SQLite FTS5 |
| Interactive Search | fzf |
| Syntax Highlighting | bat (optional) |
| Testing | Pytest |
| Linting | Ruff |
| Packaging | setuptools |
| CI/CD | GitHub Actions |
- SQLite FTS5 Full-Text Search
- Interactive Shell
- Interactive Fuzzy Search (
fzf) - Clipboard Support
- Rich Terminal Output
- Categories & Tags
- Favorites
- Import / Export
- Usage Statistics
- Shell Completion
- PyPI Package
- GitHub Actions CI
- Homebrew Installation
- Search Result Highlighting
- Rich Metadata Preview
- Multi-select in
fzf - YAML Import / Export
- Config Profiles
- Plugin System
- Encrypted Database
- Optional Cloud Sync
- Custom Themes
- AI-assisted Search
Contributions are welcome!
If you'd like to improve kb, follow these steps:
git clone https://github.com/Hrithik5/kb-cli.git
cd kb-cli
pip install -e .
ruff check .
pytestBefore opening a Pull Request, please ensure:
- Code is formatted
- Ruff passes without errors
- All tests pass
- New features include tests where appropriate
Bug reports, feature requests, and pull requests are always appreciated.
See the full project history in CHANGELOG.md.
This project is licensed under the MIT License.
See the LICENSE file for details.
If you find kb useful, consider giving the repository a β on GitHub.
It helps others discover the project and motivates future development.
Built for developers who believe great tools should be fast, local, and simple.

