DockLock Plus CLI

Updated November 17, 2026

Use DockLock Plus from Terminal to move the Dock, keep it on one display while an app is running, or read its status from a script. Use --version to identify your installed build and --help to see which commands it supports.

Getting started

The CLI is included in the app. Set a shell variable to its executable, then use it for the examples below.

docklock="/Applications/DockLock Plus.app/Contents/MacOS/DockLock Plus"
"$docklock" --help
"$docklock" --version
"$docklock" display list
"$docklock" dock status --json

Commands connect to DockLock and start the app if needed. --help and --version work without starting its control service. Running the executable without arguments opens the app normally. If the app is already closed, quit succeeds without starting it.

Commands in the dock, display, rules, settings, shortcuts, and permissions groups accept --json for JSON output. For unattended scripts, complete setup first and append --no-ui to suppress DockLock’s dialogs. You can use both flags once each, in either order, at the end of a command. Script installation is interactive. The launch and quit commands take no options.

Basic Dock locking needs no extra permission. Automatic relocation and requested moves need “Device Control and Data Access” on macOS 27 or later, called “Accessibility” on earlier versions. Reading or changing Dock size, position and auto-hide uses the included Dock Control Script and Automation permission for System Events.

Dock controls

CommandBehavior
dock statusShow movement, hiding, pause, detected Dock location, and App Rules state
dock movementRead the selected movement mode
dock movement lock-selectedLock the Dock to allowed displays
dock movement follows-mouseFollow the pointer between compatible displays
dock movement offTurn off movement control and suspend App Rules
dock hide onHide the Dock on every display without changing the selected movement mode
dock hide offEnd that hiding override and restore the previous macOS auto-hide preference
dock hide toggleToggle the hiding override
dock positionRead the Dock’s current position through the script
dock position bottomSet position to bottom, left, or right
dock auto-hideRead macOS auto-hide through the script
dock auto-hide onSet macOS auto-hide to on or off
dock sizeRead the configured size as a percentage from 0 through 100
dock size 30Set the configured size to 30%
dock size increaseIncrease size by the saved shortcut step
dock size decrease 5Decrease size by 5 percentage points
dock pausePause control for 15 minutes
dock pause 5Pause for 5, 15, or 60 minutes
dock resumeResume control without waiting for the pause to expire

dock hide without a value reports whether the override is on. Movement and App Rules are independent settings. Turning movement off suspends rules without erasing them. Use rules enabled off to disable rules themselves.

End an active hiding override before changing macOS auto-hide. Appearance commands use the same priority and restoration behavior as the app. A matching App Rule can temporarily control the Dock’s appearance. Size percentages represent the configured size range. macOS can fit a crowded Dock into the available space, so its visible icon size may be smaller.

Moving the Dock

"$docklock" display list --json
"$docklock" dock move --display "DISPLAY_ID"
"$docklock" dock move --direction right
"$docklock" dock move --mouse
"$docklock" dock move --active-window

Use left, right, up, or down for direction. A display selector can be its ID, an exact hardware or custom name, or a quoted number such as "#2" from the current arrangement. Use IDs for identical monitors. Ambiguous names return an error.

Relocation requires a bottom Dock, mouse control permission, an available bottom edge on the destination, and a mode that permits manual movement. Resume control and turn off hiding before moving it. Set dock movement lock-selected when leaving Dock Follows Mouse.

Directional movement needs a known source display. If the Dock is hidden and its location cannot be identified, use --display. DockLock checks the saved orientation through the script before accepting that request.

Display preferences

CommandBehavior
display listList connected displays and their IDs
display currentReport the display currently detected as containing the Dock
display allow "DISPLAY_ID"Read whether the display is allowed
display allow "DISPLAY_ID" onAllow the display, or use off to exclude it
display only "DISPLAY_ID"Allow only this display
display size "DISPLAY_ID"Read its saved size preset
display size "DISPLAY_ID" 40Enable a 40% size preset
display size "DISPLAY_ID" offDisable its size preset
display name "DISPLAY_ID"Read its displayed name
display name "DISPLAY_ID" "Editing display"Save a custom name
display name "DISPLAY_ID" --resetRestore the hardware name

Size presets follow the display. DockLock restores the allowed displays for the current arrangement when it has a saved match. An enabled size edit applies when DockLock knows the Dock is on that display. Otherwise it is saved for the next confirmed placement. Pause, hiding, and App Rules retain their usual priority. Disabling a size preset leaves the current Dock size unchanged.

For scripts, copy the persistent id from display list --json. An exact hardware name, custom name or legacy display UUID also works if it matches only one connected display. Numbers such as "#2" follow the current visual order and can change when you rearrange monitors. Custom names are trimmed and limited to 80 characters, as in Settings.

display list --json includes each display’s ID, number, custom and hardware names, geometry, main-display flag, allowed state, bottom-edge compatibility, detected Dock presence, and saved size preset.

App Rules

Rules use application bundle IDs, such as com.apple.Safari. Quote "*" to target any active app.

"$docklock" rules list --json
"$docklock" rules add --app com.apple.Safari --name Safari --size 35
"$docklock" rules add --app "*" --follow-window on
"$docklock" rules enabled on

Adding a rule returns its ID. New rules start enabled, use the active-window trigger, and have no actions unless specified. Adding a rule does not turn on the master App Rules switch.

To keep the Dock on your presentation display while Keynote is running, first find that display in display list. This example uses the second display. The rule remembers its ID even if its number changes.

"$docklock" rules add --app com.apple.iWork.Keynote --trigger running --display "#2"
"$docklock" rules enabled on
"$docklock" rules list --json

Use the ID returned by rules add in place of RULE_ID below. To clear only the display target and keep the rule, use rules update "RULE_ID" --display unchanged. Rule order starts at 1.

"$docklock" rules update "RULE_ID" --size 45
"$docklock" rules update "RULE_ID" --enabled off
"$docklock" rules order "RULE_ID" 1
"$docklock" rules remove "RULE_ID"
"$docklock" rules enabled off
Option for rules add or rules updateValues
--appBundle ID, or "*" for any active app
--nameName shown in the rule list
--enabledon or off
--triggeractive-window, window-on-dock-display, or running
--hideon or off
--positionunchanged, bottom, left, or right
--follow-windowon or off
--displayA connected display ID, exact name or quoted number, or unchanged to clear the target
--sizeunchanged, or 0 through 100

A fixed display works with active-window or running. Following a window requires active-window, as does a rule for "*". Choose either a fixed display or --follow-window on, not both. Both movement actions require hiding to be off and position to be bottom or unchanged. The target must have an available bottom edge.

Specific-app rules take priority over any-app rules. List order breaks ties for movement, position and size. If the target display disconnects or becomes incompatible, DockLock uses the next eligible movement rule or your usual display settings. While a fixed target is in effect, manual moves and changes to allowed displays return exit code 3. Edit or disable that rule to change displays. Your normal display selection is preserved.

rules enabled reads the master switch. In rules list --json, each rule has a targetDisplay and targetDisplayName, both null when no target is set. Read effect.targetDisplay for the target currently in effect. The same information is under appRules in dock status --json.

You can still disable rules if permission is revoked. If restoration fails, DockLock keeps the previous settings and reports that rules are paused. If you edit a rule in Settings while a command is waiting for permission, the command is cancelled instead of overwriting the newer edit.

Advanced settings

"$docklock" settings list --json
"$docklock" settings get enhanced-relocation
"$docklock" settings set enhanced-relocation off
SettingValues
enhanced-relocationon or off
alternative-lockingon or off
launch-at-loginon or off
hide-dock-iconon or off
hide-menu-iconon or off
warn-no-displayson or off
warn-incompatible-displayon or off
hide-update-noticeon or off
unlock-modifiernone, shift, control, option, or command
wake-retry-seconds1 through 120
display-change-retry-seconds1 through 120

These settings correspond to the current app controls. Turning enhanced relocation off is available for troubleshooting. The standard locking method remains the default. Alternative locking requires mouse control permission.

Keyboard shortcuts

"$docklock" shortcuts list --json
"$docklock" shortcuts set mouse-display 46 control+option
"$docklock" shortcuts clear mouse-display
"$docklock" shortcuts arrows control+option
"$docklock" shortcuts arrows off
"$docklock" shortcuts size-step 5

shortcuts set takes an action name, a macOS virtual key code from 0 through 127, and modifiers joined with +. Use command, control, option, and shift. Include Command, Control, or Option. The example assigns Control-Option-M using key code 46.

Use action names from shortcuts list. Arrow shortcuts are configured together with shortcuts arrows. shortcuts size-step sets the default size adjustment from 1 through 100 percentage points. Conflicting or reserved combinations are rejected without replacing the previous shortcut. These commands use the app’s existing shortcut registration.

Permissions and app lifecycle

"$docklock" permissions status --json
"$docklock" permissions install-script
"$docklock" launch
"$docklock" quit

Permission status inspects mouse access and the script installation without running the script or requesting Automation permission. Script installation opens the existing setup flow and cannot be combined with --no-ui. quit uses the normal shutdown flow, including restoration of temporary Dock settings.

Script responses

Successful commands write to standard output. Failures write to standard error and return a nonzero exit code.

ResponseMeaning
OKThe requested operation completed
SavedA setting was stored, with the app’s usual application rules
AcceptedRelocation was requested, without asserting that macOS completed it
PausedThe pause was entered

Queries return their values. Rule creation and updates return the rule ID. With --json, queries return JSON values and mutations return objects, including an ID for rule edits. Errors return an object with error and code.

Exit codeMeaning
0Success
1Connection or transport failure
2Invalid command or input
3Action unavailable in the current state
4Permission required or denied
5Another operation is busy
6Operation cancelled
7Operation failed

Unknown Dock locations and positions are null in the new JSON queries. DockLock does not guess a source display when detection is unavailable. cachedSizePercent in dock status is the last known configured size and can also be null. Use dock size for a fresh script read. pauseUntil is a Unix timestamp while a timed pause is active, zero when no timed pause remains, or negative when resuming failed.

"$docklock" dock size 30 --no-ui --json
"$docklock" display current --json

For Apple Shortcuts, URL commands and Raycast, see the DockLock Plus automation guide.