explaingit

kasper/phoenix

4,531Objective-CAudience · developerComplexity · 2/5Setup · easy

TLDR

A tiny macOS app that lets you control window layout and app behavior using JavaScript scripts you write yourself, define keyboard shortcuts to snap, resize, or move windows automatically.

Mindmap

mindmap
  root((Phoenix))
    What it does
      Window management
      Keyboard shortcuts
      App automation
    How it works
      JS config file
      TypeScript support
      Auto-reload on save
    Controls
      Windows screens
      Mouse position
      System events
    Setup
      Drag-and-drop install
      Homebrew option
      macOS 10.14 plus
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Write a JavaScript script to snap windows to the left or right half of your screen with a keyboard shortcut.

USE CASE 2

Automate macOS window layouts so specific apps always open at a set size and position.

USE CASE 3

Trigger actions, like launching an app or moving a window, when system events happen, such as connecting a monitor.

USE CASE 4

Share and remix window management configs with the community wiki for ready-made Phoenix configurations.

Tech stack

JavaScriptTypeScriptObjective-CmacOS

Getting it running

Difficulty · easy Time to first run · 30min

Requires macOS 10.14 or higher and granting accessibility permission on first launch, install via drag-and-drop or Homebrew.

No license information was mentioned in the explanation.

In plain English

Phoenix is a small macOS app that lets you control how your windows and applications behave using JavaScript code you write yourself. Instead of clicking through menus to move or resize windows, you write a script that runs automatically. For example, you could write a script that snaps any window to the left half of your screen when you press a certain keyboard shortcut, or that launches a specific app when a USB drive is connected. The app sits in your Mac's status bar at the top of the screen, or runs silently in the background. Phoenix reads a configuration file at a fixed location on your Mac, and every time you edit that file it picks up your changes. You can write your configuration in plain JavaScript or in TypeScript, which is a version of JavaScript with extra type checking. The documentation walks through the full API so you can interact with screens, windows, apps, mouse position, and system events. Installing Phoenix is a simple drag-and-drop into your Applications folder, or a one-line install through Homebrew if you use that. The first time you run it, macOS will ask you to grant it accessibility permission so it can control your windows. This is a standard macOS security step for any app that interacts with the desktop. Phoenix is intended for people who are comfortable writing small scripts and want more control over their window layout than macOS provides by default. The README links to a wiki where other users share their own configuration files as examples. The project requires macOS 10.14 or higher and is currently at version 4.0.1.

Copy-paste prompts

Prompt 1
Write a Phoenix config in JavaScript that snaps the current window to the left half of the screen when I press Ctrl+Cmd+Left, and to the right half with Ctrl+Cmd+Right.
Prompt 2
I use a MacBook that connects to an external monitor. Write a Phoenix script that automatically repositions my most-used apps when the external display is connected or disconnected.
Prompt 3
How do I set up Phoenix on macOS? Walk me through installing it via Homebrew and granting the required accessibility permission.
Prompt 4
Write a Phoenix script that lets me cycle through my open windows of the same app using a keyboard shortcut.
Prompt 5
How do I write Phoenix config in TypeScript instead of JavaScript? What do I need to set up and are there type definitions available?
Open on GitHub → Explain another repo

← kasper on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.