Capso Screenshot Macos 标志

Capso Screenshot Macos

组织
reason-machines
capso-screenshot-macos

Capso 专家技能。Capso 是一款使用 Swift 6 和 SwiftUI 构建的开源 macOS 截图与屏幕录制应用。技能涵盖架构、从源代码构建、软件包 API 和贡献代码。

Add to TypingMind

概览

发布者reason-machines
代码仓库trending-skills
技能名称capso-screenshot-macos
星标数
89
复刻数
16
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 reason-machines 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Capso Screenshot Macos AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/reason-machines/trending-skills/tree/main/skills/capso-screenshot-macos
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/reason-machines/trending-skills.git /tmp/trending-skills
mkdir -p .claude/skills
cp -r /tmp/trending-skills/skills/capso-screenshot-macos .claude/skills/capso-screenshot-macos
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Capso Screenshot Macos,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Capso Screenshot Macos。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Capso Screenshot Macos 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Capso Screenshot & Screen Recording Skill

Skill by ara.so — Daily 2026 Skills collection.

Capso is a fully native, open-source macOS screenshot and screen recording app — a free alternative to CleanShot X. Built with Swift 6.0 and SwiftUI targeting macOS 15.0+. Its key strength for developers is a modular SPM architecture: 8 independent packages (CaptureKit, AnnotationKit, OCRKit, etc.) you can embed individually in your own app.


Installation

Download Pre-built App

bash
# Homebrew (recommended)
brew tap lzhgus/tap
brew install --cask capso

Or download the signed DMG from GitHub Releases.

Build from Source

Requirements: Xcode 16+, macOS 15.0+, XcodeGen

bash
brew install xcodegen

git clone https://github.com/lzhgus/Capso.git
cd Capso
xcodegen generate
open Capso.xcodeproj
# Press Cmd+R to build and run

CLI build:

bash
xcodegen generate
xcodebuild -project Capso.xcodeproj \
  -scheme Capso \
  -configuration Release \
  build

Project Architecture

Capso/
├── App/                     # Thin SwiftUI + AppKit shell
│   ├── CapsoApp.swift       # @main entry point
│   ├── MenuBar/
│   ├── Capture/
│   ├── Recording/
│   ├── Camera/
│   ├── AnnotationEditor/
│   ├── OCR/
│   ├── QuickAccess/
│   └── Preferences/
├── Packages/
│   ├── SharedKit/           # Settings, permissions, utilities
│   ├── CaptureKit/          # ScreenCaptureKit wrapper
│   ├── RecordingKit/        # Screen recording engine
│   ├── CameraKit/           # AVFoundation webcam capture
│   ├── AnnotationKit/       # Drawing/annotation system
│   ├── OCRKit/              # Vision framework OCR
│   ├── ExportKit/           # Video/GIF/image export
│   └── EffectsKit/          # Cursor effects, click highlights
└── project.yml              # XcodeGen project definition

The app shell is intentionally thin — all logic lives in packages. This means you can pull individual packages into your own app via SPM.


Using Capso Packages in Your Own App

Add a package as a local or remote SPM dependency in your Package.swift:

swift
// Package.swift
let package = Package(
    name: "MyApp",
    platforms: [.macOS(.v15)],
    dependencies: [
        // Remote (once published to a registry or via exact path)
        .package(path: "../Capso/Packages/CaptureKit"),
        .package(path: "../Capso/Packages/AnnotationKit"),
        .package(path: "../Capso/Packages/OCRKit"),
    ],
    targets: [
        .target(
            name: "MyApp",
            dependencies: [
                "CaptureKit",
                "AnnotationKit",
                "OCRKit",
            ]
        ),
    ]
)

Package API Examples

CaptureKit — Screen Capture

CaptureKit wraps ScreenCaptureKit for area, fullscreen, and window capture.

swift
import CaptureKit

// Area capture
let captureManager = CaptureManager()

// Fullscreen capture
Task {
    let image: NSImage = try await captureManager.captureFullscreen()
    // use image
}

// Window capture — pass SCWindow from ScreenCaptureKit
Task {
    let content = try await SCShareableContent.excludingDesktopWindows(false, onScreenWindowsOnly: true)
    if let window = content.windows.first {
        let image: NSImage = try await captureManager.captureWindow(window)
    }
}

// Area capture with a selection rect
Task {
    let rect = CGRect(x: 100, y: 100, width: 800, height: 600)
    let image: NSImage = try await captureManager.captureArea(rect)
}

RecordingKit — Screen Recording

swift
import RecordingKit

let recorder = ScreenRecorder()

// Configure recording
var config = RecordingConfiguration()
config.includesSystemAudio = true
config.includesMicrophone = false
config.outputFormat = .mp4   // or .gif
config.quality = .maximum    // .social, .web

// Start recording a region
Task {
    let outputURL = URL(fileURLWithPath: "/tmp/recording.mp4")
    try await recorder.startRecording(
        region: CGRect(x: 0, y: 0, width: 1920, height: 1080),
        to: outputURL,
        configuration: config
    )
}

// Pause / resume
recorder.pause()
recorder.resume()

// Stop and get final URL
Task {
    let finalURL = try await recorder.stopRecording()
    print("Saved to \(finalURL)")
}

CameraKit — Webcam PiP

swift
import CameraKit

let cameraManager = CameraManager()

// Request permission and start preview
Task {
    let granted = await cameraManager.requestPermission()
    guard granted else { return }
    
    // Get AVCaptureVideoPreviewLayer for embedding in a view
    let previewLayer = try await cameraManager.startCapture()
    
    // Set PiP shape
    cameraManager.pipShape = .circle      // .circle, .square, .portrait, .landscape
}

// Stop capture
cameraManager.stopCapture()

AnnotationKit — Drawing & Annotation

swift
import AnnotationKit

// Create an annotation canvas over an NSImage
let sourceImage = NSImage(named: "screenshot")!
let canvas = AnnotationCanvas(image: sourceImage)

// Add annotations programmatically
let arrow = ArrowAnnotation(
    from: CGPoint(x: 50, y: 50),
    to: CGPoint(x: 200, y: 200),
    color: .red,
    strokeWidth: 3
)
canvas.addAnnotation(arrow)

let rect = RectangleAnnotation(
    frame: CGRect(x: 100, y: 100, width: 300, height: 150),
    color: .blue,
    strokeWidth: 2,
    filled: false
)
canvas.addAnnotation(rect)

let text = TextAnnotation(
    text: "Look here!",
    position: CGPoint(x: 110, y: 110),
    fontSize: 18,
    color: .white
)
canvas.addAnnotation(text)

// Undo / redo
canvas.undo()
canvas.redo()

// Export annotated image
let result: NSImage = canvas.renderToImage()

Screenshot Beautification (AnnotationKit)

swift
import AnnotationKit

let beautifier = ScreenshotBeautifier(image: rawImage)
beautifier.backgroundColor = .systemBlue   // or gradient/custom
beautifier.padding = 40
beautifier.cornerRadius = 12
beautifier.shadowRadius = 20
beautifier.shadowOpacity = 0.4

let beautified: NSImage = beautifier.render()

OCRKit — Text Recognition

swift
import OCRKit

let ocrEngine = OCREngine()

// Instant OCR on an NSImage — returns plain text
Task {
    let text: String = try await ocrEngine.recognizeText(in: image)
    print(text)
    // Copy to clipboard
    NSPasteboard.general.clearContents()
    NSPasteboard.general.setString(text, forType: .string)
}

// Visual OCR — returns bounding boxes + text for each block
Task {
    let blocks: [OCRTextBlock] = try await ocrEngine.recognizeBlocks(in: image)
    for block in blocks {
        print("Text: \(block.text), Bounds: \(block.boundingBox)")
    }
}

ExportKit — Video & GIF Export

swift
import ExportKit

let exporter = MediaExporter()

// Export recorded video with quality preset
Task {
    let inputURL = URL(fileURLWithPath: "/tmp/raw_recording.mp4")
    let outputURL = URL(fileURLWithPath: "/tmp/final.mp4")
    
    try await exporter.exportVideo(
        from: inputURL,
        to: outputURL,
        quality: .social   // .maximum, .social, .web
    )
}

// Export as GIF
Task {
    let inputURL = URL(fileURLWithPath: "/tmp/raw_recording.mp4")
    let outputURL = URL(fileURLWithPath: "/tmp/output.gif")
    
    try await exporter.exportGIF(
        from: inputURL,
        to: outputURL,
        fps: 15,
        scale: 0.75
    )
}

SharedKit — Permissions & Settings

swift
import SharedKit

// Check and request screen recording permission
let permissionManager = PermissionManager()

Task {
    let hasScreen = await permissionManager.requestScreenRecordingPermission()
    let hasCamera = await permissionManager.requestCameraPermission()
    let hasMic = await permissionManager.requestMicrophonePermission()
}

// Access shared app settings
let settings = CapsoSettings.shared
settings.screenshotShortcut = "⌘⇧4"
settings.defaultSaveLocation = URL(fileURLWithPath: "/Users/me/Screenshots")
settings.showCountdownBeforeRecording = true
settings.countdownSeconds = 3

SwiftUI Integration Pattern

Embed a capture button in a SwiftUI view:

swift
import SwiftUI
import CaptureKit
import AnnotationKit

struct ContentView: View {
    @State private var capturedImage: NSImage?
    @State private var showAnnotationEditor = false
    private let captureManager = CaptureManager()

    var body: some View {
        VStack {
            if let img = capturedImage {
                Image(nsImage: img)
                    .resizable()
                    .scaledToFit()
                    .frame(maxWidth: 600)
                
                Button("Annotate") {
                    showAnnotationEditor = true
                }
            }

            Button("Capture Fullscreen") {
                Task {
                    capturedImage = try? await captureManager.captureFullscreen()
                }
            }
        }
        .sheet(isPresented: $showAnnotationEditor) {
            if let img = capturedImage {
                // Hypothetical SwiftUI wrapper around AnnotationCanvas
                AnnotationEditorView(image: img) { annotated in
                    capturedImage = annotated
                    showAnnotationEditor = false
                }
            }
        }
    }
}

Running Package Tests

Each package is independently testable:

bash
swift test --package-path Packages/SharedKit
swift test --package-path Packages/CaptureKit
swift test --package-path Packages/AnnotationKit
swift test --package-path Packages/OCRKit
swift test --package-path Packages/RecordingKit
swift test --package-path Packages/CameraKit
swift test --package-path Packages/ExportKit
swift test --package-path Packages/EffectsKit

Required Entitlements & Info.plist

Your app using Capso packages needs these permissions:

xml
<!-- Info.plist -->
<key>NSScreenCaptureUsageDescription</key>
<string>Required for screenshot and screen recording.</string>

<key>NSCameraUsageDescription</key>
<string>Required for webcam PiP during screen recording.</string>

<key>NSMicrophoneUsageDescription</key>
<string>Required to capture microphone audio during recording.</string>
xml
<!-- App.entitlements -->
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<!-- Screen capture is runtime-only via TCC, no entitlement needed -->

Common Patterns

Pin Screenshot to Screen (Always-on-Top)

swift
import AppKit

func pinScreenshot(_ image: NSImage) {
    let window = NSPanel(
        contentRect: NSRect(x: 100, y: 100, width: image.size.width, height: image.size.height),
        styleMask: [.nonactivatingPanel, .titled, .closable, .resizable],
        backing: .buffered,
        defer: false
    )
    window.level = .floating           // Always on top
    window.isFloatingPanel = true
    window.hidesOnDeactivate = false
    window.contentView = NSImageView(image: image)
    window.makeKeyAndOrderFront(nil)
}

Global Keyboard Shortcut (via SharedKit pattern)

swift
import Carbon
import AppKit

// Register a global hotkey for area capture
func registerCaptureHotkey() {
    NSEvent.addGlobalMonitorForEvents(matching: .keyDown) { event in
        // Check for ⌘⇧4
        if event.modifierFlags.contains([.command, .shift]),
           event.keyCode == 21 { // keyCode 21 = '4'
            NotificationCenter.default.post(name: .startAreaCapture, object: nil)
        }
    }
}

extension Notification.Name {
    static let startAreaCapture = Notification.Name("startAreaCapture")
}

Troubleshooting

xcodegen generate fails

  • Ensure XcodeGen ≥ 2.40: brew upgrade xcodegen
  • Check project.yml is not modified with invalid YAML syntax
  • Run xcodegen generate --spec project.yml for explicit path

"Screen Recording permission denied" at runtime

  • Go to System Settings → Privacy & Security → Screen Recording and enable Capso
  • For your own app using CaptureKit, you must trigger the permission prompt first via PermissionManager.requestScreenRecordingPermission()

Build errors with Swift 6 concurrency

  • Capso targets Swift 6 strict concurrency. Ensure all closures that touch UI are @MainActor
  • Add @preconcurrency import for ScreenCaptureKit if you see warnings in Xcode 16

GIF export is slow

  • Lower the fps (e.g. fps: 10) and scale (e.g. scale: 0.5) in ExportKit
  • Use .web quality preset for faster encoding

Camera not showing in PiP

  • Verify camera permission is granted in System Settings
  • Call CameraManager.requestPermission() before startCapture()
  • Ensure your entitlement includes com.apple.security.device.camera

License Note

Capso uses Business Source License 1.1:

  • ✅ Personal use, internal company use, forking, modifying
  • ❌ Selling a competing screen-capture product based on this code
  • ✅ Automatically becomes Apache 2.0 in 2029 per release

When embedding packages in your own non-competing app, you are permitted under BSL 1.1.


Key Links

常见问题

Capso Screenshot Macos AI 技能有什么作用?

Capso 专家技能。Capso 是一款使用 Swift 6 和 SwiftUI 构建的开源 macOS 截图与屏幕录制应用。技能涵盖架构、从源代码构建、软件包 API 和贡献代码。

为什么在 TypingMind 中使用 Capso Screenshot Macos?

因为您只需安装一次,就能搭配任何模型使用。Capso Screenshot Macos 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Capso Screenshot Macos?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/reason-machines/trending-skills/tree/main/skills/capso-screenshot-macos。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Capso Screenshot Macos?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Capso Screenshot Macos 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Capso Screenshot Macos 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Capso Screenshot Macos AI 技能免费吗?

reason-machines 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇