Skip to content

DoctorC0de/Copopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copopy

Copy + Explain — your AI-powered macOS clipboard companion.

Select text, press ⌘⌥C, and Copopy explains it instantly in a floating Markdown window — powered by DeepSeek.


Features

  • ⌘⌥C Hotkey — select text anywhere, press ⌘⌥C, get an AI explanation
  • Simulated Keystrokes — explicitly copies selection to clipboard via simulated ⌘C
  • Floating Markdown Panel — styled code blocks, headings, lists, links, adaptive height
  • Menu Bar App — lives in your menu bar, zero Dock clutter
  • Customizable Prompt — tailor the AI's explanation style
  • DeepSeek V4 — choose Flash (fast) or Pro (deep reasoning)
  • Secure Storage — API key stored in macOS Keychain
  • Native macOS 15+ — SwiftUI + AppKit, ad-hoc signed

Requirements

Component Version
macOS 15.0 Sequoia or later
DeepSeek API Key Get one here
Accessibility Permission Required for ⌘⌥C to simulate Cmd+C and read clipboard

Installation

Download (Recommended)

Grab the latest Copopy-v1.0.dmg from Releases, open it, and drag Copopy.app into Applications.

First launch: right-click the app → Open (to bypass Gatekeeper for ad-hoc signed builds).

Build from Source

git clone https://github.com/your-org/Copopy.git
cd Copopy

# Build, sign, and package
make dist

# Outputs:
#   Copopy.app          — runnable app
#   Copopy-v1.0.dmg     — distribution image
#   Copopy-v1.0.zip     — distribution archive

> **Important**: Recompiling via `make app` generates a new ad-hoc signature hash. You **must** remove and re-add Copopy in System Settings → Privacy & Security → Accessibility every time you recompile, otherwise the ⌘⌥C simulation will silently fail.

Setup

  1. Launch Copopy — look for the icon in your menu bar
  2. Grant Accessibility permission: System Settings → Privacy & Security → Accessibility → enable Copopy
  3. Click Preferences… (⌘,)
  4. Paste your DeepSeek API Key
  5. Choose model: V4 Flash (fast) or V4 Pro (deep)
  6. Click Test Connection to verify

Usage

Trigger How
⌘⌥C Select text in any app → press ⌘⌥C → explanation panel appears
Menu Bar Click menu bar icon → "Explain Clipboard"

Panel Shortcuts

Action Shortcut
Copy result ⌘C or click "Copy Result"
Regenerate ⌘↵ or click "Regenerate"
Close panel ⌘W / Esc / click ×
Dismiss Click anywhere outside the panel

Configuration

All settings take effect immediately.

Setting Default Description
API Key empty DeepSeek API key (stored in Keychain)
Model V4 Flash deepseek-v4-flash or deepseek-v4-pro
System Prompt "帮我用简洁的语言解释清楚这段内容" Prompt appended to each request
Hotkey ⌘⌥C Fixed global shortcut
Max Text Length 8000 Truncate input beyond this length
Request Timeout 60s API call timeout
Launch at Login Off Start on boot

Architecture

Copopy/
├── CopopyApp.swift              # @main entry point
├── AppDelegate.swift            # NSApplication lifecycle
├── Models/
│   ├── DeepSeekModels.swift     # API request/response types
│   └── ExplanationState.swift   # Explanation state machine
├── Services/
│   ├── AIService.swift          # DeepSeek API client (Actor)
│   ├── HotkeyManager.swift      # Carbon global hotkey (⌘⌥C)
│   ├── SelectedTextReader.swift # Simulates Cmd+C and reads clipboard
│   ├── FloatingPanelController  # NSPanel + animations
│   ├── SettingsStore.swift      # UserDefaults + Keychain config
│   ├── KeychainManager.swift    # Secure API key storage
│   └── SettingsWindowController # Settings NSWindow
├── Views/
│   ├── MenuBar/MenuBarView.swift
│   ├── FloatingPanel/
│   │   ├── FloatingPanelContent.swift
│   │   └── MarkdownRenderer.swift
│   └── Settings/
│       └── SettingsView.swift
└── Utils/

Stack: Swift 6.0 · SwiftUI · AppKit · Carbon HotKeys · Accessibility API · URLSession async/await · @Observable · Actor isolation


Development

# Build & test
swift build
swift test

# Run in debug mode
swift run

# Build .app + sign + package
make dist

# Build .app only
make app

# Ad-hoc sign
make sign

# Clean
make clean

See REQUIREMENTS.md for the full software design document.


License

MIT

About

Select text, press ⌘⌥C, and Copopy explains it instantly in a floating Markdown window — powered by DeepSeek.

Topics

Resources

Stars

Watchers

Forks

Contributors