Skip to content

Bunch

Bunch is a macOS workspace automation app. Protocol Launcher allows you to generate deep links for Bunch.

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

All helpers below support Bunch's documented x-callback-url path format and official x-source, x-success, x-delay, and x-bunch-beta URL values when those parameters apply.

Open Bunch

On-Demand
ts
import { open } from 'protocol-launcher/bunch'

const url = open({
  bunch: 'Comms',
})

const shortcutUrl = open({
  bunch: 'Comms',
  syntax: 'shortcut',
})

const pathUrl = open({
  bunch: 'WorkBunch',
  syntax: 'path',
})

Open Bunch Beta

On-Demand
ts
import { open } from 'protocol-launcher/bunch'

const url = open({
  bunch: 'Comms',
  scheme: 'x-bunch-beta',
})

Open With Frontmatter Values

On-Demand
ts
import { open } from 'protocol-launcher/bunch'

const url = open({
  bunch: 'Default',
  variables: {
    launch: 'TextEdit',
  },
})

Open With Callback Parameters

On-Demand
ts
import { open } from 'protocol-launcher/bunch'

const callbackUrl = open({
  bunch: 'Comms',
  xCallback: true,
  'x-source': 'com.googlecode.iterm2',
})

const successUrl = open({
  bunch: 'Comms',
  'x-success': 'com.brettterpstra.marked2',
  'x-delay': 15,
})

Close Bunch

On-Demand
ts
import { close } from 'protocol-launcher/bunch'

const url = close({
  bunch: 'Comms',
})

const pathUrl = close({
  bunch: 'Comms',
  syntax: 'path',
})

Toggle Bunch

On-Demand
ts
import { toggle } from 'protocol-launcher/bunch'

const url = toggle({
  bunch: 'Comms',
})

const pathUrl = toggle({
  bunch: 'Comms',
  syntax: 'path',
})

Toggle Tagged Bunches

On-Demand
ts
import { toggle } from 'protocol-launcher/bunch'

const url = toggle({
  tag: 'Tag1+Tag2',
})

Edit Bunch

On-Demand
ts
import { edit } from 'protocol-launcher/bunch'

const url = edit({
  bunch: 'Example',
})

const pathUrl = edit({
  bunch: 'Example',
  syntax: 'path',
})

Run Raw Bunch Text Or File

On-Demand
ts
import { raw } from 'protocol-launcher/bunch'

const fileUrl = raw({
  file: '~/MiscBunch.bunch',
})

const textUrl = raw({
  txt: '(dnd on)',
})

Refresh Bunch Files

On-Demand
ts
import { refresh } from 'protocol-launcher/bunch'

const url = refresh()

Reveal Bunch Folder

On-Demand
ts
import { reveal } from 'protocol-launcher/bunch'

const url = reveal()

Set Preferences

On-Demand
ts
import { setPref } from 'protocol-launcher/bunch'

const toggleUrl = setPref({
  toggleBunches: 1,
})

const folderUrl = setPref({
  configDir: '~/Dropbox/Sync/Bunches',
})

Run Snippet

On-Demand
ts
import { snippet } from 'protocol-launcher/bunch'

const url = snippet({
  file: 'useful.snippets',
  fragment: 'Music',
  variables: {
    playlist: 'spotify:playlist:3cSpIL4Q0H3uqdBMbT6c9x',
  },
})

const pathUrl = snippet({
  file: 'useful.snippets',
  fragment: 'Speak',
  syntax: 'path',
  variables: {
    var1: 'foo',
    var2: 'bar baz',
  },
})

Open Preferences

On-Demand
ts
import { prefs } from 'protocol-launcher/bunch'

const url = prefs()

Official Documentation