Skip to content

tech-sumit/SmartClipboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Smart Clipboard

Smart Clipboard

A native macOS menu-bar clipboard manager. Records every text, image, and file you copy into a local SQLite database; re-paste any of them via the menu bar, a global hotkey picker, or a clip CLI command.

macOS Swift SwiftUI SQLite Latest Release Downloads License

Website Β· Download DMG Β· Features Β· Build from source Β· Design doc


Why

The system clipboard holds one thing. Smart Clipboard remembers everything you've ever copied β€” text, screenshots, files β€” and lets you re-paste any of it without leaving the keyboard.

  • ⚑ Native Swift/SwiftUI β€” single ~5 MB binary, no Electron, no daemon.
  • πŸ” Instant search β€” SQLite FTS5 over thousands of items.
  • ⭐ Star items β€” pins them forever, surfaces them in the menu.
  • ⌨️ Global hotkey β€” default βŒ˜β‡§V, fully rebindable.
  • πŸ–ΌοΈ Images & files β€” full thumbnails, file-reference restore.
  • πŸ› οΈ CLI β€” clip 3 from any terminal pastes the 3rd-most-recent item.
  • ☁️ Cloud backup-by-folder β€” point the JSON export at an iCloud Drive / Dropbox / Google Drive folder.

Install

One-line install (recommended)

curl -fsSL https://raw.githubusercontent.com/tech-sumit/SmartClipboard/main/scripts/install.sh | bash

Downloads the latest DMG, copies the app to /Applications, removes the macOS quarantine flag, and launches it. No Gatekeeper dialog.

Manual DMG install

  1. Download SmartClipboard-x.y.z.dmg from the latest release.
  2. Open the DMG and drag Smart Clipboard into the Applications shortcut.
  3. First launch β€” because the DMG is ad-hoc signed (no Apple Developer ID notarization), macOS Gatekeeper will say "Apple could not verify Smart Clipboard is free of malware". To bypass:
    • macOS 14 Sonoma or earlier: right-click the app in /Applications β†’ Open β†’ Open in the dialog.
    • macOS 15 Sequoia and later: double-click (you'll get the warning), then go to System Settings β†’ Privacy & Security β†’ scroll to "Smart Clipboard was blocked" β†’ Open Anyway, enter your password.
    • Or from a terminal (any macOS version):
      xattr -dr com.apple.quarantine /Applications/SmartClipboard.app
      open /Applications/SmartClipboard.app
  4. Look for the clipboard glyph in your menu bar.

Why the friction? Apple requires a paid Apple Developer Program membership ($99/year) plus notarization for a frictionless install. The current release DMG is ad-hoc signed only. Notarized release is on the roadmap.

Build from source

You need Xcode 14+ and XcodeGen.

brew install xcodegen
git clone https://github.com/tech-sumit/SmartClipboard.git
cd SmartClipboard
xcodegen generate
open SmartClipboard.xcodeproj   # then ⌘R

…or fully from the command line:

xcodebuild -project SmartClipboard.xcodeproj \
           -scheme SmartClipboard \
           -configuration Release \
           -derivedDataPath .build build
cp -R .build/Build/Products/Release/SmartClipboard.app /Applications/
open /Applications/SmartClipboard.app

First-Run Permissions

The app needs two macOS permissions for full functionality:

Permission Why Triggered by
Accessibility Synthesize ⌘V into the focused app on Enter Settings β†’ Permissions β†’ "Request"
Input Monitoring Global hotkey (βŒ˜β‡§V) First time the hotkey fires

Without Accessibility, the picker still works β€” it just restores items to the clipboard so you can press ⌘V yourself.


Features

Menu bar dropdown

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Smart Clipboard                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Open Picker  βŒ˜β‡§V                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Starred                         β”‚
β”‚ β˜… TODO: refactor auth module    β”‚
β”‚ β˜… git rebase -i HEAD~5          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Recent                          β”‚
β”‚ 1  https://news.ycombinator.com β”‚
β”‚ 2  πŸ“· Image 1920Γ—1080           β”‚
β”‚ 3  πŸ“‚ Screenshot 2026-05-24.png β”‚
β”‚ 4  npm run dev                  β”‚
β”‚ 5  ssh me@10.0.0.42             β”‚
β”‚ …                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Clear Unstarred History         β”‚
β”‚ Settings…                  ⌘,   β”‚
β”‚ Quit Smart Clipboard       ⌘Q   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Click any item β†’ restores it AND pastes into the previously focused app.
  • Option-click β†’ restore only (no paste).
  • Top 9 items get ⌘1 … ⌘9 hotkeys inside the menu.

Global hotkey picker (βŒ˜β‡§V)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ πŸ” git rebase                              42    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ πŸ“„ git rebase -i HEAD~5         TEXT  iTerm 2m   β”‚
β”‚ πŸ“„ git rebase --autostash       TEXT  iTerm 8m   β”‚
β”‚ πŸ“„ git rebase --onto main …     TEXT  Code  1h   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ↩ Paste   βŒ₯↩ Copy only   βŽ‹ Close  ⌘F ⭐  ⌘⌫ βœ•    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Spotlight-style search (SQLite FTS5, fuzzy prefix match on text + file names).
  • ↑ / ↓ navigate, ↩ paste, βŒ₯↩ copy without pasting.
  • ⌘F star/unstar, ⌘⌫ delete, βŽ‹ close.
  • Non-activating panel β€” the app you came from keeps keyboard focus.

clip command-line tool

$ clip list
1  42  β˜…  TODO: refactor auth module
2  41     git rebase -i HEAD~5
3  39     https://news.ycombinator.com
4  38     npm run dev
…

$ clip search rebase
1  41     git rebase -i HEAD~5
2  37     git rebase --autostash

$ clip 2
# pastes "git rebase -i HEAD~5" into the current terminal

Install from Settings β†’ CLI β†’ Install (symlinks to /usr/local/bin/clip, or ~/bin/clip if the former isn't writable).

Backup & cloud sync (via folder)

  • Settings β†’ Backup β†’ Choose folder picks a destination.
  • Export Now writes smartclipboard-backup.json (streamed β€” won't OOM with thousands of images).
  • Auto-export: rewrites the file 30 s after the last clipboard change.
  • For free cloud sync, point the folder at:
    • ~/Library/Mobile Documents/com~apple~CloudDocs/ β†’ iCloud Drive
    • ~/Dropbox/SmartClipboard/ β†’ Dropbox
    • ~/Google Drive/SmartClipboard/ β†’ Google Drive

How it works

Architecture

flowchart LR
    classDef ext fill:#f4f4f8,stroke:#999,stroke-dasharray:3 3,color:#222
    classDef core fill:#eef0ff,stroke:#5E63FF,color:#1d1d1f
    classDef store fill:#dde0ff,stroke:#3437C9,stroke-width:2px,color:#1d1d1f

    PB["NSPasteboard<br/>(system clipboard)"]:::ext
    KEY["βŒ˜β‡§V hotkey"]:::ext
    CLI["clip CLI"]:::ext
    SI["NSStatusItem<br/>(menu bar)"]:::ext
    APP["Focused app"]:::ext
    DB[("SQLite + FTS5<br/>~/Library/Application Support/")]:::ext
    CLOUD[("Folder<br/>iCloud / Dropbox / Drive")]:::ext

    subgraph SC ["SmartClipboard.app β€” single process, LSUIElement"]
        CM["ClipboardMonitor<br/>0.5s poll"]:::core
        HM["HotkeyManager<br/>Carbon RegisterEventHotKey"]:::core
        UH["URLSchemeHandler<br/>smartclipboard://..."]:::core
        MC["MenuBarController<br/>NSMenu rendering"]:::core
        PP["PickerPanel<br/>non-activating NSPanel"]:::core
        PA["Paster<br/>CGEventPost ⌘V"]:::core
        BM["BackupManager<br/>streamed JSON"]:::core
        CR{{"ClipRepository<br/>CRUD + dedup + FTS5"}}:::store
    end

    PB -- "poll changeCount" --> CM --> CR
    KEY --> HM --> PP --> CR
    CLI -- "open URL" --> UH --> CR
    SI --> MC --> CR
    PP --> PA --> APP
    CR <--> DB
    CR --> BM --> CLOUD
Loading

Capture-and-paste flow

sequenceDiagram
    autonumber
    actor U as You
    participant SP as System Pasteboard
    participant CM as ClipboardMonitor
    participant DB as SQLite + FTS5
    participant HK as HotkeyManager
    participant PP as PickerPanel
    participant PR as Paster
    participant App as Focused app

    rect rgba(94,99,255,0.08)
    Note over U,App: Capture (continuous)
    U->>SP: ⌘C (copy)
    CM->>SP: poll every 500 ms
    CM->>CM: payload != self-write fingerprint?
    CM->>DB: INSERT (dedup against latest row)
    end

    rect rgba(94,99,255,0.08)
    Note over U,App: Recall + paste
    U->>HK: βŒ˜β‡§V
    HK->>PP: show() β€” capture frontmost app
    PP->>DB: FTS5 search as you type
    DB-->>PP: matching ClipItems
    U->>PP: ↩ on item
    PP->>PR: restoreAndPaste(item, activating: App)
    PR->>CM: mark own write (fingerprint)
    PR->>SP: clearContents + setString/Image
    PR->>App: activate
    Note over PR,App: poll isActive up to 200 ms
    PR->>App: CGEventPost ⌘V
    App->>SP: read content
    end
Loading

Implementation notes

  • Storage: ~/Library/Application Support/SmartClipboard/clipboard.sqlite (single file, WAL-mode SQLite + FTS5 virtual table).
  • Dedup: identical-to-previous payload bumps created_at instead of inserting.
  • Self-write suppression: when we restore an item, the monitor records a fingerprint and skips it on the next poll.
  • No daemon: the clip CLI calls open smartclipboard://... β€” the running app handles the URL via NSApplicationDelegate.application(_:open:).
  • Streamed backup: auto-export reads rows 50 at a time and writes incrementally to a temp file, then atomically renames β€” peak memory stays small even with thousands of multi-MB images.

Known Tradeoffs

  • Captures everything, including passwords copied from password managers. Items flagged org.nspasteboard.ConcealedType are not filtered. The SQLite DB is unencrypted at rest. Don't auto-export to a public folder.
  • Unlimited history β€” storage grows over time. Use Settings β†’ Data β†’ Clear unstarred to prune.
  • The release DMG is ad-hoc signed, not Developer-ID-notarized. macOS Gatekeeper will refuse a normal double-click; right-click β†’ Open the first time.

Manual Test Checklist

  • Copy text from anywhere β†’ appears in menu bar dropdown.
  • Copy an image (βŒ˜β‡§4) β†’ appears with thumbnail.
  • Copy files in Finder β†’ appears with folder icon.
  • βŒ˜β‡§V β†’ picker opens; previous app keeps focus.
  • Type to search; ↑↓ to navigate; ↩ pastes into the previously focused app.
  • βŒ₯↩ β†’ copies without pasting.
  • ⌘F β†’ star/unstar; ⌘⌫ β†’ delete.
  • Quit & relaunch β†’ history persists, hotkey re-registers.
  • Settings β†’ rebind hotkey β†’ new hotkey works immediately.
  • Settings β†’ Backup β†’ Choose folder β†’ Export Now β†’ JSON appears.
  • Settings β†’ CLI β†’ Install β†’ clip list prints items.
  • clip 1 pastes the most-recent item into the terminal.

Project layout

SmartClipboard/
β”œβ”€β”€ project.yml                       # XcodeGen config
β”œβ”€β”€ docs/superpowers/specs/           # design doc
β”œβ”€β”€ assets/                           # icon SVG + iconset + icns
β”œβ”€β”€ bin/clip                          # CLI shell script
└── SmartClipboard/
    β”œβ”€β”€ SmartClipboardApp.swift       # @main, AppDelegate
    β”œβ”€β”€ AppState.swift                # ObservableObject
    β”œβ”€β”€ Preferences.swift             # UserDefaults wrapper
    β”œβ”€β”€ CLIInstaller.swift            # /usr/local/bin/clip symlink
    β”œβ”€β”€ Models/ClipItem.swift
    β”œβ”€β”€ Storage/Database.swift        # GRDB + migrations + FTS5
    β”œβ”€β”€ Storage/ClipRepository.swift  # CRUD + search + dedup
    β”œβ”€β”€ Clipboard/ClipboardMonitor.swift
    β”œβ”€β”€ Clipboard/Paster.swift
    β”œβ”€β”€ Hotkey/HotkeyManager.swift    # Carbon RegisterEventHotKey
    β”œβ”€β”€ URLScheme/URLSchemeHandler.swift
    β”œβ”€β”€ Permissions/PermissionsHelper.swift
    β”œβ”€β”€ Backup/BackupManager.swift    # streamed JSON export
    └── UI/
        β”œβ”€β”€ MenuBarController.swift
        β”œβ”€β”€ PickerPanel.swift         # non-activating NSPanel
        β”œβ”€β”€ PickerView.swift
        β”œβ”€β”€ ItemRow.swift
        └── SettingsView.swift

Roadmap (v2 ideas)

  • CloudKit sync of starred items across Macs.
  • Native Google Drive (OAuth + Drive API) sync.
  • Optional rich-text / RTF capture.
  • Categories / tags / snippet templates.
  • Opt-in ConcealedType filtering.
  • AES-encrypted DB at rest with passphrase.
  • Developer-ID-signed & notarized DMG.

License

MIT. See LICENSE.

Credits

About

A native macOS menu-bar clipboard manager. SQLite-backed history, global hotkey picker, clip CLI, and folder-based cloud backup.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors