---
title: "Shortcuts & CLI Automation"
url: "https://pixeltamp.com/help/shortcuts-and-automation"
description: "Automate media compression with macOS Shortcuts, Finder Quick Actions, and the command line via shortcuts run."
---

# Shortcuts & CLI Automation

**ADVANCED FEATURE**

PixelTamp integrates natively with macOS. This brings batch compression and format conversion directly into macOS Shortcuts, Finder Quick Actions, Spotlight, and Terminal workflows via the built-in `shortcuts` command-line utility.

Because App Intents execute within macOS’ native architecture, automation works without background daemons, package managers, or extra installation steps.

* * *

## The “Tamp Media” Action

When PixelTamp is installed, macOS automatically registers its native action in the Shortcuts library:

-   **Action Name**: **Tamp Media**
-   **Action Summary**: `Tamp [Files] with [Preset] preset`
-   **Supported Inputs**: Single or multiple image files (JPEG, PNG, WebP, GIF, HEIC) and video files (MP4, MOV, M4V, WebM, AVI, MKV).

To add the action:

1.  Open **Shortcuts.app** on your Mac.
2.  Create a new shortcut by clicking the **+** button.
3.  In the right-hand action library panel, search for **PixelTamp** or **Tamp Media**.
4.  Drag the **Tamp Media** action into your workflow editor.

* * *

## Configuring Options in Shortcuts

All the core compression and downscaling dials available in the PixelTamp desktop application are configurable inside Shortcuts:

### 1\. Compression Presets

Click the **`[Preset]`** pill on the action card to select your quality target:

-   Tamped (Balanced)
-   Lossless (Visual Fidelity)
-   Aggressive (Smallest Size)

### 2\. Maximum Dimension Downscaling

Click the disclosure chevron (`>`) to reveal secondary parameters:

-   Downscales images and videos whose longest edge exceeds the selected threshold (smaller media is never upscaled):
    -   _Original Size_
    -   _2560px_ (Ultra-wide / 2K)
    -   _1920px_ (Full HD standard)
    -   _1024px_ (Mobile / thumbnail)

### 3\. Format Conversions

-   Convert to WebP: When toggled on, images (JPEG, PNG, GIF) are automatically transcoded into modern WebP format.
-   Convert GIF to MP4: When toggled on, bulky animated GIFs are transcoded into lightweight, streamable MP4 videos.

### 4\. Interactive “Ask Each Time” Menus

You can right-click any parameter pill (such as **Preset** or **Maximum Dimension**) and choose **Ask Each Time**. When the shortcut runs, macOS will present an interactive picker sheet asking for your preferred setting for that specific run.

* * *

## Finder Quick Actions (Right-Click to Tamp)

You can compress files directly from Finder without opening the PixelTamp main window:

1.  In **Shortcuts.app**, create a new shortcut and title it **Tamp Media**.
2.  In the Shortcut Details sidebar (icon with three sliders), check **Use as Quick Action** and ensure **Finder** is selected.
3.  Set the input to receive **Files** from Quick Actions.
4.  Add the **Tamp Media** action, passing the Shortcut Input as the `[Files]` parameter.
5.  Add a **Save File** action to specify where the output should be written (or check **Ask Where to Save**).
6.  Now, select any image or video in Finder, right-click, navigate to **Quick Actions**, and choose **Tamp Media**.

* * *

## Command-Line (CLI) Automation

Power users and developers can invoke PixelTamp directly from Terminal, shell scripts, or CI automation using macOS’ native `shortcuts` command-line tool.

### Basic Invocations

```
# Optimise a single image and save the result
shortcuts run "Tamp Media" -i ~/Desktop/photo.jpg -o ~/Desktop/photo_tamped.jpg

# Optimise a video
shortcuts run "Tamp Media" -i promo.mov -o promo_tamped.mp4
```

### Batch Shell Processing

You can pipe multiple files or run batch loops directly in `zsh`:

```
# Process all PNG files in a directory
for file in ~/Sites/assets/*.png; do
  shortcuts run "Tamp Media" -i "$file" -o "${file%.*}_tamped.webp"
done
```

### Scripting with Custom Shortcuts

If you frequently need specific presets (such as converting web banners to WebP at 1920px), you can save a dedicated shortcut named **“Tamp Web Banner”** with your chosen options fixed inside Shortcuts.app, then trigger it from shell:

```
shortcuts run "Tamp Web Banner" -i banner.png -o banner.webp
```

* * *

## Hotkeys, Raycast & Alfred Integration

Because PixelTamp exposes standard system App Shortcuts:

-   **System Keyboard Shortcuts**: Assign a global hotkey to your shortcut in **Shortcuts.app > Shortcut Details > Add Keyboard Shortcut**.
-   **Raycast**: Open Raycast, search for your PixelTamp shortcut by name, and execute it instantly with selected Finder items.
-   **Alfred**: Trigger the shortcut via the Alfred Shortcuts workflow or custom universal action.