Overview
Alfred is a productivity application for macOS that enhances your workflow with a powerful launcher, custom hotkeys, text expansion, clipboard history, and an extensive workflow automation system. It can be used as a Spotlight replacement with significantly more capability, offering web searches, calculator, dictionary, file navigation, and system commands from a single search bar.
Alfred’s Powerpack (paid license) unlocks the full workflow system, clipboard history, snippets, and more. Workflows are Alfred’s killer feature, allowing complex multi-step automations triggered by keywords, hotkeys, or file actions. There is a large community sharing workflows for everything from password management to API integrations.
Installation
# Install via Homebrew
brew install --cask alfred
# Or download from https://www.alfredapp.com
Initial Setup
- Launch Alfred and set the global hotkey (default:
Opt+Space)
- Optionally disable Spotlight:
System Settings > Keyboard > Keyboard Shortcuts > Spotlight
- Grant required permissions:
System Settings > Privacy & Security > Accessibility
- Install the Powerpack license for advanced features
Core Features
Keyboard Shortcuts
| Shortcut | Action |
|---|
Opt+Space | Open Alfred |
Enter | Execute selected action |
Cmd+Enter | Reveal file in Finder |
Opt+Enter | Search for item in files |
Ctrl+Enter | Act on item (show actions) |
Tab | Autocomplete / navigate into folder |
Cmd+C | Copy selected item |
Cmd+L | Show large type |
Cmd+, | Open Alfred Preferences |
Default Search Commands
| Prefix | Action | Example |
|---|
| (none) | Search apps, files, bookmarks | slack |
open | Open file/folder | open ~/Documents |
find | Search file system | find report.pdf |
in | Search file contents | in quarterly report |
define | Dictionary lookup | define ephemeral |
spell | Check spelling | spell recieve |
= | Calculator | = 42 * 3.14 |
Web Searches
| Keyword | Action |
|---|
google {query} | Google search |
wiki {query} | Wikipedia search |
amazon {query} | Amazon search |
maps {query} | Google Maps search |
images {query} | Google Images search |
yt {query} | YouTube search |
System Commands
| Command | Action |
|---|
lock | Lock the screen |
sleep | Put Mac to sleep |
restart | Restart the Mac |
shutdown | Shut down the Mac |
trash | Open Trash |
emptytrash | Empty the Trash |
screensaver | Start screen saver |
hide {app} | Hide an application |
quit {app} | Quit an application |
forcequit {app} | Force quit an application |
eject | Eject mounted volumes |
volup / voldown | Volume up / down |
mute | Mute audio |
Configuration
Preferences
General:
- Hotkey: Set global shortcut
- Where: Country for localized searches
- Startup: Launch at login
Features:
- Default Results: Configure what appears in search
- File Search: Set search scope and types
- Web Search: Custom search engines
- Calculator: Enable/disable
- Dictionary: Configure dictionary sources
- Contacts: Enable contact search
Appearance:
- Theme: Choose from built-in or custom themes
- Options: Result count, font size, blur
Custom Web Searches
# Add custom search engines in Preferences > Features > Web Search
Title: Stack Overflow
Keyword: so
URL: https://stackoverflow.com/search?q={query}
Title: GitHub
Keyword: gh
URL: https://github.com/search?q={query}
Title: npm
Keyword: npm
URL: https://www.npmjs.com/search?q={query}
Title: MDN Docs
Keyword: mdn
URL: https://developer.mozilla.org/en-US/search?q={query}
Title: Docker Hub
Keyword: docker
URL: https://hub.docker.com/search?q={query}
Clipboard History (Powerpack)
# Enable in Preferences > Features > Clipboard History
- Set history duration (24 hours, 7 days, 1 month, 3 months)
- Access via hotkey (e.g., Cmd+Opt+C)
- Search through clipboard history
- Supports text, images, and file references
- Merge multiple clipboard items
- Clear sensitive items
- Pin frequently used items
Snippets (Powerpack)
# Create snippets in Preferences > Features > Snippets
Name: Email signature
Keyword: ;sig
Content: Best regards,
Alice Smith
Senior Developer
# Dynamic placeholders:
{date} — current date
{time} — current time
{clipboard} — clipboard contents
{cursor} — cursor position
{date:medium} — medium format date
{date:YYYY-MM-DD} — custom date format
{random:UUID} — random UUID
{random:3:9} — random number 3-9
Advanced Usage
Workflows (Powerpack)
Workflows are Alfred’s most powerful feature. They chain together triggers, inputs, actions, and outputs.
Workflow Components:
| Type | Examples |
|---|
| Triggers | Keyword, Hotkey, File Action, Snippet, External |
| Inputs | Script Filter, File Filter, Keyword |
| Actions | Open File, Open URL, Run Script, System Command |
| Utilities | Conditional, Delay, Filter, Transform, JSON |
| Outputs | Notification, Copy to Clipboard, Play Sound, Large Type |
Script Filter (JSON Output)
#!/bin/bash
# A script filter that returns JSON results
cat << 'EOF'
{
"items": [
{
"title": "First Result",
"subtitle": "Description of first result",
"arg": "value-to-pass-along",
"icon": { "path": "icon.png" },
"mods": {
"cmd": {
"subtitle": "Hold Cmd for alternative action",
"arg": "alternative-value"
}
}
},
{
"title": "Second Result",
"subtitle": "Another result",
"arg": "second-value",
"valid": true
}
]
}
EOF
Python Workflow Script
#!/usr/bin/env python3
import json
import sys
query = sys.argv[1] if len(sys.argv) > 1 else ""
items = [
{
"title": f"Search for: {query}",
"subtitle": "Press Enter to search",
"arg": query,
"icon": {"path": "icon.png"},
}
]
print(json.dumps({"items": items}))
| Workflow | Description |
|---|
| Dash | Search API documentation |
| 1Password | Search and fill passwords |
| Kill Process | Find and kill processes |
| Colors | Color conversion and picker |
| Encode/Decode | Base64, URL, HTML encoding |
| Lorem Ipsum | Generate placeholder text |
| IP Address | Show local and public IP |
| Emoji Search | Find and copy emojis |
| Homebrew | Search and install brew packages |
| SSH Connections | Quick SSH to saved hosts |
Workflow Environment Variables
# Access workflow variables in scripts
echo "$query" # The user's input
echo "$alfred_version" # Alfred version
echo "$alfred_workflow_data" # Workflow data directory
echo "$alfred_workflow_cache" # Workflow cache directory
echo "$alfred_preferences" # Alfred preferences path
File Actions
# Create custom file actions in workflows:
1. Add a "File Action" trigger
2. Set accepted file types (e.g., public.image, public.text)
3. Connect to actions (e.g., Run Script, Open URL)
4. Select file in Alfred > press right arrow > choose your action
Troubleshooting
| Issue | Solution |
|---|
| Alfred not finding apps | Rebuild macOS index: sudo mdutil -E / or set search scope in Preferences |
| Permissions not working | Grant Accessibility and Full Disk Access in System Settings > Privacy |
| Clipboard history empty | Enable in Preferences > Features > Clipboard History; set retention period |
| Workflow not triggering | Check keyword spelling; verify connections between nodes in editor |
| Scripts failing | Check script permissions (chmod +x); test scripts in Terminal first |
| Hotkey conflict | Change in Preferences > Features > Hotkey; check other apps for conflicts |
| Search results stale | Rebuild Alfred cache: reload command; clear file cache in Preferences |
| Snippets not expanding | Enable auto-expansion in Preferences; check keyword prefix |
| Slow results | Limit search scope; exclude large directories like node_modules |