Repository navigation
✨ Improved URL API and new CLI - #1076
Merged
Merged
Conversation
mrkai77
force-pushed
the
kai/improved-api
branch
from
April 4, 2026 20:28
a8273e1 to
576b7d1
Compare
4 of 6 tasks
mrkai77
force-pushed
the
kai/improved-api
branch
from
October 9, 2026 05:35
8576264 to
4114831
Compare
mrkai77
marked this pull request as ready for review
October 9, 2026 05:35
mrkai77
force-pushed
the
kai/improved-api
branch
from
October 13, 2026 07:51
4198a3e to
9587a39
Compare
mrkai77
force-pushed
the
kai/improved-api
branch
from
November 22, 2026 05:27
461b892 to
9f88f90
Compare
- Talk to Loop over a per-user Unix socket, with JSON shared between the CLI and the app - Install and uninstall the loop symlink from Advanced settings through the privileged helper - Remove the old URL command code it replaces
- Share routes, models, JSON and formatting between the CLI and the app - Show list results in a Loop output window, and failures in an alert - Fix reopening Settings, a crash with a missing screen, and the alert after canceling authorization
- Start the socket after older instances exit, and only remove the socket file this instance bound - Time out sends as well as reads, and explain timeouts and oversized requests - Share LoopSocketManager like the other managers, with start() and shutdown() - Log requests once, and responses at debug level
mrkai77
force-pushed
the
kai/improved-api
branch
from
November 22, 2026 21:47
9f88f90 to
356e506
Compare
- loop run <target> takes a built-in action like right-half, or key:, gesture: and radial-menu: ids derived like the upcoming settings file's - loop list actions|keys|gestures|radial-menu|windows|screens, and the same routes as loop:// URLs - Target windows and screens like keybinds do, refuse excluded apps and ignored full-screen windows, and advance cycles - Version the JSON, keep every key present, and give errors a stable code and the CLI sysexits exit codes - Keep URLs from earlier versions working, with tests - Document the new commands
- Check the client's signature on every message, and trust the bundle path of the code that passed the check - Only link a loop-cli signed by Loop's developer, and replace the link through the opened /usr/local/bin folder - Offer the Applications folder again when the password prompt is canceled, without catching unrelated cancellations - Localize the helper coordinator's errors - Use the same wording for the command-line tool's states in settings and the CLI - Move PrivilegedHelperCoordinator to Utilities, as the updater and the CLI installer share it
- Align lists in columns under a header, with what to pass to run in the first column, and fit them to the terminal's width - Print tab-separated lines without a header when piped, so cut and awk can read them - Dim inactive bindings, mark successful runs with a green check, and color "Error:" red - Honor CLICOLOR_FORCE, and check stderr separately for colored errors - Use the same tables in Loop's output window
mrkai77
force-pushed
the
kai/improved-api
branch
from
November 22, 2026 21:55
356e506 to
56d036c
Compare
- Run a cycle's next action on the new screen after a screen switching one, like keybinds do - Reject a screen ID for screen switching actions, and a query parameter without a value - Report moving to a desktop that doesn't exist as a failure - Keep the old direction/custom… and action/<name> URLs matching what they did before - List every desktop action, not only as many as there are right now - Read the request before refusing it, so the CLI shows why instead of a write error - Treat a response that isn't valid JSON as Loop being unavailable, and reject an empty --bundle-id - Check the command-line tool's status again when Loop becomes active, and keep tabs from misaligning tables
- Only open Settings for a launch from Finder, the Dock or open, which has an open-application event that a URL launch doesn't - Hide the Dock icon macOS adds before handing Loop a URL, unless Settings is open or the Dock icon is turned on - Replace the deferred Settings open, which depended on the URL arriving within one run loop turn
mrkai77
force-pushed
the
kai/improved-api
branch
from
November 23, 2026 00:50
be4ce59 to
7df3d83
Compare
- Give the helper's command-line tool errors one shared path - Keep the CLI's English install reasons next to the settings warnings for the same statuses - Let the action picker list every desktop instead of rebuilding its section - Show the same key symbols in the CLI as in the Keybinds tab - Share errno text and the loop-cli bundle layout - List Loop’s own windows too, as they can be targeted like any other - Encode nil as null with @NullEncoded instead of hand-written encoders - Make LoopTarget a command-line argument directly, and build CLI invocations from route components - Split the shared files so each holds one type and what belongs to it - Use parameterized tests
…ndle+Extensions - Follow the "Always start from the first action" setting for cycles, as each run is its own session like a separate keybind press - Refuse to run without Accessibility access, like keybinds - Move Bundle+Extensions to Shared, so the CLI reads its version with it
🔥 Derive default radial menu IDs from their names, like keybinds
mrkai77
force-pushed
the
kai/improved-api
branch
from
November 23, 2026 03:07
c26db0c to
39c55b0
Compare
4 of 6 tasks
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
loopcommand that can be installed from Advanced settings, and reworks the URL scheme so both run the same commands. Unlike opening a URL, the command returns results, so scripts can list windows, actions and keybinds, and tell whether a command worked. Targets are spelled like actions will be in the upcoming settings file, so scripts written now keep working once it lands. This PR:loop run <target>andloop list actions|keybinds|gestures|radial-menu|windows|screens, with matchingloop://run/…andloop://list/…URLs. A target is a built-in action likeright-half, or one of your own askeybind:<id>,gesture:<id>orradial-menu:<id>, with IDs derived from names,--window-id,--bundle-idand--screen-idpick something else, and only the CLI opens apps that aren't running,--jsonprints a versioned response with stable error codes, and exit codes tell apart a failed command, bad usage, Loop not running and a timeout,/usr/local/bin/loopthrough the privileged helper (renamed fromLoopUpdaterHelper, as it's no longer just for updates), which now checks the signatures of both Loop andloop-cliand replaces the link without following symlinks. Loop only answers the CLI once it's been installed,loop://direction/rightandloop://keybind/<name>working,loop://URL from showing the Dock icon or opening Settings. macOS gives Loop a Dock icon before handing it a URL since Loop isn't anLSUIElementapp, so Loop now hides it again, and only opens Settings when launched from Finder, the Dock oropen