# Automation: CLI, URL scheme and Raycast

Source: https://chainyourmac.com/docs/automation  
Updated: 2026-11-12 · Author: Ahmed Gagan (maker of ChainYourMac)

Everything you can do with a shortcut you can also do from a script. **A command-line tool, a URL scheme and Raycast commands**, plus shortcuts sent by other apps.

## The command-line tool

In the app, open **Help › Integrations** and install the `chainyourmac` command. It's a link at `~/.local/bin/chainyourmac` that points into the app, so it stays current with updates. If your shell can't find it, add this line to `~/.zshrc`:

```
export PATH="$HOME/.local/bin:$PATH"
```

Then run window actions from the terminal, for example:

```
chainyourmac window focus east
```

## The URL scheme

Every `chainyourmac://` URL runs one action. Use `open -g` so ChainYourMac doesn't come to the front:

```
open -g "chainyourmac://window/focus/east"
```

| URL | Does |
|---|---|
| chainyourmac://start · stop · restart · toggle | Start, stop or restart the window manager |
| …/window/focus/<west\|east\|north\|south\|first\|last> | Move focus |
| …/window/swap/<west\|east\|north\|south\|first\|last> | Move the focused window |
| …/window/center | Centre the focused column |
| …/window/resize | Next preset width |
| …/window/fullwidth | Toggle full width |
| …/window/wider · narrower | Column width |
| …/window/taller · shorter · equalize | Heights in a stack |
| …/window/stack · unstack | Stack into the left column / out to the right |
| …/window/consume/east · expel/west | Stack into the right column / out to the left |
| …/window/tabbed | Stacked ↔ tabbed column |
| …/window/manage | Float / unfloat |
| …/window/nextdisplay | Send to the next display |
| …/window/pin/<left\|right> | Pin to an edge, or unpin |

URLs are checked against this list before anything reaches the window manager, so a malformed or unknown URL does nothing.

## Raycast

Help › Integrations exports Raycast script commands for ChainYourMac's actions. Add them to Raycast's Script Commands and each action is searchable in Raycast, and can have its own hotkey.

## Keyboard Maestro, BetterTouchTool, AppleScript

These tools can send ChainYourMac's keyboard shortcuts, and ChainYourMac treats them exactly like keys you type. They can also open the URLs above. That makes it easy to bind actions to a mouse button, a trackpad gesture or a Stream Deck key.

**A window manager you can script.** One-time purchase, free updates, macOS 13 or later on Apple silicon. Price and checkout: https://chainyourmac.com/#pricing (one-time purchase, lifetime license; macOS 13+ on Apple silicon).

## FAQ

### Does ChainYourMac work with Raycast?

Yes. Help › Integrations in the app exports Raycast script commands for its actions, and Raycast (like Keyboard Maestro, BetterTouchTool and AppleScript) can also send ChainYourMac's keyboard shortcuts, which work exactly like keys you type.

### Can I start or stop ChainYourMac from a script?

Yes: `open -g "chainyourmac://stop"`, `chainyourmac://start`, `chainyourmac://restart` or `chainyourmac://toggle`.

## Related

- [Keyboard shortcuts](https://chainyourmac.com/docs/keyboard-shortcuts) — Every default shortcut, and how to change them.
- [Settings reference](https://chainyourmac.com/docs/settings) — Every option in the Configuration screen, with its default.
- [ChainYourMac vs yabai](https://chainyourmac.com/chainyourmac-vs-yabai) — Scrolling strip vs BSP tiling — and the SIP question.
- [Window manager for coding](https://chainyourmac.com/window-manager-for-developers-mac) — A developer layout: editor, terminals, browser and agents side by side.
