Skip to content

jayf0x/majic

Repository files navigation

Mejic

Menu bar app that installs custom right-click actions into macOS Services — no signing, no app extensions, no Xcode required.

Install

Homebrew (recommended)

brew install jayf0x/majic/mejic

Uninstall:

brew uninstall mejic && brew untap jayf0x/majic

mise

mise use -g github:jayf0x/majic

Uninstall:

mise uninstall github:jayf0x/majic && mise rm github:jayf0x/majic

DMG

Download Mejic-<version>.dmg from the latest release, open it, drag Mejic.app to Applications, then right-click → Open to bypass Gatekeeper on first launch.

Uninstall: delete /Applications/Mejic.app.

Auto-start on login

After installing via brew or mise:

osascript -e 'tell application "System Events" to make login item at end with properties {path:"'"$(which Mejic)"'", hidden:false}'

Remove from login items:

osascript -e 'tell application "System Events" to delete login item "Mejic"'

Build from source

git clone https://github.com/jayf0x/majic
cd majic
swift build -c release
.build/release/Mejic

How It Works

Mejic reads ~/.config/mejic/commands.yaml and writes one Automator .workflow bundle per enabled command into ~/Library/Services/. macOS Services appear natively in Finder's right-click menu — no daemon, no Finder extension, no code signing.

Hitting Save in the popover:

  1. Writes the updated YAML
  2. Deletes old Mejic workflows from ~/Library/Services/
  3. Writes new ones
  4. Calls pbs -update to refresh the Services cache immediately

Writing Commands

Config lives at ~/.config/mejic/commands.yaml:

- label: Copy Path
  command: echo {file} | pbcopy
  enabled: true

- label: Open in VS Code
  command: open -a 'Visual Studio Code' {file}
  enabled: true

- label: Make Executable
  command: chmod +x {file}
  enabled: true

- label: Compress Video
  command: ffmpeg -i {file} -crf 28 {file}_compressed.mp4
  enabled: true

{file} is replaced with the selected file's full path, double-quoted: "${f}". For commands that reference {file} multiple times, each occurrence is substituted independently.

Quoting tip: do not wrap {file} in single quotes — it already gets double-quoted. Shell-escape other arguments normally.

Examples

What Command
Copy path echo {file} | pbcopy
Open in Sublime open -a 'Sublime Text' {file}
SHA256 checksum shasum -a 256 {file} | pbcopy
Move to Desktop mv {file} ~/Desktop/
New Terminal here open -a Terminal {file}
Word count wc -l {file} | pbcopy

Project Structure

Sources/Mejic/
  main.swift           — NSApplication entry, menu bar + popover
  ConfigStore.swift    — YAML read/write, ObservableObject
  WorkflowWriter.swift — generates .workflow bundles
  ContentView.swift    — SwiftUI editor UI
Resources/
  commands.yaml        — example config (copied to ~/.config/mejic/ on first launch)
scripts/
  build-dmg.sh         — builds Mejic.app + DMG installer
  Info.plist           — app bundle metadata template
homebrew-tap/          — separate repo: github.com/jayf0x/homebrew-majic
  Formula/mejic.rb

Help

To add more items to Finder right-click context menu:

defaults write -g NSServicesMinimumItemCountForContextSubmenu -int 999

About

Right-click front-end for personal scripts. Macos Util.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors