Skip to content

Command line

This page describes the iguana command line tool: what each subcommand does, how commands reach the running app, and what the exit codes mean.

The tool is the same binary that runs the app. It is inside the app bundle at Iguana.app/Contents/MacOS/iguana. Install shows how to put it on your PATH.

iguana daemon
iguana config init
iguana config path
iguana config check [file]
iguana settings
iguana tour
iguana help
iguana version
iguana <command>

Runs the window manager. This is what Iguana.app does when you open it, so you rarely need to type it. If Iguana is already running, it prints Iguana is already running. and exits.

Form What it does
iguana config init Writes the default config file, and iguana.schema.json beside it. An existing config file is left untouched.
iguana config path Prints where the config file lives.
iguana config check [file] Checks the config file, or the file you name, the way Iguana would load it, and prints every problem.

These work whether or not Iguana is running. See Configuration.

config check exits with status 0 when the file loads, with or without warnings, and also when there is no file, in which case it says that the built-in settings apply. It exits with status 1 when the file cannot be loaded because of a syntax error, or cannot be read.

Opens the settings window. This is the settings command, sent to the running app like any other, so Iguana has to be running.

Shows the welcome tour again. This is the tour command, so Iguana has to be running.

Prints the usage text and the list of commands. -h and --help do the same.

Prints the version number. --version does the same.

In a terminal, prints the usage text. When the binary is launched as an app, with no terminal attached, it runs the window manager.

Anything else on the command line is sent to the running app as a command:

Terminal window
iguana focus left
iguana resize grow width
iguana move-to-space 3 --stay
iguana status

What happens:

  1. The tool checks that the command is well formed. If it is not, it prints the reason and stops, without contacting the app.
  2. It sends the command to the running app over a socket in your own Library folder, ~/Library/Application Support/Iguana/iguana.sock. Only your user account can use it.
  3. The app runs the command and sends back its reply, which the tool prints.

Because every command works this way, anything a shortcut can do can also be scripted.

Code Meaning
0 The reply did not start with error. This includes replies such as ok: nothing in that direction.
1 The reply started with error, or Iguana is not running.
2 The command was not well formed, so it was not sent.

When Iguana is not running the tool prints:

iguana: the window manager is not running (open Iguana.app or run `iguana daemon`)
Command Shows
iguana status Whether Iguana is tiling, config problems, how many shortcuts are active, and the last shortcut received with its answer.
iguana list-windows Every window Iguana knows about and how it treats it.
iguana tree The layout tree of the desktops that are showing.
iguana list-spaces Which desktop each display is showing.

The log is at ~/Library/Logs/Iguana.log. To watch it:

Terminal window
tail -f ~/Library/Logs/Iguana.log
Path What it is
~/.config/iguana/iguana.toml The config file. Optional.
~/.config/iguana/iguana.schema.json The schema for editors. Iguana writes it beside the config file whenever it creates or changes that file: iguana config init, Edit Config File in the menu, or a change in the settings window.
~/Library/Application Support/Iguana/state.json Saved layouts, so they survive a restart of Iguana.
~/Library/Application Support/Iguana/iguana.sock The socket the command line tool talks to. It exists while Iguana runs.
~/Library/Logs/Iguana.log The log.
~/Library/Preferences/xyz.onlychan.iguana.plist Whether the welcome tour has been shown.