Skip to content
kazuphPublic

About

Raycast-like macOS launcher built with SwiftUI/AppKit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Sagasu

Sagasu is a small macOS launcher for applications, files, Apple Notes, web routes, and clipboard history.

Installation

brew install --cask kazuph/tap/sagasu

After installation, open Sagasu and grant it access in System Settings > Privacy & Security > Accessibility so the launcher and window-management shortcuts can control other apps.

Launching

  • Press Command-Space to open or close Sagasu.
  • Press Command-Shift-V to open Sagasu directly in clipboard history mode with v prefilled.
  • Sagasu switches the keyboard input source to an ASCII-capable layout when the launcher search field is focused.
  • Type normally to search applications and macOS settings such as Displays, Wi-Fi, and Sound. Google and ChatGPT routes are also shown for non-empty application searches.
  • Click a prefix button below the search field to insert that prefix plus a space and switch modes without typing it manually.
  • Select a result and press Return to run it.

Search prefixes

  • f searches files and folders across your whole home folder with Spotlight. Common directories such as Downloads, Documents, Music, Movies, and Pictures are prioritized, so f d can quickly open Downloads or Documents. Hidden paths, ~/Library (except CloudStorage, iCloud Drive, and Recent Places), node_modules, and the insides of packages such as .app bundles are excluded.
  • f with no query shows recently opened files and folders first (prefixed with 最近使った · ), then recently modified folders.
  • d searches directories only, with the same scope and exclusions as f . With no query it shows recently opened folders first, then recently modified folders.
  • t searches Herdr panes by project directory, agent, status, workspace, or pane id. Pressing Return focuses that Herdr pane and activates the terminal app.
  • n searches Apple Notes titles.
  • v searches clipboard text and image history.
  • vi searches clipboard images only.
  • g searches repositories owned by you and your GitHub organizations when gh is available. Local ghq list matches are shown first when ghq is installed.
  • gh searches repositories across GitHub when gh is available.
  • gi searches issues in repositories owned by you and your GitHub organizations when gh is available.
  • gp searches pull requests in repositories owned by you and your GitHub organizations when gh is available.
  • ghq searches only local ghq list entries.
  • Typing or pasting a file path (starting with /, ~, or file://) shows that file with Open and Copy File actions; a path ending in / also lists the folder contents, and a partial name lists matching entries. A path typed after f or d is handled the same way.
  • l searches Linear issues. On first use, Sagasu asks for a personal Linear API key and stores it in macOS Keychain.

When Sagasu opens with an empty query, recently modified folders are mixed near the top of the default application list. This makes recent work folders available immediately without switching modes. If you type f first, Sagasu switches to folder/file mode and only folder/file results are shown. Finder is indexed from /System/Library/CoreServices, so typing finder opens Finder from the application list. If the system clipboard contains an image, the default application search includes Image: Save Clipboard Image and Image: Extract Text from Clipboard Image. They are searchable with English terms such as i, image, ocr, text, extract, save, or downloads. Saving writes a PNG to ~/Downloads; extracting Japanese and English text copies recognized text back to the system clipboard and adds it to the latest clipboard history. GitHub search results open in Chrome. Sagasu enables these modes automatically when the gh command is installed; ghq results are enabled automatically when the ghq command is installed. Linear search results open in Chrome. Sagasu calls Linear's GraphQL API directly and sends personal API keys as Authorization: <API_KEY>, matching Linear's personal API key authentication.

History behavior

  • Clipboard entries move upward after they are restored, and Sagasu sends Command-V after selection so the restored entry is pasted into the previously active app.
  • Applications launched from Sagasu, and files and folders opened from Sagasu, are recorded with their last-used time.
  • Ranking boost for recently used items is 500 on the day of use, drops by 10 per day, and reaches 0 after 50 days. It applies to application search and to f / d results.
  • With an empty query, the 8 most recently launched applications (and the 10 most recently opened files or folders for f / d ) appear first, prefixed with 最近使った · in the subtitle.
  • Clipboard entries are kept for at least 3 months even when the count limit is exceeded. Reusing an entry extends it to 6 months from last use. Pinned entries do not expire.

Clipboard commands

  • Command-P toggles pinning for the selected clipboard entry.
  • Command-D deletes the selected clipboard entry.

Window management

Sagasu includes fixed Raycast-style window management shortcuts. These do not currently have settings UI.

Shortcut Action
Control-Shift-Command-J Bottom height cycle
Control-Shift-Command-I Center third
Control-Shift-Command-H Left width cycle
Control-Shift-Command-Return Maximize
Control-Shift-Command-Y Next display
Control-Shift-Command-P Previous display
Control-Shift-Command-L Right width cycle
Control-Shift-Command-K Top height cycle

The H/J/K/L commands cycle by inspecting the current window frame, not by counting rapid key presses. The cycle is 1/2 -> 1/3 -> 1/4 -> 2/3 -> 3/4 -> 1/2.

Window management uses macOS Accessibility. If the shortcuts do not move windows, grant Sagasu permission in System Settings > Privacy & Security > Accessibility. Scripts/build-and-open-app.sh keeps /Applications/Sagasu.app as the canonical local install and reuses its Developer ID Application identity on every update. It verifies a staged app before stopping Sagasu, keeps the previous app as a same-volume backup until the replacement succeeds, and never falls back to ~/Applications/Sagasu.app. If a second copy exists under ~/Applications, the install stops without changing either app; remove the duplicate before retrying. This keeps macOS Accessibility attached to one path and signing identity. If macOS opens the input source or Character Viewer popover when using Sagasu's launch shortcut, disable the conflicting macOS keyboard shortcuts for Command-Space and Command-Shift-Space.

Development

swift test
make app
make install
make package

make app builds a release-configuration app bundle at dist/Sagasu.app; outside the canonical installer, its signature follows the requested local identity and may be ad-hoc when that identity is unavailable. make install replaces /Applications/Sagasu.app with the same Developer ID Application identity and launches it. If no canonical app exists yet, set SAGASU_CODE_SIGN_IDENTITY to an available Developer ID Application identity; the install stops rather than using another path or signing identity. make package creates Sagasu-<version>.zip, Sagasu-<version>.dmg, and checksums.txt under dist/release.

Release CI

Pushing a tag that starts with v runs .github/workflows/release.yml. The workflow runs swift test, imports a Developer ID Application certificate into an ephemeral runner keychain, signs with Hardened Runtime and a secure timestamp, notarizes and staples Sagasu.app, then verifies the app and publishes its ZIP, DMG, and SHA-256 checksums as a GitHub Release.

Before the first tag release, a repository manager must configure these GitHub Actions Secrets. Their values are never committed to this repository.

Secret Value
SAGASU_SIGNING_CERTIFICATE_BASE64 Base64-encoded Developer ID Application .p12
SAGASU_SIGNING_CERTIFICATE_PASSWORD Password for that .p12
SAGASU_KEYCHAIN_PASSWORD Password used only for the ephemeral CI keychain
SAGASU_NOTARY_KEY_BASE64 Base64-encoded App Store Connect API key .p8
SAGASU_NOTARY_KEY_ID App Store Connect API Key ID
SAGASU_NOTARY_ISSUER_ID App Store Connect issuer ID

The workflow fails before publication when the Developer ID identity is not available. Local make install uses that same Developer ID identity for the canonical /Applications/Sagasu.app; it does not create an Apple Development or ad-hoc copy under ~/Applications. Updating kazuph/homebrew-tap is the next required step in the same delivery flow.

Completion means delivery through Homebrew

A change is complete after all of the following, unless the requester explicitly limits the scope:

  1. Verify the change, commit/push it, complete review, and merge it into main.
  2. Publish a new version tag and confirm that Release CI publishes the signed, notarized ZIP, DMG, and checksums.
  3. Verify the downloaded DMG checksum and update the version and SHA-256 in kazuph/homebrew-tap/Casks/sagasu.rb; review and merge that update.
  4. Synchronize the Homebrew tap and run brew upgrade --cask kazuph/tap/sagasu on this Mac.
  5. Launch /Applications/Sagasu.app, verify the released version, Developer ID signature and notarization, and exercise the changed behavior using the installed app. For window placement, run swift Scripts/verify-obails-window.swift with Obails running and Accessibility permission granted.

Merging source or installing a local build alone does not deliver the fix to Homebrew users. Report the public release URL, Homebrew version, installed version, and actual verification results before calling the work complete.

About

Raycast-like macOS launcher built with SwiftUI/AppKit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages