Skip to content

CleanShot X

CleanShot X is a macOS screenshot and screen recording app. Protocol Launcher allows you to generate CleanShot X URL scheme links.

Usage

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

URL Methods

The helpers below mirror CleanShot's official URL Scheme API.

All-In-One Mode

On-Demand
ts
import { allInOne } from 'protocol-launcher/cleanshot-x'

const url = allInOne()

const areaUrl = allInOne({
  x: 100,
  y: 120,
  width: 200,
  height: 150,
  display: 1,
})

Screenshots

On-Demand
ts
import { captureArea, capturePreviousArea, captureFullscreen, captureWindow, selfTimer, scrollingCapture, pin } from 'protocol-launcher/cleanshot-x'

const captureAreaUrl = captureArea()

const annotateAreaUrl = captureArea({
  action: 'annotate',
})

const regionUrl = captureArea({
  x: 100,
  y: 120,
  width: 200,
  height: 150,
  display: 1,
})

const previousUrl = capturePreviousArea({
  action: 'copy',
})

const fullscreenUrl = captureFullscreen({
  action: 'save',
})

const windowUrl = captureWindow({
  action: 'upload',
})

const timerUrl = selfTimer({
  action: 'pin',
})

const scrollingUrl = scrollingCapture({
  x: 100,
  y: 120,
  width: 200,
  height: 150,
  start: true,
  autoscroll: true,
})

const pinUrl = pin({
  filepath: '/Users/username/Desktop/my screenshot.png',
})

Screen Recording

On-Demand
ts
import { recordScreen } from 'protocol-launcher/cleanshot-x'

const url = recordScreen()

const areaUrl = recordScreen({
  x: 100,
  y: 120,
  width: 200,
  height: 150,
  display: 1,
})

Text Recognition

On-Demand
ts
import { captureText } from 'protocol-launcher/cleanshot-x'

const url = captureText()

const fileUrl = captureText({
  filepath: '/Users/username/Desktop/my screenshot.png',
})

const areaUrl = captureText({
  x: 100,
  y: 120,
  width: 200,
  height: 150,
  display: 1,
  linebreaks: true,
})

Annotate

On-Demand
ts
import { openAnnotate, openFromClipboard } from 'protocol-launcher/cleanshot-x'

const fileUrl = openAnnotate({
  filepath: '/Users/username/Desktop/my screenshot.png',
})

const clipboardUrl = openFromClipboard()

Desktop Icons

On-Demand
ts
import { toggleDesktopIcons, hideDesktopIcons, showDesktopIcons } from 'protocol-launcher/cleanshot-x'

const toggleUrl = toggleDesktopIcons()

const hideUrl = hideDesktopIcons()

const showUrl = showDesktopIcons()

Quick Access Overlay

On-Demand
ts
import { addQuickAccessOverlay } from 'protocol-launcher/cleanshot-x'

const url = addQuickAccessOverlay({
  filepath: '/Users/username/Desktop/my screenshot.png',
})

History Management

On-Demand
ts
import { openHistory, restoreRecentlyClosed } from 'protocol-launcher/cleanshot-x'

const historyUrl = openHistory()

const restoreUrl = restoreRecentlyClosed()

Settings

On-Demand
ts
import { openSettings } from 'protocol-launcher/cleanshot-x'

const url = openSettings()

const tabUrl = openSettings({
  tab: 'recording',
})

Official Documentation